r300g: support index bias on r500 and DRM 2.3.0
[mesa.git] / src / gallium / targets / Makefile.dri
1 # -*-makefile-*-
2
3 ifeq ($(MESA_LLVM),1)
4 DRIVER_DEFINES += -DGALLIUM_LLVMPIPE
5 PIPE_DRIVERS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
6 LDFLAGS += $(LLVM_LDFLAGS)
7 LD = g++
8 DRIVER_EXTRAS = $(LLVM_LIBS)
9 USE_CXX=1
10 endif
11
12 MESA_MODULES = \
13 $(TOP)/src/mesa/libmesagallium.a \
14 $(GALLIUM_AUXILIARIES)
15
16 COMMON_GALLIUM_SOURCES = \
17 $(TOP)/src/mesa/drivers/dri/common/utils.c \
18 $(TOP)/src/mesa/drivers/dri/common/vblank.c \
19 $(TOP)/src/mesa/drivers/dri/common/dri_util.c \
20 $(TOP)/src/mesa/drivers/dri/common/xmlconfig.c
21
22 COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \
23 $(TOP)/src/mesa/drivers/common/driverfuncs.c \
24 $(TOP)/src/mesa/drivers/dri/common/texmem.c \
25 $(TOP)/src/mesa/drivers/dri/common/drirenderbuffer.c
26
27 COMMON_BM_SOURCES = \
28 $(TOP)/src/mesa/drivers/dri/common/dri_bufmgr.c \
29 $(TOP)/src/mesa/drivers/dri/common/dri_drmpool.c
30
31 INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES)
32
33 OBJECTS = \
34 $(C_SOURCES:.c=.o) \
35 $(ASM_SOURCES:.S=.o)
36
37
38 ### Include directories
39 SHARED_INCLUDES = \
40 -I. \
41 -I$(TOP)/src/mesa/drivers/dri/common \
42 -Iserver \
43 -I$(TOP)/include \
44 -I$(TOP)/include/GL/internal \
45 -I$(TOP)/src/gallium/include \
46 -I$(TOP)/src/gallium/auxiliary \
47 -I$(TOP)/src/gallium/drivers \
48 -I$(TOP)/src/gallium/winsys \
49 -I$(TOP)/src/mesa \
50 -I$(TOP)/src/mesa/main \
51 -I$(TOP)/src/mesa/glapi \
52 -I$(TOP)/src/mesa/math \
53 -I$(TOP)/src/mesa/transform \
54 -I$(TOP)/src/mesa/shader \
55 -I$(TOP)/src/mesa/swrast \
56 -I$(TOP)/src/mesa/swrast_setup \
57 -I$(TOP)/src/egl/main \
58 -I$(TOP)/src/egl/drivers/dri \
59 $(LIBDRM_CFLAGS)
60
61
62 ##### RULES #####
63
64 .c.o:
65 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
66
67 .S.o:
68 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
69
70
71 ##### TARGETS #####
72
73 default: depend symlinks $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME)
74
75 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \
76 $(TOP)/src/mesa/drivers/dri/Makefile.template $(TOP)/src/mesa/drivers/dri/common/dri_test.o
77 $(MKLIB) -o $@.tmp -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
78 $(OBJECTS) $(PIPE_DRIVERS) \
79 -Wl,--start-group $(MESA_MODULES) -Wl,--end-group \
80 $(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
81 if [ "x${USE_CXX}" == "x" ]; then \
82 $(CC) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS); \
83 else \
84 $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS); \
85 fi
86 @rm -f $@.test
87 mv -f $@.tmp $@
88
89 $(TOP)/$(LIB_DIR)/gallium:
90 mkdir -p $@
91
92 $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
93 $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
94
95 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
96 rm -f depend
97 touch depend
98 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
99 $(ASM_SOURCES) 2> /dev/null
100
101
102 # Emacs tags
103 tags:
104 etags `find . -name \*.[ch]` `find ../include`
105
106
107 # Remove .o and backup files
108 clean:
109 -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
110 -rm -f depend depend.bak
111
112
113 install: $(LIBNAME)
114 $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
115 $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
116
117
118 include depend