WIP: Replace TTM buffer pool manager with a simplified interface.
[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 WINOBJ=
30 WINLIB=-L$(MESA)/src/glx/mini
31 MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
32 INCLUDES = $(MINIGLX_INCLUDES) \
33 $(SHARED_INCLUDES)
34
35 OBJECTS = $(C_SOURCES:.c=.o) \
36 $(MINIGLX_SOURCES:.c=.o) \
37 $(ASM_SOURCES:.S=.o)
38 endif
39
40
41 ### Include directories
42 SHARED_INCLUDES = \
43 -I. \
44 -I$(TOP)/src/mesa/drivers/dri/common \
45 -Iserver \
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 -I$(TOP)/src/egl/drivers/dri \
58 `pkg-config --cflags libdrm`
59
60 ##### RULES #####
61
62 .c.o:
63 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
64
65 .S.o:
66 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
67
68
69 ##### TARGETS #####
70
71 default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
72
73
74 #$(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
75 # @echo BUILDING FOR: $(WINDOW_SYSTEM)
76 # $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(TOP)/$(LIB_DIR) \
77 # $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
78
79 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
80 $(TOP)/bin/mklib -noprefix -o $@ \
81 $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
82
83
84 $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
85 $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)
86
87
88
89 # Run 'make depend' to update the dependencies if you change
90 # what's included by any source file.
91 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
92 touch depend
93 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
94 $(ASM_SOURCES) 2>&1 /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) -d $(DRI_DRIVER_INSTALL_DIR)
109 $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
110
111 include depend