lots of Makefile updates for new build system
[mesa.git] / src / mesa / drivers / dri / mach64 / Makefile
1 # src/mesa/drivers/dri/mach64/Makefile
2
3 TOP = ../../../../..
4 include $(TOP)/configs/current
5
6 LIBNAME = mach64_dri.so
7
8 DEFINES += \
9 -D_HAVE_SWRAST=1 \
10 -D_HAVE_SWTNL=1 \
11 -D_HAVE_SANITY=1 \
12 -D_HAVE_CODEGEN=1 \
13 -D_HAVE_LIGHTING=1 \
14 -D_HAVE_TEXGEN=1 \
15 -D_HAVE_USERCLIP=1 \
16 -DGLX_DIRECT_RENDERING
17
18 # Not yet
19 # MINIGLX_SOURCES = server/mach64_dri.c
20
21 COMMON_SOURCES = \
22 ../../common/driverfuncs.c \
23 ../common/mm.c \
24 ../common/utils.c \
25 ../common/texmem.c \
26 ../common/vblank.c \
27 ../common/xmlconfig.c
28
29 DRIVER_SOURCES = \
30 mach64_context.c \
31 mach64_ioctl.c \
32 mach64_screen.c \
33 mach64_span.c \
34 mach64_state.c \
35 mach64_tex.c \
36 mach64_texmem.c \
37 mach64_texstate.c \
38 mach64_tris.c \
39 mach64_vb.c \
40 mach64_dd.c \
41 mach64_lock.c
42
43 C_SOURCES = \
44 $(COMMON_SOURCES) \
45 $(MINIGLX_SOURCES) \
46 $(DRIVER_SOURCES)
47
48 # Include directories
49 INCLUDE_DIRS = \
50 -I. \
51 -I../common \
52 -Iserver \
53 -I$(TOP)/src/glx/mini \
54 -I$(TOP)/include \
55 -I$(TOP)/src/mesa/drivers/dri/drm/shared \
56 -I$(TOP)/src/mesa \
57 -I$(TOP)/src/mesa/main \
58 -I$(TOP)/src/mesa/glapi \
59 -I$(TOP)/src/mesa/math \
60 -I$(TOP)/src/mesa/transform \
61 -I$(TOP)/src/mesa/shader \
62 -I$(TOP)/src/mesa/swrast \
63 -I$(TOP)/src/mesa/swrast_setup
64
65 # Core Mesa objects
66 MESA_MODULES = $(TOP)/src/mesa/mesa.a
67
68 # Libraries that the driver shared lib depends on
69 LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
70
71
72 ifeq ($(WINDOW_SYSTEM),dri)
73 WINOBJ=$(MESABUILDDIR)/dri/dri.a
74 WINLIB=
75 else
76 WINOBJ=
77 WINLIB=-L$(MESA)/src/glx/mini
78 endif
79
80 ASM_SOURCES =
81
82 OBJECTS = $(C_SOURCES:.c=.o) \
83 $(ASM_SOURCES:.S=.o)
84
85
86 ##### RULES #####
87
88 .c.o:
89 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
90
91 .S.o:
92 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
93
94
95 ##### TARGETS #####
96
97 default: depend $(LIB_DIR)/$(LIBNAME)
98
99
100 $(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
101 $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
102 $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
103
104
105 depend: $(C_SOURCES) $(ASM_SOURCES)
106 touch depend
107 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
108 >& /dev/null
109
110
111 # Emacs tags
112 tags:
113 etags `find . -name \*.[ch]` `find ../include`
114
115
116 clean:
117 -rm -f *.o server/*.o
118
119
120 include depend