New Makefile system
[mesa.git] / src / mesa / drivers / dri / mga / Makefile
1 # src/mesa/drivers/dri/mga/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 DEFINES += \
10 -D_HAVE_SWRAST=1 \
11 -D_HAVE_SWTNL=1 \
12 -D_HAVE_SANITY=1 \
13 -D_HAVE_CODEGEN=1 \
14 -D_HAVE_LIGHTING=1 \
15 -D_HAVE_TEXGEN=1 \
16 -D_HAVE_USERCLIP=1 \
17 -DGLX_DIRECT_RENDERING
18
19 MINIGLX_SOURCES = server/mga_dri.c
20
21 DRIVER_SOURCES = mgadd.c \
22 mgaioctl.c \
23 mgarender.c \
24 mgastate.c \
25 mgatris.c \
26 ../../common/driverfuncs.c \
27 ../common/mm.c \
28 ../common/utils.c \
29 ../common/texmem.c \
30 ../common/vblank.c \
31 ../common/xmlconfig.c
32
33 FULL_DRIVER_SOURCES = \
34 mgapixel.c \
35 mgaspan.c \
36 mgatex.c \
37 mgatexmem.c \
38 mga_texstate.c \
39 mga_texcombine.c \
40 mgavb.c \
41 mga_xmesa.c
42
43
44 INCLUDES = $(MINIGLX_INCLUDES) \
45 $(SHARED_INCLUDES)
46
47
48 C_SOURCES = $(MINIGLX_SOURCES) \
49 $(FULL_DRIVER_SOURCES) \
50 $(DRIVER_SOURCES)
51
52 MESA_MODULES = $(TOP)/src/mesa/mesa.a
53
54
55 ifeq ($(WINDOW_SYSTEM),dri)
56 WINOBJ=$(MESABUILDDIR)/dri/dri.a
57 WINLIB=
58 else
59 WINOBJ=
60 WINLIB=-L$(MESA)/src/glx/mini
61 endif
62
63 ASM_SOURCES =
64 OBJECTS = $(C_SOURCES:.c=.o) \
65 $(ASM_SOURCES:.S=.o)
66
67
68
69 ### Include directories
70
71 INCLUDE_DIRS = \
72 -I$(TOP)/include \
73 -I$(TOP)/src/mesa \
74 -I$(TOP)/src/mesa/main \
75 -I$(TOP)/src/mesa/glapi \
76 -I$(TOP)/src/mesa/math \
77 -I$(TOP)/src/mesa/transform \
78 -I$(TOP)/src/mesa/swrast \
79 -I$(TOP)/src/mesa/swrast_setup
80
81
82 ##### RULES #####
83
84 .c.o:
85 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
86
87 .S.o:
88 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
89
90
91 ##### TARGETS #####
92
93 default: depend mga_dri.so
94
95 mga_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
96 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
97 rm -f $(LIB_DIR)/mga_dri.so && \
98 install mga_dri.so $(LIB_DIR)/mga_dri.so
99
100 $(LIB_DIR)/mga_dri.so: mga_dri.so
101 rm -f $(LIB_DIR)/mga_dri.so && \
102 install mga_dri.so $(LIB_DIR)/mga_dri.so
103
104 # Run 'make -f Makefile.solo dep' to update the dependencies if you change
105 # what's included by any source file.
106 depend: $(C_SOURCES) $(ASM_SOURCES)
107 touch depend
108 makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
109 $(C_SOURCES) $(ASM_SOURCES)
110
111
112 # Emacs tags
113 tags:
114 etags `find . -name \*.[ch]` `find ../include`
115
116
117 # Remove .o and backup files
118 clean:
119 -rm -f *.o *~ *.o *~ *.so server/*.o
120
121
122 include depend