Code reorganization: split gallium and mesa makefiles.
[mesa.git] / src / gallium / Makefile.template
1 # -*-makefile-*-
2
3
4 # We still have a dependency on the "dri" buffer manager. Most likely
5 # the interface can be reused in non-dri environments, and also as a
6 # frontend to simpler memory managers.
7 #
8 COMMON_SOURCES =
9
10 OBJECTS = $(C_SOURCES:.c=.o) \
11 $(CPP_SOURCES:.cpp=.o) \
12 $(ASM_SOURCES:.S=.o)
13
14
15 ### Include directories
16 INCLUDES = \
17 -I. \
18 -I$(TOP)/src/gallium/include \
19 -I$(TOP)/src/gallium/include/pipe \
20 -I$(TOP)/src/gallium/auxiliary \
21 -I$(TOP)/src/gallium/drivers \
22 -I$(TOP)/src/mesa \
23 -I$(TOP)/src/mesa/main \
24 -I$(TOP)/include \
25 $(DRIVER_INCLUDES)
26
27
28 ##### RULES #####
29
30 .c.o:
31 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
32
33 .cpp.o:
34 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
35
36 .S.o:
37 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
38
39
40 ##### TARGETS #####
41
42 default: depend symlinks $(LIBNAME)
43
44
45 $(LIBNAME): $(OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template
46 $(TOP)/bin/mklib -o $@ -static $(OBJECTS) $(DRIVER_LIBS)
47
48
49 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
50 rm -f depend
51 touch depend
52 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) \
53 $(ASM_SOURCES) 2> /dev/null
54
55
56 # Emacs tags
57 tags:
58 etags `find . -name \*.[ch]` `find ../include`
59
60
61 # Remove .o and backup files
62 clean::
63 -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
64 -rm -f depend depend.bak
65
66
67 include depend