49c366ea411f9b5cd0ac3bf7aed1f51da1db01e3
[mesa.git] / src / mesa / drivers / dri / Makefile.template
1 # -*-makefile-*-
2
3 MESA_MODULES = $(TOP)/src/mesa/libmesa.a
4
5 COMMON_SOURCES = \
6 ../../common/driverfuncs.c \
7 ../common/utils.c \
8 ../common/texmem.c \
9 ../common/vblank.c \
10 ../common/dri_util.c \
11 ../common/xmlconfig.c \
12 ../common/drirenderbuffer.c
13
14 COMMON_BM_SOURCES = \
15 ../common/dri_bufmgr.c \
16 ../common/dri_bufmgr_ttm.c \
17 ../common/dri_bufmgr_fake.c
18
19
20 ifeq ($(WINDOW_SYSTEM),dri)
21 WINOBJ=
22 WINLIB=
23 INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
24
25 OBJECTS = $(C_SOURCES:.c=.o) \
26 $(ASM_SOURCES:.S=.o)
27
28 else
29 # miniglx
30 WINOBJ=
31 WINLIB=-L$(MESA)/src/glx/mini
32 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
33 INCLUDES = $(MINIGLX_INCLUDES) \
34 $(SHARED_INCLUDES) \
35 $(PCIACCESS_CFLAGS)
36
37 OBJECTS = $(C_SOURCES:.c=.o) \
38 $(MINIGLX_SOURCES:.c=.o) \
39 $(ASM_SOURCES:.S=.o)
40 endif
41
42
43 ### Include directories
44 SHARED_INCLUDES = \
45 -I. \
46 -I$(TOP)/src/mesa/drivers/dri/common \
47 -Iserver \
48 -I$(TOP)/include \
49 -I$(TOP)/include/GL/internal \
50 -I$(TOP)/src/mesa \
51 -I$(TOP)/src/mesa/main \
52 -I$(TOP)/src/mesa/glapi \
53 -I$(TOP)/src/mesa/math \
54 -I$(TOP)/src/mesa/transform \
55 -I$(TOP)/src/mesa/shader \
56 -I$(TOP)/src/mesa/swrast \
57 -I$(TOP)/src/mesa/swrast_setup \
58 -I$(TOP)/src/egl/main \
59 -I$(TOP)/src/egl/drivers/dri \
60 $(LIBDRM_CFLAGS)
61
62
63 ##### RULES #####
64
65 .c.o:
66 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
67
68 .S.o:
69 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
70
71
72 ##### TARGETS #####
73
74 default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
75
76
77 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
78 $(TOP)/bin/mklib -noprefix -o $@ \
79 $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
80
81
82 $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
83 $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
84
85
86 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
87 touch depend
88 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
89 $(ASM_SOURCES) 2>&1 /dev/null
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 *~ *.so *~ server/*.o $(SYMLINKS)
100 -rm -f depend depend.bak
101
102
103 install: $(LIBNAME)
104 $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
105 $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
106
107
108 include depend