summaryrefslogtreecommitdiffstats
path: root/src/gbm/main/Makefile
diff options
context:
space:
mode:
authorBenjamin Franzke <[email protected]>2011-05-26 15:09:39 +0200
committerBenjamin Franzke <[email protected]>2011-06-23 21:07:17 +0200
commiteddcecbf74da26716509c047b95e85b00c12bab4 (patch)
treeec11550c8f3cc42b2b71aa35475353a52b8843d9 /src/gbm/main/Makefile
parent15d7f1c1c73735eb108710a01806712b11ce5e8a (diff)
Add gbm (generic/graphics buffer manager)
Diffstat (limited to 'src/gbm/main/Makefile')
-rw-r--r--src/gbm/main/Makefile85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/gbm/main/Makefile b/src/gbm/main/Makefile
new file mode 100644
index 00000000000..277fba18eee
--- /dev/null
+++ b/src/gbm/main/Makefile
@@ -0,0 +1,85 @@
+# src/gbm/main/Makefile
+
+TOP = ../../..
+include $(TOP)/configs/current
+
+INCLUDE_DIRS = -I$(TOP)/include
+
+HEADERS = \
+ common.h \
+ backend.h \
+ gbmint.h \
+ gbm.h
+
+SOURCES = \
+ gbm.c \
+ backend.c \
+ common.c
+
+OBJECTS = $(SOURCES:.c=.o)
+
+# use dl*() to load drivers
+LOCAL_CFLAGS = $(LIBUDEV_CFLAGS) $(DLOPEN_CFLAGS) \
+ -D_OS_UNIX=1 -DMODULEDIR='"$(GBM_BACKEND_INSTALL_DIR)"'
+LOCAL_LIBS =
+
+.c.o:
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(LOCAL_CFLAGS) $< -o $@
+
+
+default: depend library
+
+
+library: $(TOP)/$(LIB_DIR)/libgbm.so
+
+$(TOP)/$(LIB_DIR)/libgbm.so: $(OBJECTS) $(LOCAL_LIBS)
+ $(MKLIB) -o gbm -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+ -major 1 -minor 0 \
+ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
+ -L$(TOP)/$(LIB_DIR) $(GBM_LIB_DEPS) \
+ $(OBJECTS) $(LOCAL_LIBS)
+
+install-headers:
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/
+ $(INSTALL) -m 644 $(TOP)/src/gbm/main/gbm.h \
+ $(DESTDIR)$(INSTALL_INC_DIR)
+
+
+PKG_CONFIG_DIR = $(INSTALL_LIB_DIR)/pkgconfig
+
+gbm_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@,0.0.0,' \
+ -e 's,@GBM_PC_REQ_PRIV@,$(GBM_PC_REQ_PRIV),' \
+ -e 's,@GBM_PC_LIB_PRIV@,$(GBM_PC_LIB_PRIV),' \
+ -e 's,@GBM_PC_CFLAGS@,$(GBM_PC_CFLAGS),' \
+ -e 's,@GBM_LIB@,$(GBM_LIB),'
+
+gbm.pc: gbm.pc.in
+ $(gbm_pcedit) $< > $@
+
+install: default install-headers gbm.pc
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(MINSTALL) $(TOP)/$(LIB_DIR)/libgbm.so* \
+ $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(INSTALL) -d $(DESTDIR)$(PKG_CONFIG_DIR)
+ $(INSTALL) -m 644 gbm.pc $(DESTDIR)$(PKG_CONFIG_DIR)
+
+clean:
+ -rm -f *.o
+ -rm -f depend depend.bak
+ -rm -f gbm.pc
+
+
+depend: $(SOURCES) $(HEADERS)
+ @ echo "running $(MKDEP)"
+ @ rm -f depend
+ @ touch depend
+ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) \
+ $(SOURCES) $(HEADERS) > /dev/null 2>/dev/null
+
+
+-include depend
+# DO NOT DELETE