0880e73caf920664dd023a90ace93c4e93c76bf9
[mesa.git] / src / mesa / drivers / dri / Makefile.template
1 # -*-makefile-*-
2
3 MESA_MODULES = $(TOP)/src/mesa/mesa.a
4
5 COMMON_SOURCES = \
6 ../../common/driverfuncs.c \
7 ../common/mm.c \
8 ../common/utils.c \
9 ../common/texmem.c \
10 ../common/vblank.c \
11 ../common/dri_util.c \
12 ../common/xmlconfig.c \
13 ../common/drirenderbuffer.c
14
15 ifeq ($(WINDOW_SYSTEM),dri)
16 WINOBJ=../dri_client/dri.a
17 WINLIB=
18 INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) \
19 -I../dri_client \
20 -I../dri_client/imports
21
22 OBJECTS = $(C_SOURCES:.c=.o) \
23 $(ASM_SOURCES:.S=.o)
24
25 else
26 WINOBJ=
27 WINLIB=-L$(MESA)/src/glx/mini
28 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
29 INCLUDES = $(MINIGLX_INCLUDES) \
30 -I$(DRM_SOURCE_PATH)/shared-core \
31 -I$(DRM_SOURCE_PATH)/libdrm \
32 $(SHARED_INCLUDES)
33
34 OBJECTS = $(C_SOURCES:.c=.o) \
35 $(MINIGLX_SOURCES:.c=.o) \
36 $(ASM_SOURCES:.S=.o)
37 endif
38
39
40 ### Include directories
41 SHARED_INCLUDES = \
42 -I. \
43 -I$(TOP)/src/mesa/drivers/dri/common \
44 -Iserver \
45 -I$(DRM_SOURCE_PATH)/shared-core \
46 -I$(TOP)/include \
47 -I$(TOP)/include/GL/internal \
48 -I$(TOP)/src/mesa \
49 -I$(TOP)/src/mesa/main \
50 -I$(TOP)/src/mesa/glapi \
51 -I$(TOP)/src/mesa/math \
52 -I$(TOP)/src/mesa/transform \
53 -I$(TOP)/src/mesa/shader \
54 -I$(TOP)/src/mesa/swrast \
55 -I$(TOP)/src/mesa/swrast_setup \
56 -I$(TOP)/src/egl/main
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 $(LIBNAME) $(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 # XXX we should use the mklib script here
78 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
79 rm -f $@
80 $(CC) $(ARCH_FLAGS) -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
81
82
83 $(LIB_DIR)/$(LIBNAME): $(LIBNAME)
84 install $(LIBNAME) $(LIB_DIR)
85
86
87
88 # Run 'make depend' to update the dependencies if you change
89 # what's included by any source file.
90 .PHONY: depend
91 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
92 touch depend
93 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
94 > /dev/null
95
96
97 # Emacs tags
98 tags:
99 etags `find . -name \*.[ch]` `find ../include`
100
101
102 # Remove .o and backup files
103 clean:
104 -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
105 -rm -f depend depend.bak
106
107 install: $(LIBNAME)
108 install $(LIBNAME) /usr/X11R6/lib/modules/dri/$(LIBNAME)
109
110 include depend