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 ifneq ($(findstring x11
, $(EGL_PLATFORMS
)),)
62 EGL_LIB_DEPS
+= $(XCB_DRI2_LIBS
)
64 ifneq ($(findstring drm
, $(EGL_PLATFORMS
)),)
67 EGL_LIB_DEPS
+= $(LIBUDEV_LIBS
) $(DLOPEN_LIBS
) $(LIBDRM_LIB
) $(WAYLAND_LIBS
)
71 ifneq ($(findstring wayland
, $(EGL_PLATFORMS
)),)
72 LOCAL_LIBS
+= $(TOP
)/src
/egl
/wayland
/wayland-drm
/libwayland-drm.a
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
)
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
86 ifeq ($(firstword $(EGL_PLATFORMS
)),wayland
)
87 EGL_NATIVE_PLATFORM
=_EGL_PLATFORM_WAYLAND
89 ifeq ($(firstword $(EGL_PLATFORMS
)),drm
)
90 EGL_NATIVE_PLATFORM
=_EGL_PLATFORM_DRM
92 ifeq ($(firstword $(EGL_PLATFORMS
)),fbdev
)
93 EGL_NATIVE_PLATFORM
=_EGL_PLATFORM_FBDEV
97 -D_EGL_NATIVE_PLATFORM
=$(EGL_NATIVE_PLATFORM
) \
98 -D_EGL_DRIVER_SEARCH_DIR
=\"$(EGL_DRIVER_INSTALL_DIR
)\"
101 $(CC
) -c
$(INCLUDE_DIRS
) $(CFLAGS
) $(LOCAL_CFLAGS
) $< -o
$@
105 default
: depend 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
)
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
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),'
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
)
150 -rm -f depend depend.bak
153 depend
: $(SOURCES
) $(HEADERS
)
154 @ echo
"running $(MKDEP)"
157 $(MKDEP
) $(MKDEP_OPTIONS
) $(DEFINES
) $(INCLUDE_DIRS
) \
158 $(SOURCES
) $(HEADERS
) > /dev
/null
2>/dev
/null