Use DRM headers from $(DRM_SOURCE_PATH)/shared-core instead of .../shared.
[mesa.git] / src / mesa / drivers / dri / Makefile.template
1 # -*-makefile-*-
2
3 MESA_MODULES = $(TOP)/src/mesa/mesa.a
4
5
6 ifeq ($(WINDOW_SYSTEM),dri)
7 WINOBJ=../dri_client/dri.a
8 WINLIB=
9 INCLUDES = $(SHARED_INCLUDES) \
10 -I../dri_client \
11 -I../dri_client/imports
12
13 OBJECTS = $(C_SOURCES:.c=.o) \
14 $(ASM_SOURCES:.S=.o)
15
16 else
17 WINOBJ=
18 WINLIB=-L$(MESA)/src/glx/mini
19 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
20 INCLUDES = $(MINIGLX_INCLUDES) \
21 -I$(DRM_SOURCE_PATH)/shared-core \
22 -I$(DRM_SOURCE_PATH)/libdrm \
23 $(SHARED_INCLUDES)
24
25 OBJECTS = $(C_SOURCES:.c=.o) \
26 $(MINIGLX_SOURCES:.c=.o) \
27 $(ASM_SOURCES:.S=.o)
28 endif
29
30
31
32
33
34 ### Include directories
35 SHARED_INCLUDES = \
36 -I. \
37 -I$(TOP)/src/mesa/drivers/dri/common \
38 -Iserver \
39 -I$(DRM_SOURCE_PATH)/shared-core \
40 -I$(TOP)/include \
41 -I$(TOP)/include/GL/internal \
42 -I$(TOP)/src/mesa \
43 -I$(TOP)/src/mesa/main \
44 -I$(TOP)/src/mesa/glapi \
45 -I$(TOP)/src/mesa/math \
46 -I$(TOP)/src/mesa/transform \
47 -I$(TOP)/src/mesa/shader \
48 -I$(TOP)/src/mesa/swrast \
49 -I$(TOP)/src/mesa/swrast_setup
50
51 # Of course we're direct rendering. Redundant #ifdefs in the code
52 # from prehistory require this:
53 #
54 DEFINES += -DGLX_DIRECT_RENDERING
55
56 ##### RULES #####
57
58 .c.o:
59 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
60
61 .S.o:
62 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
63
64
65 ##### TARGETS #####
66
67 default: depend symlinks $(LIB_DIR)/$(LIBNAME)
68
69
70 #$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
71 # @echo BUILDING FOR: $(WINDOW_SYSTEM)
72 # $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
73 # $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
74
75
76 $(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
77 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
78
79
80
81
82 # Run 'make depend' to update the dependencies if you change
83 # what's included by any source file.
84 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
85 touch depend
86 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
87 > /dev/null
88
89
90 # Emacs tags
91 tags:
92 etags `find . -name \*.[ch]` `find ../include`
93
94
95 # Remove .o and backup files
96 clean:
97 -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
98 -rm -f depend depend.bak
99
100 include depend