Mesa-solo builds with these changes. There are still more fixups needed to
[mesa.git] / src / mesa / drivers / dri / Makefile.template
1 # -*-makefile-*-
2
3 TOP = ../../../../..
4
5 MESA_MODULES = $(TOP)/src/mesa/mesa.a
6
7
8 ifeq ($(WINDOW_SYSTEM),dri)
9 WINOBJ=../dri_client/dri.a
10 WINLIB=
11 INCLUDES = $(SHARED_INCLUDES) \
12 -I../dri_client \
13 -I../dri_client/imports
14
15 OBJECTS = $(C_SOURCES:.c=.o) \
16 $(ASM_SOURCES:.S=.o)
17
18 else
19 WINOBJ=
20 WINLIB=-L$(MESA)/src/glx/mini
21 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
22 INCLUDES = $(MINIGLX_INCLUDES) \
23 -I$(DRM_SOURCE_PATH)/shared \
24 -I$(DRM_SOURCE_PATH)/libdrm \
25 $(SHARED_INCLUDES)
26
27 OBJECTS = $(C_SOURCES:.c=.o) \
28 $(MINIGLX_SOURCES:.c=.o) \
29 $(ASM_SOURCES:.S=.o)
30 endif
31
32
33
34
35
36 ### Include directories
37 SHARED_INCLUDES = \
38 -I. \
39 -I../common \
40 -Iserver \
41 -I$(DRM_SOURCE_PATH)/shared \
42 -I$(TOP)/include \
43 -I$(TOP)/include/GL/internal \
44 -I$(TOP)/src/mesa \
45 -I$(TOP)/src/mesa/main \
46 -I$(TOP)/src/mesa/glapi \
47 -I$(TOP)/src/mesa/math \
48 -I$(TOP)/src/mesa/transform \
49 -I$(TOP)/src/mesa/shader \
50 -I$(TOP)/src/mesa/swrast \
51 -I$(TOP)/src/mesa/swrast_setup
52
53 # Of course we're direct rendering. Redundant #ifdefs in the code
54 # from prehistory require this:
55 #
56 DEFINES += -DGLX_DIRECT_RENDERING
57
58 ##### RULES #####
59
60 .c.o:
61 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
62
63 .S.o:
64 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
65
66
67 ##### TARGETS #####
68
69 default: depend symlinks $(LIB_DIR)/$(LIBNAME)
70
71
72 #$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
73 # @echo BUILDING FOR: $(WINDOW_SYSTEM)
74 # $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
75 # $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
76
77
78 $(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile ../Makefile.template
79 rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(GL_LIB_DEPS)
80
81
82
83
84 # Run 'make depend' to update the dependencies if you change
85 # what's included by any source file.
86 depend: $(C_SOURCES) $(ASM_SOURCES)
87 touch depend
88 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
89 > /dev/null 2>&1
90
91
92 # Emacs tags
93 tags:
94 etags `find . -name \*.[ch]` `find ../include`
95
96
97 # Remove .o and backup files
98 clean:
99 -rm -f *.o */*.o *~ *.o *~ *.so server/*.o $(SYMLINKS) depend
100
101 include depend