egl: Install drivers to ${libdir}/egl.
[mesa.git] / src / egl / main / Makefile
1 # src/egl/main/Makefile
2
3 TOP = ../../..
4 include $(TOP)/configs/current
5
6
7 EGL_MAJOR = 1
8 EGL_MINOR = 0
9
10 INCLUDE_DIRS = -I$(TOP)/include
11
12 HEADERS = \
13 eglcompiler.h \
14 eglconfig.h \
15 eglconfigutil.h \
16 eglcontext.h \
17 eglcurrent.h \
18 egldefines.h \
19 egldisplay.h \
20 egldriver.h \
21 eglglobals.h \
22 egllog.h \
23 eglmisc.h \
24 eglmode.h \
25 eglmutex.h \
26 eglscreen.h \
27 eglstring.h \
28 eglsurface.h
29
30 SOURCES = \
31 eglapi.c \
32 eglconfig.c \
33 eglconfigutil.c \
34 eglcontext.c \
35 eglcurrent.c \
36 egldisplay.c \
37 egldriver.c \
38 eglglobals.c \
39 egllog.c \
40 eglmisc.c \
41 eglmode.c \
42 eglscreen.c \
43 eglstring.c \
44 eglsurface.c
45
46 OBJECTS = $(SOURCES:.c=.o)
47
48
49 # use dl*() to load drivers
50 LOCAL_CFLAGS = -D_EGL_PLATFORM_POSIX=1
51
52 EGL_DEFAULT_DISPLAY = $(word 1, $(EGL_DISPLAYS))
53
54 LOCAL_CFLAGS += \
55 -D_EGL_DEFAULT_DISPLAY=\"$(EGL_DEFAULT_DISPLAY)\" \
56 -D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\"
57
58 .c.o:
59 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
60
61
62
63 default: depend library
64
65
66 # EGL Library
67 library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
68
69 $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS)
70 $(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
71 -major $(EGL_MAJOR) -minor $(EGL_MINOR) \
72 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
73 $(EGL_LIB_DEPS) $(OBJECTS)
74
75 install: default
76 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
77 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
78 $(DESTDIR)$(INSTALL_LIB_DIR)
79
80 clean:
81 -rm -f *.o
82 -rm -f depend depend.bak
83
84
85 depend: $(SOURCES) $(HEADERS)
86 @ echo "running $(MKDEP)"
87 @ rm -f depend
88 @ touch depend
89 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
90 $(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
91
92
93 -include depend
94 # DO NOT DELETE