lots of Makefile updates for new build system
[mesa.git] / src / mesa / drivers / dri / r200 / Makefile
1 # src/mesa/drivers/dri/r200/Makefile
2 # Note, this Makefile requires GNU make
3
4 TOP = ../../../../..
5 include $(TOP)/configs/current
6
7 LIBNAME = r200_dri.so
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/radeon_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 = r200_context.c \
30 r200_ioctl.c \
31 r200_lock.c \
32 r200_screen.c \
33 r200_state.c \
34 r200_state_init.c \
35 r200_cmdbuf.c \
36 r200_pixel.c \
37 r200_tex.c \
38 r200_texmem.c \
39 r200_texstate.c \
40 r200_tcl.c \
41 r200_swtcl.c \
42 r200_span.c \
43 r200_maos.c \
44 r200_sanity.c \
45 r200_vtxfmt.c \
46 r200_vtxfmt_c.c \
47 r200_vtxfmt_sse.c \
48 r200_vtxfmt_x86.c
49
50 C_SOURCES = $(COMMON_SOURCES) $(MINIGLX_SOURCES) $(DRIVER_SOURCES)
51
52
53 # Include directories
54 INCLUDE_DIRS = \
55 -I. \
56 -I../common \
57 -Iserver \
58 -I$(TOP)/src/glx/mini \
59 -I$(TOP)/include \
60 -I$(TOP)/src/mesa/drivers/dri/drm/shared \
61 -I$(TOP)/src/mesa \
62 -I$(TOP)/src/mesa/main \
63 -I$(TOP)/src/mesa/glapi \
64 -I$(TOP)/src/mesa/math \
65 -I$(TOP)/src/mesa/transform \
66 -I$(TOP)/src/mesa/swrast \
67 -I$(TOP)/src/mesa/swrast_setup
68
69
70 # Core Mesa objects
71 MESA_MODULES = $(TOP)/src/mesa/mesa.a
72
73
74 # Libraries that the driver shared lib depends on
75 LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
76
77
78 ifeq ($(WINDOW_SYSTEM),dri)
79 WINOBJ=$(MESABUILDDIR)/dri/dri.a
80 WINLIB=
81 else
82 WINOBJ=
83 WINLIB=-L$(MESA)/src/glx/mini
84 endif
85
86 ASM_SOURCES =
87
88 OBJECTS = $(C_SOURCES:.c=.o) \
89 $(ASM_SOURCES:.S=.o)
90
91 SYMLINKS = \
92 server/radeon_common.h \
93 server/radeon_dri.c \
94 server/radeon_dri.h \
95 server/radeon.h \
96 server/radeon_macros.h \
97 server/radeon_reg.h \
98 server/radeon_sarea.h \
99
100
101
102 ##### RULES #####
103
104 .c.o:
105 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
106
107 .S.o:
108 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
109
110
111 ##### TARGETS #####
112
113 default: depend $(SYMLINKS) $(LIB_DIR)/$(LIBNAME)
114
115 $(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
116 $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
117 $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
118
119
120 $(SYMLINKS):
121 mkdir -p server
122 cd server
123 rm -f $@ && ln -s ../../radeon/$@ $@
124
125
126 depend: $(C_SOURCES) $(ASM_SOURCES)
127 touch depend
128 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
129 >& /dev/null
130
131
132 # Emacs tags
133 tags:
134 etags `find . -name \*.[ch]` `find ../include`
135
136
137 clean:
138 -rm -f *.o server/*.o
139 -rm -f $(SYMLINKS)
140
141
142 include depend