summaryrefslogtreecommitdiffstats
path: root/src/egl/main/Makefile
blob: 82fd855b1d5bc70900f86f5eaaa97b4a2b0f1790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# src/egl/main/Makefile

TOP = ../../..
include $(TOP)/configs/current


EGL_MAJOR = 1
EGL_MINOR = 0

INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS)

HEADERS = \
	eglcompiler.h \
	eglconfig.h \
	eglconfigutil.h \
	eglcontext.h \
	eglcurrent.h \
	egldefines.h \
	egldisplay.h \
	egldriver.h \
	eglglobals.h \
	eglimage.h \
	egllog.h \
	eglmisc.h \
	eglmode.h \
	eglmutex.h \
	eglscreen.h \
	eglstring.h \
	eglsurface.h

SOURCES = \
	eglapi.c \
	eglconfig.c \
	eglconfigutil.c \
	eglcontext.c \
	eglcurrent.c \
	egldisplay.c \
	egldriver.c \
	eglglobals.c \
	eglimage.c \
	egllog.c \
	eglmisc.c \
	eglmode.c \
	eglscreen.c \
	eglstring.c \
	eglsurface.c

OBJECTS = $(SOURCES:.c=.o)


# use dl*() to load drivers
LOCAL_CFLAGS = -D_EGL_PLATFORM_POSIX=1

EGL_DEFAULT_DISPLAY = $(word 1, $(EGL_DISPLAYS))

LOCAL_CFLAGS += \
	-D_EGL_DEFAULT_DISPLAY=\"$(EGL_DEFAULT_DISPLAY)\" \
	-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\"

.c.o:
	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@



default: depend library


# EGL Library
library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)

$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS)
	$(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
		-major $(EGL_MAJOR) -minor $(EGL_MINOR) \
		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
		$(EGL_LIB_DEPS) $(OBJECTS)

install-headers:
	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR
	$(INSTALL) -m 644 $(TOP)/include/KHR/*.h \
		$(DESTDIR)$(INSTALL_INC_DIR)/KHR
	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/EGL
	$(INSTALL) -m 644 $(TOP)/include/EGL/*.h \
		$(DESTDIR)$(INSTALL_INC_DIR)/EGL

PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig

gl_pcedit = sed \
	-e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
	-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
	-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
	-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
	-e 's,@EGL_PC_REQ_PRIV@,$(EGL_PC_REQ_PRIV),' \
	-e 's,@EGL_PC_LIB_PRIV@,$(EGL_PC_LIB_PRIV),' \
	-e 's,@EGL_PC_CFLAGS@,$(EGL_PC_CFLAGS),' \
	-e 's,@EGL_LIB@,$(EGL_LIB),'

egl.pc: egl.pc.in
	$(gl_pcedit) $< > $@

install: default install-headers egl.pc
	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
	$(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
		$(DESTDIR)$(INSTALL_LIB_DIR)
	$(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
	$(INSTALL) -m 644 egl.pc $(DESTDIR)$(PKG_CONFIG_DIR)

clean:
	-rm -f *.o
	-rm -f depend depend.bak


depend: $(SOURCES) $(HEADERS)
	@ echo "running $(MKDEP)"
	@ rm -f depend
	@ touch depend
	$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
		$(SOURCES) $(HEADERS) > /dev/null 2>/dev/null


-include depend
# DO NOT DELETE