Merge commit 'origin/gallium-0.1'
[mesa.git] / src / mesa / drivers / dri / Makefile.template
1 # -*-makefile-*-
2
3 MESA_MODULES = $(TOP)/src/mesa/libmesa.a
4
5 COMMON_GALLIUM_SOURCES = \
6 ../common/utils.c \
7 ../common/vblank.c \
8 ../common/dri_util.c \
9 ../common/xmlconfig.c
10
11 COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
12 ../../common/driverfuncs.c \
13 ../common/texmem.c \
14 ../common/drirenderbuffer.c
15
16 ifeq ($(WINDOW_SYSTEM),dri)
17 WINOBJ=
18 WINLIB=
19 INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
20
21 OBJECTS = $(C_SOURCES:.c=.o) \
22 $(ASM_SOURCES:.S=.o)
23
24 else
25 # miniglx
26 WINOBJ=
27 WINLIB=-L$(MESA)/src/glx/mini
28 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
29 INCLUDES = $(MINIGLX_INCLUDES) \
30 $(SHARED_INCLUDES) \
31 $(PCIACCESS_CFLAGS)
32
33 OBJECTS = $(C_SOURCES:.c=.o) \
34 $(MINIGLX_SOURCES:.c=.o) \
35 $(ASM_SOURCES:.S=.o)
36 endif
37
38
39 ### Include directories
40 SHARED_INCLUDES = \
41 -I. \
42 -I$(TOP)/src/mesa/drivers/dri/common \
43 -Iserver \
44 -I$(TOP)/include \
45 -I$(TOP)/src/mesa \
46 -I$(TOP)/src/egl/main \
47 -I$(TOP)/src/egl/drivers/dri \
48 $(LIBDRM_CFLAGS)
49
50
51 ##### RULES #####
52
53 .c.o:
54 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
55
56 .S.o:
57 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
58
59
60 ##### TARGETS #####
61
62 default: symlinks depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
63
64
65 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
66 $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
67 $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
68
69
70 $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
71 $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
72
73
74 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
75 rm -f depend
76 touch depend
77 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
78 $(ASM_SOURCES)
79
80
81 # Emacs tags
82 tags:
83 etags `find . -name \*.[ch]` `find ../include`
84
85
86 # Remove .o and backup files
87 clean:
88 -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
89 -rm -f depend depend.bak
90
91
92 install: $(LIBNAME)
93 $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
94 $(INSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
95
96
97 -include depend