Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 1 | # src/egl/main/Makefile |
| 2 | |
| 3 | TOP = ../../.. |
| 4 | include $(TOP)/configs/current |
| 5 | |
| 6 | |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 7 | EGL_MAJOR = 1 |
| 8 | EGL_MINOR = 0 |
| 9 | |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 10 | INCLUDE_DIRS = -I$(TOP)/include |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 11 | |
| 12 | HEADERS = \ |
Chia-I Wu | 8e92ec9 | 2009-07-16 21:21:51 -0700 | [diff] [blame] | 13 | eglcompiler.h \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 14 | eglconfig.h \ |
Brian Paul | a772bbb | 2008-05-27 16:57:49 -0600 | [diff] [blame] | 15 | eglconfigutil.h \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 16 | eglcontext.h \ |
Chia-I Wu | 75da80b | 2009-07-17 11:41:02 -0600 | [diff] [blame] | 17 | eglcurrent.h \ |
Brian Paul | cf3c7d7 | 2008-05-28 15:21:52 -0600 | [diff] [blame] | 18 | egldefines.h \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 19 | egldisplay.h \ |
| 20 | egldriver.h \ |
| 21 | eglglobals.h \ |
Chia-I Wu | a1c4a8a | 2009-08-15 22:58:13 +0800 | [diff] [blame] | 22 | eglimage.h \ |
Brian Paul | f049ca4 | 2005-11-23 01:37:30 +0000 | [diff] [blame] | 23 | egllog.h \ |
Brian Paul | 11a261e | 2008-05-28 15:50:58 -0600 | [diff] [blame] | 24 | eglmisc.h \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 25 | eglmode.h \ |
Chia-I Wu | e79d21c | 2009-08-10 11:35:06 +0800 | [diff] [blame] | 26 | eglmutex.h \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 27 | eglscreen.h \ |
Brian Paul | e94d383 | 2008-05-28 12:54:33 -0600 | [diff] [blame] | 28 | eglstring.h \ |
Chia-I Wu | 5a459d5 | 2009-08-21 13:53:36 +0800 | [diff] [blame] | 29 | eglsurface.h |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 30 | |
| 31 | SOURCES = \ |
| 32 | eglapi.c \ |
| 33 | eglconfig.c \ |
Brian Paul | a772bbb | 2008-05-27 16:57:49 -0600 | [diff] [blame] | 34 | eglconfigutil.c \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 35 | eglcontext.c \ |
Chia-I Wu | 75da80b | 2009-07-17 11:41:02 -0600 | [diff] [blame] | 36 | eglcurrent.c \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 37 | egldisplay.c \ |
| 38 | egldriver.c \ |
| 39 | eglglobals.c \ |
Chia-I Wu | a1c4a8a | 2009-08-15 22:58:13 +0800 | [diff] [blame] | 40 | eglimage.c \ |
Brian Paul | f049ca4 | 2005-11-23 01:37:30 +0000 | [diff] [blame] | 41 | egllog.c \ |
Brian Paul | 11a261e | 2008-05-28 15:50:58 -0600 | [diff] [blame] | 42 | eglmisc.c \ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 43 | eglmode.c \ |
| 44 | eglscreen.c \ |
Brian Paul | e94d383 | 2008-05-28 12:54:33 -0600 | [diff] [blame] | 45 | eglstring.c \ |
Chia-I Wu | 5a459d5 | 2009-08-21 13:53:36 +0800 | [diff] [blame] | 46 | eglsurface.c |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 47 | |
| 48 | OBJECTS = $(SOURCES:.c=.o) |
| 49 | |
| 50 | |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 51 | # use dl*() to load drivers |
Chia-I Wu | 6f690ca | 2010-06-15 19:34:51 +0800 | [diff] [blame] | 52 | LOCAL_CFLAGS = -D_EGL_OS_UNIX=1 |
Brian Paul | 6052af1 | 2008-05-27 16:48:23 -0600 | [diff] [blame] | 53 | |
Chia-I Wu | f22665d | 2010-06-17 17:14:03 +0800 | [diff] [blame] | 54 | # translate --with-egl-platforms to _EGLPlatformType |
| 55 | EGL_NATIVE_PLATFORM=_EGL_INVALID_PLATFORM |
| 56 | ifeq ($(firstword $(EGL_PLATFORMS)),x11) |
| 57 | EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11 |
| 58 | endif |
| 59 | ifeq ($(firstword $(EGL_PLATFORMS)),kms) |
| 60 | EGL_NATIVE_PLATFORM=_EGL_PLATFORM_DRM |
| 61 | endif |
| 62 | ifeq ($(firstword $(EGL_PLATFORMS)),fbdev) |
| 63 | EGL_NATIVE_PLATFORM=_EGL_PLATFORM_FBDEV |
| 64 | endif |
| 65 | |
Chia-I Wu | b3bcd33 | 2010-01-19 18:13:50 +0800 | [diff] [blame] | 66 | LOCAL_CFLAGS += \ |
Chia-I Wu | f22665d | 2010-06-17 17:14:03 +0800 | [diff] [blame] | 67 | -D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \ |
Chia-I Wu | 28c3e57 | 2010-01-23 20:18:43 +0800 | [diff] [blame] | 68 | -D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" |
Brian Paul | 6052af1 | 2008-05-27 16:48:23 -0600 | [diff] [blame] | 69 | |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 70 | .c.o: |
Brian Paul | 6052af1 | 2008-05-27 16:48:23 -0600 | [diff] [blame] | 71 | $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@ |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 72 | |
| 73 | |
| 74 | |
| 75 | default: depend library |
| 76 | |
| 77 | |
| 78 | # EGL Library |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 79 | library: $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME) |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 80 | |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 81 | $(TOP)/$(LIB_DIR)/$(EGL_LIB_NAME): $(OBJECTS) |
| 82 | $(MKLIB) -o $(EGL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ |
| 83 | -major $(EGL_MAJOR) -minor $(EGL_MINOR) \ |
| 84 | -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ |
Brian Paul | c34c78b | 2009-02-25 08:41:13 -0700 | [diff] [blame] | 85 | $(EGL_LIB_DEPS) $(OBJECTS) |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 86 | |
Chia-I Wu | 3f932a4 | 2010-01-25 11:34:09 +0800 | [diff] [blame] | 87 | install-headers: |
| 88 | $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR |
| 89 | $(INSTALL) -m 644 $(TOP)/include/KHR/*.h \ |
| 90 | $(DESTDIR)$(INSTALL_INC_DIR)/KHR |
| 91 | $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/EGL |
| 92 | $(INSTALL) -m 644 $(TOP)/include/EGL/*.h \ |
| 93 | $(DESTDIR)$(INSTALL_INC_DIR)/EGL |
| 94 | |
Kristian Høgsberg | ceffd7b | 2010-03-10 16:47:36 -0500 | [diff] [blame] | 95 | PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig |
| 96 | |
| 97 | gl_pcedit = sed \ |
| 98 | -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ |
| 99 | -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ |
| 100 | -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ |
| 101 | -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ |
| 102 | -e 's,@EGL_PC_REQ_PRIV@,$(EGL_PC_REQ_PRIV),' \ |
| 103 | -e 's,@EGL_PC_LIB_PRIV@,$(EGL_PC_LIB_PRIV),' \ |
| 104 | -e 's,@EGL_PC_CFLAGS@,$(EGL_PC_CFLAGS),' \ |
| 105 | -e 's,@EGL_LIB@,$(EGL_LIB),' |
| 106 | |
| 107 | egl.pc: egl.pc.in |
| 108 | $(gl_pcedit) $< > $@ |
| 109 | |
| 110 | install: default install-headers egl.pc |
Johannes Engel | 1e81855 | 2009-02-11 11:31:05 +0100 | [diff] [blame] | 111 | $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 112 | $(MINSTALL) $(TOP)/$(LIB_DIR)/$(EGL_LIB_GLOB) \ |
| 113 | $(DESTDIR)$(INSTALL_LIB_DIR) |
Kristian Høgsberg | ceffd7b | 2010-03-10 16:47:36 -0500 | [diff] [blame] | 114 | $(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR) |
| 115 | $(INSTALL) -m 644 egl.pc $(DESTDIR)$(PKG_CONFIG_DIR) |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 116 | |
| 117 | clean: |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 118 | -rm -f *.o |
Pauli Nieminen | 1103898 | 2009-08-09 15:22:34 +0300 | [diff] [blame] | 119 | -rm -f depend depend.bak |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 120 | |
| 121 | |
| 122 | depend: $(SOURCES) $(HEADERS) |
| 123 | @ echo "running $(MKDEP)" |
Keith Whitwell | 90ee7a4 | 2007-08-07 10:18:04 +0100 | [diff] [blame] | 124 | @ rm -f depend |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 125 | @ touch depend |
| 126 | $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \ |
Brian Paul | 3e41289 | 2008-05-27 13:45:16 -0600 | [diff] [blame] | 127 | $(SOURCES) $(HEADERS) > /dev/null 2>/dev/null |
| 128 | |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 129 | |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 130 | -include depend |
Brian Paul | adbff7e | 2005-04-22 21:09:39 +0000 | [diff] [blame] | 131 | # DO NOT DELETE |