New Makefile system
[mesa.git] / src / mesa / drivers / dri / fb / Makefile
1 # src/mesa/drivers/dri/fb/Makefile
2
3 TOP = ../../../../..
4 include $(TOP)/configs/default
5
6 SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
7 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
8
9 MESA_MODULES = $(TOP)/src/mesa/mesa.a
10
11 DRIVER_SOURCES = fb_dri.c
12
13
14 C_SOURCES = $(DRIVER_SOURCES) \
15 $(DRI_SOURCES)
16
17 ASM_SOURCES =
18
19 OBJECTS = $(C_SOURCES:.c=.o) \
20 $(ASM_SOURCES:.S=.o)
21
22
23 ### Include directories
24
25 INCLUDE_DIRS = \
26 -I$(TOP)/include \
27 -I$(TOP)/src/mesa \
28 -I$(TOP)/src/mesa/main \
29 -I$(TOP)/src/mesa/glapi \
30 -I$(TOP)/src/mesa/math \
31 -I$(TOP)/src/mesa/transform \
32 -I$(TOP)/src/mesa/swrast \
33 -I$(TOP)/src/mesa/swrast_setup
34
35
36 ##### RULES #####
37
38 .c.o:
39 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
40
41 .S.o:
42 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
43
44
45 ##### TARGETS #####
46
47 default: depend fb_dri.so
48
49 fb_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
50 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc -lm
51 rm -f $(LIB_DIR)/fb_dri.so && \
52 install fb_dri.so $(LIB_DIR)/fb_dri.so
53
54 $(LIB_DIR)/fb_dri.so: fb_dri.so
55 rm -f $(LIB_DIR)/fb_dri.so && \
56 install fb_dri.so $(LIB_DIR)/fb_dri.so
57
58 # Run 'make -f Makefile.solo dep' to update the dependencies if you change
59 # what's included by any source file.
60 depend: $(C_SOURCES) $(ASM_SOURCES)
61 touch depend
62 makedepend -fdepend -Y $(SHARED_INCLUDES) \
63 $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
64
65
66 # Emacs tags
67 tags:
68 etags `find . -name \*.[ch]` `find ../include`
69
70
71 # Remove .o and backup files
72 clean:
73 -rm -f *.o *~ *.o *~ *.so
74
75 include depend