1 # src/egl/main/Makefile
4 include $(TOP)/configs/current
10 INCLUDE_DIRS = -I$(TOP)/include
50 OBJECTS = $(SOURCES:.c=.o)
53 # use dl*() to load drivers
54 LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
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 EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
63 ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx)
64 LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_GLX
65 LOCAL_LIBS += $(TOP)/src/egl/drivers/glx/libegl_glx.a
66 EGL_LIB_DEPS += $(X11_LIBS) $(DLOPEN_LIBS)
69 # translate --with-egl-platforms to _EGLPlatformType
70 EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM
71 ifeq ($(firstword $(EGL_PLATFORMS)),x11)
72 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11
74 ifeq ($(firstword $(EGL_PLATFORMS)),drm)
75 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM
77 ifeq ($(firstword $(EGL_PLATFORMS)),fbdev)
78 EGL_NATIVE_PLATFORM=_EGL_PLATFORM_FBDEV
82 -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
83 -D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\"
86 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
90 default: depend library
94 library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME)
96 $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) $(LOCAL_LIBS)
97 $(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
98 -major $(EGL_MAJOR) -minor $(EGL_MINOR) \
99 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
100 -L$(TOP)/$(LIB_DIR) $(EGL_LIB_DEPS) \
101 $(OBJECTS) $(LOCAL_LIBS)
104 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR
105 $(INSTALL) -m 644 $(TOP)/include/KHR/*.h \
106 $(DESTDIR)$(INSTALL_INC_DIR)/KHR
107 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/EGL
108 $(INSTALL) -m 644 $(TOP)/include/EGL/*.h \
109 $(DESTDIR)$(INSTALL_INC_DIR)/EGL
111 PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig
114 -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
115 -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
116 -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
117 -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
118 -e 's,@EGL_PC_REQ_PRIV@,$(EGL_PC_REQ_PRIV),' \
119 -e 's,@EGL_PC_LIB_PRIV@,$(EGL_PC_LIB_PRIV),' \
120 -e 's,@EGL_PC_CFLAGS@,$(EGL_PC_CFLAGS),' \
121 -e 's,@EGL_LIB@,$(EGL_LIB),'
126 install: default install-headers egl.pc
127 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
128 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \
129 $(DESTDIR)$(INSTALL_LIB_DIR)
130 $(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
131 $(INSTALL) -m 644 egl.pc $(DESTDIR)$(PKG_CONFIG_DIR)
135 -rm -f depend depend.bak
138 depend: $(SOURCES) $(HEADERS)
139 @ echo "running $(MKDEP)"
142 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
143 $(SOURCES) $(HEADERS) > /dev/null 2>/dev/null