Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
[mesa.git] / src / egl / drivers / xdri / Makefile
1 # src/egl/drivers/xdri/Makefile
2
3 # Build XEGL DRI driver loader library: egl_xdri.so
4
5
6 TOP = ../../../..
7 include $(TOP)/configs/current
8
9
10 DRIVER_NAME = egl_xdri.so
11
12
13 INCLUDE_DIRS = \
14 -I. \
15 -I/usr/include \
16 $(shell pkg-config --cflags-only-I libdrm) \
17 -I$(TOP)/include \
18 -I$(TOP)/include/GL/internal \
19 -I$(TOP)/src/mesa \
20 -I$(TOP)/src/mesa/glapi \
21 -I$(TOP)/src/egl/main \
22 -I$(TOP)/src/glx/x11
23
24 HEADERS = glxinit.h driinit.h
25 SOURCES = egl_xdri.c glxinit.c driinit.c
26
27 DRI_SOURCES = dri_common.c XF86dri.c dri2.c dri2_glx.c dri_glx.c
28 DRI_SOURCES := $(addprefix ../../../glx/x11/,$(DRI_SOURCES))
29
30 SOURCES += $(DRI_SOURCES)
31
32 OBJECTS = $(SOURCES:.c=.o)
33
34 DRM_LIB = `pkg-config --libs libdrm`
35
36 CFLAGS += -DGLX_DIRECT_RENDERING
37
38 .c.o:
39 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
40
41
42 .PHONY: library
43
44
45 default: depend library Makefile
46
47
48 library: $(TOP)/$(LIB_DIR)/$(DRIVER_NAME)
49
50
51 # Make the egl_xdri.so library
52 $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(OBJECTS)
53 $(TOP)/bin/mklib -o $(DRIVER_NAME) \
54 -noprefix \
55 -major 1 -minor 0 \
56 -L$(TOP)/$(LIB_DIR) \
57 -install $(TOP)/$(LIB_DIR) \
58 $(OBJECTS) $(DRM_LIB) $(GL_LIB_DEPS)
59
60 install:
61 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
62 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
63
64 clean:
65 rm -f *.o
66 rm -f *.so
67 rm -f depend depend.bak
68
69
70 depend: $(SOURCES) $(HEADERS)
71 @ echo "running $(MKDEP)"
72 @ rm -f depend
73 @ touch depend
74 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
75 $(SOURCES) $(HEADERS) >/dev/null 2>/dev/null
76
77 include depend
78 # DO NOT DELETE