lots of Makefile updates for new build system
[mesa.git] / src / mesa / drivers / dri / radeon / Makefile
1 # src/mesa/drivers/dri/radeon/Makefile
2 # Note, this Makefile requires GNU make
3
4 TOP = ../../../../..
5 include $(TOP)/configs/current
6
7 ifeq ($(EMBEDDED),true)
8 LIBNAME = radeon_es_dri.so
9 DEFINES += \
10 -D_EMBEDDED \
11 -D_HAVE_SWRAST=0 \
12 -D_HAVE_SWTNL=0 \
13 -D_HAVE_SANITY=0 \
14 -D_HAVE_CODEGEN=0 \
15 -D_HAVE_LIGHTING=0 \
16 -D_HAVE_TEXGEN=0 \
17 -D_HAVE_USERCLIP=0 \
18 -DGLX_DIRECT_RENDERING
19 else
20 LIBNAME = radeon_dri.so
21 DEFINES += \
22 -D_HAVE_SWRAST=1 \
23 -D_HAVE_SWTNL=1 \
24 -D_HAVE_SANITY=1 \
25 -D_HAVE_CODEGEN=1 \
26 -D_HAVE_LIGHTING=1 \
27 -D_HAVE_TEXGEN=1 \
28 -D_HAVE_USERCLIP=1 \
29 -DGLX_DIRECT_RENDERING
30 endif
31
32 MINIGLX_SOURCES = server/radeon_dri.c
33
34 COMMON_SOURCES = \
35 ../../common/driverfuncs.c \
36 ../common/mm.c \
37 ../common/utils.c \
38 ../common/texmem.c \
39 ../common/vblank.c \
40 ../common/xmlconfig.c
41
42 DRIVER_SOURCES = \
43 radeon_context.c \
44 radeon_ioctl.c \
45 radeon_lock.c \
46 radeon_screen.c \
47 radeon_state.c \
48 radeon_state_init.c
49
50 SUBSET_DRIVER_SOURCES = \
51 radeon_subset_bitmap.c \
52 radeon_subset_readpix.c \
53 radeon_subset_select.c \
54 radeon_subset_tex.c \
55 radeon_subset_vtx.c
56
57 FULL_DRIVER_SOURCES = \
58 radeon_tex.c \
59 radeon_texmem.c \
60 radeon_texstate.c \
61 radeon_tcl.c \
62 radeon_swtcl.c \
63 radeon_span.c \
64 radeon_maos.c \
65 radeon_sanity.c \
66 radeon_compat.c \
67 radeon_vtxfmt.c \
68 radeon_vtxfmt_c.c \
69 radeon_vtxfmt_sse.c \
70 radeon_vtxfmt_x86.c
71
72 ifeq ($(EMBEDDED),true)
73 C_SOURCES = \
74 $(COMMON_SOURCES) \
75 $(MINIGLX_SOURCES) \
76 $(DRIVER_SOURCES) \
77 $(SUBSET_DRIVER_SOURCES)
78 else
79 C_SOURCES = \
80 $(COMMON_SOURCES) \
81 $(MINIGLX_SOURCES) \
82 $(DRIVER_SOURCES) \
83 $(FULL_DRIVER_SOURCES)
84 endif
85
86
87 # Include directories
88 INCLUDE_DIRS = \
89 -I. \
90 -I../common \
91 -Iserver \
92 -I$(TOP)/src/glx/mini \
93 -I$(TOP)/include \
94 -I$(TOP)/src/mesa/drivers/dri/drm/shared \
95 -I$(TOP)/src/mesa \
96 -I$(TOP)/src/mesa/main \
97 -I$(TOP)/src/mesa/glapi \
98 -I$(TOP)/src/mesa/math \
99 -I$(TOP)/src/mesa/transform \
100 -I$(TOP)/src/mesa/shader \
101 -I$(TOP)/src/mesa/swrast \
102 -I$(TOP)/src/mesa/swrast_setup
103
104 # Core Mesa objects
105 MESA_MODULES = $(TOP)/src/mesa/mesa.a
106
107 # Libraries that the driver shared lib depends on
108 LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
109
110
111 ifeq ($(WINDOW_SYSTEM),dri)
112 WINOBJ=$(MESABUILDDIR)/dri/dri.a
113 WINLIB=
114 else
115 WINOBJ=
116 WINLIB=-L$(MESA)/src/glx/mini
117 endif
118
119 ASM_SOURCES =
120
121 OBJECTS = $(C_SOURCES:.c=.o) \
122 $(ASM_SOURCES:.S=.o)
123
124
125 ##### RULES #####
126
127 .c.o:
128 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
129
130 .S.o:
131 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
132
133
134 ##### TARGETS #####
135
136 default: depend $(LIB_DIR)/$(LIBNAME)
137
138
139 $(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
140 $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
141 $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
142
143
144 depend: $(C_SOURCES) $(ASM_SOURCES)
145 touch depend
146 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
147 >& /dev/null
148
149
150 # Emacs tags
151 tags:
152 etags `find . -name \*.[ch]` `find ../include`
153
154
155 clean:
156 -rm -f *.o server/*.o
157
158
159 include depend