Makefile 4.13 KB
Newer Older
Brian Paul's avatar
Brian Paul committed
1
2
3
4
5
6
# src/egl/main/Makefile

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


Chia-I Wu's avatar
Chia-I Wu committed
7
8
9
EGL_MAJOR = 1
EGL_MINOR = 0

Chia-I Wu's avatar
Chia-I Wu committed
10
INCLUDE_DIRS = -I$(TOP)/include
Brian Paul's avatar
Brian Paul committed
11
12

HEADERS = \
13
	eglcompiler.h \
Brian Paul's avatar
Brian Paul committed
14
15
	eglconfig.h \
	eglcontext.h \
Chia-I Wu's avatar
Chia-I Wu committed
16
	eglcurrent.h \
Brian Paul's avatar
Brian Paul committed
17
	egldefines.h \
Brian Paul's avatar
Brian Paul committed
18
19
20
	egldisplay.h \
	egldriver.h \
	eglglobals.h \
21
	eglimage.h \
22
	egllog.h \
23
	eglmisc.h \
Brian Paul's avatar
Brian Paul committed
24
	eglmode.h \
Chia-I Wu's avatar
Chia-I Wu committed
25
	eglmutex.h \
Brian Paul's avatar
Brian Paul committed
26
	eglscreen.h \
Brian Paul's avatar
Brian Paul committed
27
	eglstring.h \
28
29
	eglsurface.h \
	eglsync.h
Brian Paul's avatar
Brian Paul committed
30
31
32

SOURCES = \
	eglapi.c \
Chia-I Wu's avatar
Chia-I Wu committed
33
	eglarray.c \
Brian Paul's avatar
Brian Paul committed
34
35
	eglconfig.c \
	eglcontext.c \
Chia-I Wu's avatar
Chia-I Wu committed
36
	eglcurrent.c \
Brian Paul's avatar
Brian Paul committed
37
38
	egldisplay.c \
	egldriver.c \
39
	eglfallbacks.c \
Brian Paul's avatar
Brian Paul committed
40
	eglglobals.c \
41
	eglimage.c \
42
	egllog.c \
43
	eglmisc.c \
Brian Paul's avatar
Brian Paul committed
44
45
	eglmode.c \
	eglscreen.c \
Brian Paul's avatar
Brian Paul committed
46
	eglstring.c \
47
48
	eglsurface.c \
	eglsync.c
Brian Paul's avatar
Brian Paul committed
49
50
51
52

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


Chia-I Wu's avatar
Chia-I Wu committed
53
# use dl*() to load drivers
54
LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
55
56
57
58
59
60
LOCAL_LIBS =

# egl_dri2 and egl_glx are built-ins
ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
61
62
63
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
endif
64
65
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
EGL_LIB_DEPS += -lgbm
66
INCLUDE_DIRS += -I$(TOP)/src/gbm/main
67
endif
68
EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
69
endif
70

71

72
73
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
74
INCLUDE_DIRS += $(WAYLAND_CFLAGS)
75
76
endif

77
78
79
80
81
ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a
EGL_LIB_DEPS += $(X11_LIBS) $(DLOPEN_LIBS)
endif
82

83
84
85
86
87
# translate --with-egl-platforms to _EGLPlatformType
EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
ifeq ($(firstword $(EGL_PLATFORMS)),x11)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
endif
Benjamin Franzke's avatar
Benjamin Franzke committed
88
89
90
ifeq ($(firstword $(EGL_PLATFORMS)),wayland)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WAYLAND
endif
Chia-I Wu's avatar
Chia-I Wu committed
91
ifeq ($(firstword $(EGL_PLATFORMS)),drm)
92
93
94
95
96
97
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
endif
ifeq ($(firstword $(EGL_PLATFORMS)),fbdev)
EGL_NATIVE_PLATFORM=_EGL_PLATFORM_FBDEV
endif

98
99
100
101
102
103
104
105
106
107
108
109
110
ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
LOCAL_CFLAGS += -DHAVE_X11_PLATFORM
endif
ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
LOCAL_CFLAGS += -DHAVE_WAYLAND_PLATFORM
endif
ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
LOCAL_CFLAGS += -DHAVE_DRM_PLATFORM
endif
ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
LOCAL_CFLAGS += -DHAVE_FBDEV_PLATFORM
endif

Chia-I Wu's avatar
Chia-I Wu committed
111
LOCAL_CFLAGS += \
112
	-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
113
	-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\"
114

Brian Paul's avatar
Brian Paul committed
115
.c.o:
116
	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
Brian Paul's avatar
Brian Paul committed
117
118
119
120
121
122
123



default: depend library


# EGL Library
Chia-I Wu's avatar
Chia-I Wu committed
124
library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
Brian Paul's avatar
Brian Paul committed
125

Chia-I Wu's avatar
Chia-I Wu committed
126
$(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
Chia-I Wu's avatar
Chia-I Wu committed
127
128
129
	$(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
		-major $(EGL_MAJOR) -minor $(EGL_MINOR) \
		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
130
131
		-L$(TOP)/$(LIB_DIR) $(EGL_LIB_DEPS) \
		$(OBJECTS) $(LOCAL_LIBS)
Brian Paul's avatar
Brian Paul committed
132

Chia-I Wu's avatar
Chia-I Wu committed
133
134
135
136
137
138
139
140
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

Kristian Høgsberg's avatar
Kristian Høgsberg committed
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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
Johannes Engel's avatar
Johannes Engel committed
157
	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
Chia-I Wu's avatar
Chia-I Wu committed
158
159
	$(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
		$(DESTDIR)$(INSTALL_LIB_DIR)
Kristian Høgsberg's avatar
Kristian Høgsberg committed
160
161
	$(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
	$(INSTALL) -m 644 egl.pc $(DESTDIR)$(PKG_CONFIG_DIR)
Brian Paul's avatar
Brian Paul committed
162
163

clean:
Chia-I Wu's avatar
Chia-I Wu committed
164
	-rm -f *.o
165
	-rm -f depend depend.bak
Brian Paul's avatar
Brian Paul committed
166
167
168
169


depend: $(SOURCES) $(HEADERS)
	@ echo "running $(MKDEP)"
170
	@ rm -f depend
Brian Paul's avatar
Brian Paul committed
171
172
	@ touch depend
	$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
Brian Paul's avatar
Brian Paul committed
173
174
		$(SOURCES) $(HEADERS) > /dev/null 2>/dev/null

Brian Paul's avatar
Brian Paul committed
175

Chia-I Wu's avatar
Chia-I Wu committed
176
-include depend
Brian Paul's avatar
Brian Paul committed
177
# DO NOT DELETE