Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / mesa / src / egl / main / Makefile
blob775fbbe178b670a4f9cc8e86a50d9ac8a4dbd118
1 # src/egl/main/Makefile
3 TOP = ../../..
4 include $(TOP)/configs/current
7 EGL_MAJOR = 1
8 EGL_MINOR = 0
10 INCLUDE_DIRS = -I$(TOP)/include
12 HEADERS = \
13 eglcompiler.h \
14 eglconfig.h \
15 eglcontext.h \
16 eglcurrent.h \
17 egldefines.h \
18 egldisplay.h \
19 egldriver.h \
20 eglglobals.h \
21 eglimage.h \
22 egllog.h \
23 eglmisc.h \
24 eglmode.h \
25 eglmutex.h \
26 eglscreen.h \
27 eglstring.h \
28 eglsurface.h \
29 eglsync.h
31 SOURCES = \
32 eglapi.c \
33 eglarray.c \
34 eglconfig.c \
35 eglcontext.c \
36 eglcurrent.c \
37 egldisplay.c \
38 egldriver.c \
39 eglfallbacks.c \
40 eglglobals.c \
41 eglimage.c \
42 egllog.c \
43 eglmisc.c \
44 eglmode.c \
45 eglscreen.c \
46 eglstring.c \
47 eglsurface.c \
48 eglsync.c
50 OBJECTS = $(SOURCES:.c=.o)
53 # use dl*() to load drivers
54 LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
55 LOCAL_LIBS =
57 # egl_dri2 and egl_glx are built-ins
58 ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2)
59 LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
60 LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
61 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
62 EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
63 endif
64 ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
65 EGL_LIB_DEPS += -lgbm
66 endif
67 EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
68 endif
71 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
72 LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
73 endif
75 ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
76 LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
77 LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a
78 EGL_LIB_DEPS += $(X11_LIBS) $(DLOPEN_LIBS)
79 endif
81 # translate --with-egl-platforms to _EGLPlatformType
82 EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
83 ifeq ($(firstword $(EGL_PLATFORMS)),x11)
84 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
85 endif
86 ifeq ($(firstword $(EGL_PLATFORMS)),wayland)
87 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_WAYLAND
88 endif
89 ifeq ($(firstword $(EGL_PLATFORMS)),drm)
90 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
91 endif
92 ifeq ($(firstword $(EGL_PLATFORMS)),fbdev)
93 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_FBDEV
94 endif
96 LOCAL_CFLAGS += \
97 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
98 -D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\"
100 .c.o:
101 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
105 default: depend library
108 # EGL Library
109 library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
111 $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
112 $(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
113 -major $(EGL_MAJOR) -minor $(EGL_MINOR) \
114 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
115 -L$(TOP)/$(LIB_DIR) $(EGL_LIB_DEPS) \
116 $(OBJECTS) $(LOCAL_LIBS)
118 install-headers:
119 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR
120 $(INSTALL) -m 644 $(TOP)/include/KHR/*.h \
121 $(DESTDIR)$(INSTALL_INC_DIR)/KHR
122 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/EGL
123 $(INSTALL) -m 644 $(TOP)/include/EGL/*.h \
124 $(DESTDIR)$(INSTALL_INC_DIR)/EGL
126 PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig
128 gl_pcedit = sed \
129 -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
130 -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
131 -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
132 -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
133 -e 's,@EGL_PC_REQ_PRIV@,$(EGL_PC_REQ_PRIV),' \
134 -e 's,@EGL_PC_LIB_PRIV@,$(EGL_PC_LIB_PRIV),' \
135 -e 's,@EGL_PC_CFLAGS@,$(EGL_PC_CFLAGS),' \
136 -e 's,@EGL_LIB@,$(EGL_LIB),'
138 egl.pc: egl.pc.in
139 $(gl_pcedit) $< > $@
141 install: default install-headers egl.pc
142 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
143 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
144 $(DESTDIR)$(INSTALL_LIB_DIR)
145 $(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
146 $(INSTALL) -m 644 egl.pc $(DESTDIR)$(PKG_CONFIG_DIR)
148 clean:
149 -rm -f *.o
150 -rm -f depend depend.bak
153 depend: $(SOURCES) $(HEADERS)
154 @ echo "running $(MKDEP)"
155 @ rm -f depend
156 @ touch depend
157 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
158 $(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
161 -include depend
162 # DO NOT DELETE