glcore: tree sharing for DRI and XMesa
[mesa.git] / src / mesa / drivers / xorg / Makefile
1 # src/mesa/drivers/xorg/Makefile
2
3 TOP = ../../../..
4 include $(TOP)/configs/current
5
6 LIBNAME = libGLcore.so
7
8 SYMLINKS = \
9 glxheader.h \
10 xmesaP.h \
11 xm_api.c \
12 xm_buffer.c \
13 xm_dd.c \
14 xm_image.c \
15 xm_image.h \
16 xm_line.c \
17 xm_span.c \
18 xm_tri.c
19
20 C_SOURCES = \
21 xm_api.c \
22 xm_buffer.c \
23 xm_dd.c \
24 xm_image.c \
25 xm_line.c \
26 xm_span.c \
27 xm_tri.c \
28 glcore.c
29
30 ########################################
31
32 MESA_MODULES = $(TOP)/src/mesa/libmesa.a
33
34 C_SOURCES += ../common/driverfuncs.c
35 ifeq ("${DRIVER_DIRS}", "dri")
36 C_SOURCES += ../dri/common/utils.c
37 endif
38
39 OBJECTS = $(C_SOURCES:.c=.o)
40
41 ### Include directories
42 INCLUDES = \
43 -I. \
44 -I.. \
45 -I$(TOP)/include \
46 -I$(TOP)/src/mesa \
47 -I$(TOP)/src/mesa/main \
48 -I$(TOP)/src/mesa/glapi \
49 `pkg-config --cflags xorg-server`
50
51 ifeq ("${DRIVER_DIRS}", "dri")
52 INCLUDES += \
53 -I$(TOP)/src/mesa/drivers/dri/common \
54 `pkg-config --cflags libdrm`
55 endif
56
57 # undef 'USE_XSHM' to make it explicit that 'XFree86Server' takes precedence
58 DRIVER_DEFINES = -UUSE_XSHM -DXFree86Server
59
60 ##### RULES #####
61
62 .c.o:
63 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
64
65
66 ##### TARGETS #####
67
68 default: depend symlinks $(LIBNAME)
69
70
71 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) Makefile
72 $(TOP)/bin/mklib -noprefix -o $@ \
73 $(OBJECTS) $(MESA_MODULES) $(GLCORE_LIB_DEPS)
74
75
76 depend: $(C_SOURCES) $(SYMLINKS)
77 touch depend
78 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
79 > /dev/null
80
81
82 clean:
83 -rm -f *.o *.so $(SYMLINKS)
84 -rm -f depend depend.bak
85
86 install: $(LIBNAME)
87 $(INSTALL) -d $(DRI_DRIVER_INSTALL_DIR)
88 $(INSTALL) -m 755 $(LIBNAME) $(DRI_DRIVER_INSTALL_DIR)
89
90 $(SYMLINKS):
91 @[ -e $@ ] || ln -sf ../x11/$@ ./
92
93 symlinks: $(SYMLINKS)
94
95 include depend