Work around problems with t_vp_build.c
[mesa.git] / src / mesa / drivers / dri / Makefile.template
1 # -*-makefile-*-
2
3 MESA_MODULES = $(TOP)/src/mesa/libmesa.a
4
5 COMMON_SOURCES = \
6 ../../common/driverfuncs.c \
7 ../common/utils.c \
8 ../common/texmem.c \
9 ../common/vblank.c \
10 ../common/dri_util.c \
11 ../common/xmlconfig.c \
12 ../common/drirenderbuffer.c
13
14 ifeq ($(WINDOW_SYSTEM),dri)
15 WINOBJ=
16 WINLIB=
17 INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) \
18 `pkg-config --cflags libdrm`
19
20 OBJECTS = $(C_SOURCES:.c=.o) \
21 $(ASM_SOURCES:.S=.o)
22
23 else
24 WINOBJ=
25 WINLIB=-L$(MESA)/src/glx/mini
26 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
27 INCLUDES = $(MINIGLX_INCLUDES) \
28 -I$(DRM_SOURCE_PATH)/shared-core \
29 -I$(DRM_SOURCE_PATH)/libdrm \
30 $(SHARED_INCLUDES)
31
32 OBJECTS = $(C_SOURCES:.c=.o) \
33 $(MINIGLX_SOURCES:.c=.o) \
34 $(ASM_SOURCES:.S=.o)
35 endif
36
37
38 ### Include directories
39 SHARED_INCLUDES = \
40 -I. \
41 -I$(TOP)/src/mesa/drivers/dri/common \
42 -Iserver \
43 -I$(DRM_SOURCE_PATH)/shared-core \
44 -I$(TOP)/include \
45 -I$(TOP)/include/GL/internal \
46 -I$(TOP)/src/mesa \
47 -I$(TOP)/src/mesa/main \
48 -I$(TOP)/src/mesa/glapi \
49 -I$(TOP)/src/mesa/math \
50 -I$(TOP)/src/mesa/transform \
51 -I$(TOP)/src/mesa/shader \
52 -I$(TOP)/src/mesa/swrast \
53 -I$(TOP)/src/mesa/swrast_setup \
54 -I$(TOP)/src/egl/main \
55 -I$(TOP)/src/egl/drivers/dri
56
57 ##### RULES #####
58
59 .c.o:
60 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
61
62 .S.o:
63 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
64
65
66 ##### TARGETS #####
67
68 default: depend symlinks $(LIBNAME) $(LIB_DIR)/$(LIBNAME)
69
70
71 #$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
72 # @echo BUILDING FOR: $(WINDOW_SYSTEM)
73 # $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
74 # $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
75
76 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
77 $(TOP)/bin/mklib -noprefix -o $@ \
78 $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
79
80
81 $(LIB_DIR)/$(LIBNAME): $(LIBNAME)
82 install $(LIBNAME) $(LIB_DIR)
83
84
85
86 # Run 'make depend' to update the dependencies if you change
87 # what's included by any source file.
88 .PHONY: depend
89 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
90 touch depend
91 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
92 > /dev/null
93
94
95 # Emacs tags
96 tags:
97 etags `find . -name \*.[ch]` `find ../include`
98
99
100 # Remove .o and backup files
101 clean:
102 -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
103 -rm -f depend depend.bak
104
105 install: $(LIBNAME)
106 install $(LIBNAME) /usr/X11R6/lib/modules/dri/$(LIBNAME)
107
108 include depend