New Makefile system
[mesa.git] / src / mesa / drivers / dri / radeon / Makefile
1 # src/mesa/drivers/dri/radeon/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 ifeq ($(EMBEDDED),true)
10 TARGET = radeon_es_dri.so
11 DEFINES += \
12 -D_EMBEDDED \
13 -D_HAVE_SWRAST=0 \
14 -D_HAVE_SWTNL=0 \
15 -D_HAVE_SANITY=0 \
16 -D_HAVE_CODEGEN=0 \
17 -D_HAVE_LIGHTING=0 \
18 -D_HAVE_TEXGEN=0 \
19 -D_HAVE_USERCLIP=0 \
20 -DGLX_DIRECT_RENDERING
21 else
22 TARGET = radeon_dri.so
23 DEFINES += \
24 -D_HAVE_SWRAST=1 \
25 -D_HAVE_SWTNL=1 \
26 -D_HAVE_SANITY=1 \
27 -D_HAVE_CODEGEN=1 \
28 -D_HAVE_LIGHTING=1 \
29 -D_HAVE_TEXGEN=1 \
30 -D_HAVE_USERCLIP=1 \
31 -DGLX_DIRECT_RENDERING
32 endif
33
34 MESA_MODULES = $(TOP)/src/mesa/mesa.a
35
36 MINIGLX_SOURCES = server/radeon_dri.c
37
38 DRIVER_SOURCES = radeon_context.c \
39 radeon_ioctl.c \
40 radeon_lock.c \
41 radeon_screen.c \
42 radeon_state.c \
43 radeon_state_init.c \
44 ../../common/driverfuncs.c \
45 ../common/mm.c \
46 ../common/utils.c \
47 ../common/texmem.c \
48 ../common/vblank.c \
49 ../common/xmlconfig.c
50
51 SUBSET_DRIVER_SOURCES = \
52 radeon_subset_bitmap.c \
53 radeon_subset_readpix.c \
54 radeon_subset_select.c \
55 radeon_subset_tex.c \
56 radeon_subset_vtx.c
57
58 FULL_DRIVER_SOURCES = \
59 radeon_tex.c \
60 radeon_texmem.c \
61 radeon_texstate.c \
62 radeon_tcl.c \
63 radeon_swtcl.c \
64 radeon_span.c \
65 radeon_maos.c \
66 radeon_sanity.c \
67 radeon_compat.c \
68 radeon_vtxfmt.c \
69 radeon_vtxfmt_c.c \
70 radeon_vtxfmt_sse.c \
71 radeon_vtxfmt_x86.c
72
73
74 INCLUDES = $(MINIGLX_INCLUDES) \
75 $(SHARED_INCLUDES)
76
77
78 ifeq ($(EMBEDDED),true)
79 C_SOURCES = $(DRIVER_SOURCES) \
80 $(SUBSET_DRIVER_SOURCES) \
81 $(MINIGLX_SOURCES)
82 else
83 C_SOURCES = $(DRIVER_SOURCES) \
84 $(FULL_DRIVER_SOURCES) \
85 $(MINIGLX_SOURCES)
86 endif
87
88
89 ifeq ($(WINDOW_SYSTEM),dri)
90 WINOBJ=$(MESABUILDDIR)/dri/dri.a
91 WINLIB=
92 else
93 WINOBJ=
94 WINLIB=-L$(MESA)/src/glx/mini
95 endif
96
97 ASM_SOURCES =
98 OBJECTS = $(C_SOURCES:.c=.o) \
99 $(ASM_SOURCES:.S=.o)
100
101 ### Include directories
102
103 INCLUDE_DIRS = \
104 -I$(TOP)/include \
105 -I$(TOP)/src/mesa \
106 -I$(TOP)/src/mesa/main \
107 -I$(TOP)/src/mesa/glapi \
108 -I$(TOP)/src/mesa/math \
109 -I$(TOP)/src/mesa/transform \
110 -I$(TOP)/src/mesa/swrast \
111 -I$(TOP)/src/mesa/swrast_setup
112
113
114 ##### RULES #####
115
116 .c.o:
117 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
118
119 .S.o:
120 $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
121
122
123 ##### TARGETS #####
124
125 default: depend $(TARGET)
126
127 $(TARGET): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
128 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
129 rm -f $(LIB_DIR)/$(TARGET) && \
130 install $(TARGET) $(LIB_DIR)/$(TARGET)
131
132 $(LIB_DIR)/$(TARGET): $(TARGET)
133 rm -f $(LIB_DIR)/$(TARGET) && \
134 install $(TARGET) $(LIB_DIR)/$(TARGET)
135
136 # Run 'make -f Makefile.solo dep' to update the dependencies if you change
137 # what's included by any source file.
138 depend: $(C_SOURCES) $(ASM_SOURCES)
139 touch depend
140 makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES)\
141 $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
142
143
144 # Emacs tags
145 tags:
146 etags `find . -name \*.[ch]` `find ../include`
147
148
149 # Remove .o and backup files
150 clean:
151 -rm -f *.o *~ *.o *~ *.so server/*.o
152
153
154 include depend