New Makefile system
[mesa.git] / src / mesa / drivers / dri / tdfx / Makefile
1 # src/mesa/drivers/dri/tdfx/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 # not yet
20 # MINIGLX_SOURCES = server/tdfx_dri.c
21
22 DRIVER_SOURCES = tdfx_context.c \
23 ../../common/driverfuncs.c \
24 ../common/mm.c \
25 ../common/utils.c \
26 ../common/texmem.c \
27 ../common/vblank.c \
28 ../common/xmlconfig.c \
29 tdfx_dd.c \
30 tdfx_lock.c \
31 tdfx_pixels.c \
32 tdfx_render.c \
33 tdfx_screen.c \
34 tdfx_span.c \
35 tdfx_state.c \
36 tdfx_tex.c \
37 tdfx_texman.c \
38 tdfx_texstate.c \
39 tdfx_tris.c \
40 tdfx_vb.c
41
42 INCLUDES = $(MINIGLX_INCLUDES) \
43 $(SHARED_INCLUDES)
44
45
46 C_SOURCES = $(DRIVER_SOURCES) \
47 $(MINIGLX_SOURCES)
48
49 MESA_MODULES = $(TOP)/src/mesa/mesa.a
50
51
52 ifeq ($(WINDOW_SYSTEM),dri)
53 WINOBJ=$(MESABUILDDIR)/dri/dri.a
54 WINLIB=
55 else
56 WINOBJ=
57 WINLIB=-L$(MESA)/src/glx/mini
58 endif
59
60 ASM_SOURCES =
61 OBJECTS = $(C_SOURCES:.c=.o) \
62 $(ASM_SOURCES:.S=.o)
63
64 $(SYMLINKS):
65 mkdir -p server
66 cd server
67 rm -f $@ && ln -s ../../radeon/$@ $@
68
69
70 ### Include directories
71
72 INCLUDE_DIRS = \
73 -I$(TOP)/include \
74 -I$(TOP)/src/mesa \
75 -I$(TOP)/src/mesa/main \
76 -I$(TOP)/src/mesa/glapi \
77 -I$(TOP)/src/mesa/math \
78 -I$(TOP)/src/mesa/transform \
79 -I$(TOP)/src/mesa/swrast \
80 -I$(TOP)/src/mesa/swrast_setup
81
82
83 ##### RULES #####
84
85 .c.o:
86 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
87
88 .S.o:
89 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
90
91
92 ##### TARGETS #####
93
94 default: depend tdfx_dri.so
95
96 tdfx_dri.so: $(SYMLINKS) $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
97 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
98 rm -f $(LIB_DIR)/tdfx_dri.so && \
99 install tdfx_dri.so $(LIB_DIR)/tdfx_dri.so
100
101 $(LIB_DIR)/tdfx_dri.so: tdfx_dri.so
102 rm -f $(LIB_DIR)/tdfx_dri.so && \
103 install tdfx_dri.so $(LIB_DIR)/tdfx_dri.so
104
105 # Run 'make -f Makefile.solo dep' to update the dependencies if you change
106 # what's included by any source file.
107 depend: $(C_SOURCES) $(ASM_SOURCES)
108 touch depend
109 makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
110 $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
111
112
113 # Emacs tags
114 tags:
115 etags `find . -name \*.[ch]` `find ../include`
116
117
118 # Remove .o and backup files
119 clean:
120 -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
121 -rm -f $(SYMLINKS)
122
123 include depend