Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 1 | TOP = ../../.. |
| 2 | include $(TOP)/configs/current |
| 3 | |
| 4 | # This is a bit messy. We want this libGL to be capable of loading old |
| 5 | # interface drivers, so we have to turn off DRI_NEW_INTERFACE_ONLY. However, |
| 6 | # glcontextmodes.c is built elsewhere with DNIO on, so we symlink it across. |
| 7 | # |
| 8 | # Furthermore, context creation has evolved over the years, such that this |
| 9 | # code will not build with DNIO defined. When we finally drop old interface |
| 10 | # support in libGL, we need to clean up both glxcmds.c and dri_interface.h. |
| 11 | |
| 12 | DEFINES += -DGLX_DIRECT_RENDERING -DGLXEXT -DXF86DRI -DGLX_USE_DLOPEN \ |
Adam Jackson | 1cda832 | 2004-10-25 22:19:43 +0000 | [diff] [blame] | 13 | -DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UDRI_NEW_INTERFACE_ONLY |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 14 | |
| 15 | C_SOURCES = \ |
| 16 | $(TOP)/src/mesa/glapi/glapi.c \ |
| 17 | $(TOP)/src/mesa/glapi/glthread.c \ |
| 18 | glcontextmodes.c \ |
| 19 | $(DRM_SOURCE_PATH)/libdrm/xf86drm.c \ |
| 20 | $(DRM_SOURCE_PATH)/libdrm/xf86drmHash.c \ |
| 21 | $(DRM_SOURCE_PATH)/libdrm/xf86drmRandom.c \ |
| 22 | $(DRM_SOURCE_PATH)/libdrm/xf86drmSL.c \ |
| 23 | clientattrib.c \ |
| 24 | compsize.c \ |
| 25 | dispatch.c \ |
| 26 | eval.c \ |
| 27 | g_render.c \ |
| 28 | g_single.c \ |
| 29 | g_vendpriv.c \ |
| 30 | glxcmds.c \ |
| 31 | glxext.c \ |
| 32 | glxextensions.c \ |
| 33 | indirect_init.c \ |
Ian Romanick | 9bba1cf | 2004-12-01 09:11:04 +0000 | [diff] [blame] | 34 | indirect_size.c \ |
Ian Romanick | 6b89a83 | 2004-12-01 08:31:15 +0000 | [diff] [blame] | 35 | indirect_window_pos.c \ |
Ian Romanick | bb427b1 | 2004-12-01 08:22:44 +0000 | [diff] [blame] | 36 | indirect_transpose_matrix.c \ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 37 | pixel.c \ |
| 38 | pixelstore.c \ |
| 39 | render2.c \ |
| 40 | renderpix.c \ |
| 41 | single2.c \ |
| 42 | singlepix.c \ |
| 43 | vertarr.c \ |
| 44 | xfont.c \ |
| 45 | glx_pbuffer.c \ |
| 46 | glx_query.c \ |
| 47 | glx_texture_compression.c \ |
| 48 | dri_glx.c \ |
| 49 | XF86dri.c \ |
| 50 | |
| 51 | X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S |
| 52 | |
| 53 | # ASM_SOURCES = $(X86_SOURCES) |
| 54 | |
| 55 | OBJECTS = $(C_SOURCES:.c=.o) \ |
| 56 | $(ASM_SOURCES:.S=.o) |
| 57 | |
Keith Whitwell | fc23672 | 2004-12-08 15:16:36 +0000 | [diff] [blame^] | 58 | INCLUDES = -I. \ |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 59 | -I$(TOP)/include \ |
| 60 | -I$(TOP)/include/GL/internal \ |
| 61 | -I$(TOP)/src/mesa \ |
| 62 | -I$(TOP)/src/mesa/main \ |
| 63 | -I$(TOP)/src/mesa/glapi \ |
| 64 | -I$(TOP)/src/mesa/math \ |
| 65 | -I$(TOP)/src/mesa/transform \ |
| 66 | -I$(TOP)/src/mesa/swrast \ |
| 67 | -I$(TOP)/src/mesa/swrast_setup \ |
| 68 | -I$(TOP)/src/mesa/drivers/dri/common \ |
| 69 | -I$(DRM_SOURCE_PATH)/libdrm \ |
Keith Whitwell | fc23672 | 2004-12-08 15:16:36 +0000 | [diff] [blame^] | 70 | -I$(DRM_SOURCE_PATH)/shared \ |
| 71 | $(X11_INCLUDES) |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 72 | |
| 73 | |
| 74 | ##### RULES ##### |
| 75 | |
| 76 | .c.o: |
| 77 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 78 | |
| 79 | .S.o: |
| 80 | $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ |
| 81 | |
| 82 | ##### TARGETS ##### |
| 83 | |
| 84 | default: depend $(LIB_DIR)/$(GL_LIB_NAME) |
| 85 | |
| 86 | glcontextmodes.c: |
| 87 | ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c . |
| 88 | |
| 89 | # Make libGL |
| 90 | $(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile |
| 91 | CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(GL_LIB) -major 1 -minor 2 $(MKLIB_OPTIONS) \ |
| 92 | -install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) |
| 93 | |
| 94 | |
| 95 | drmtest: xf86drm.o drmtest.o |
| 96 | rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o |
| 97 | |
| 98 | |
| 99 | depend: $(C_SOURCES) $(ASM_SOURCES) |
| 100 | touch depend |
| 101 | $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \ |
Keith Whitwell | fc23672 | 2004-12-08 15:16:36 +0000 | [diff] [blame^] | 102 | > /dev/null |
Adam Jackson | cb3610e | 2004-10-25 21:09:16 +0000 | [diff] [blame] | 103 | |
| 104 | |
| 105 | # Emacs tags |
| 106 | tags: |
| 107 | etags `find . -name \*.[ch]` `find ../include` |
| 108 | |
| 109 | |
| 110 | # Remove .o and backup files |
| 111 | clean: |
| 112 | -rm -f $(LIB_DIR)/libGL.so* |
| 113 | -rm -f *.o *~ |
| 114 | -rm -f depend |
| 115 | |
| 116 | include depend |