pkglib_LTLIBRARIES = libmdb.la
+LINKER_SCRIPT = linker-script.mdb
+
libmdb_la_CFLAGS = -I../include
-libmdb_la_SOURCES = ../include/murphy-db/assert.h \
- ../include/murphy-db/list.h \
- ../include/murphy-db/handle.h \
- ../include/murphy-db/hash.h \
- ../include/murphy-db/sequence.h \
- ../include/murphy-db/mqi-types.h \
- ../include/murphy-db/mdb.h \
- list.h handle.c hash.c sequence.c mqi-types.c \
- column.h column.c \
- cond.h cond.c \
- index.h index.c \
- log.h log.c \
- row.h row.c \
- table.h table.c \
- transaction.h transaction.c \
- trigger.h trigger.c
+libmdb_ladir = \
+ $(includedir)/murphy-db
+
+libmdb_la_HEADERS = \
+ ../include/murphy-db/assert.h \
+ ../include/murphy-db/list.h \
+ ../include/murphy-db/handle.h \
+ ../include/murphy-db/hash.h \
+ ../include/murphy-db/sequence.h \
+ ../include/murphy-db/mqi-types.h \
+ ../include/murphy-db/mdb.h
+
+libmdb_la_SOURCES = \
+ $(libmdb_la_HEADERS) \
+ list.h handle.c hash.c sequence.c mqi-types.c \
+ column.h column.c \
+ cond.h cond.c \
+ index.h index.c \
+ log.h log.c \
+ row.h row.c \
+ table.h table.c \
+ transaction.h transaction.c \
+ trigger.h trigger.c
+
+libmdb_la_LDFLAGS = \
+ -Wl,-version-script=$(LINKER_SCRIPT)
+# -version-info @MURPHYDB_VERSION_INFO@
+
+libmdb_la_DEPENDENCIES = $(LINKER_SCRIPT)
+
+# linker script generation
+$(LINKER_SCRIPT): $(libmdb_la_HEADERS)
+ $(top_builddir)/build-aux/gen-linker-script -p "^(mdb_)|(mqi_)" -o $@ $^
+
+clean-$(LINKER_SCRIPT):
+ -rm -f $(LINKER_SCRIPT)
+
+# cleanup
+clean-local:: clean-$(LINKER_SCRIPT)
+ -rm -f *~
pkglib_LTLIBRARIES = libmqi.la
+LINKER_SCRIPT = linker-script.mqi
+
libmqi_la_CFLAGS = -I../include
-libmqi_la_SOURCES = ../include/murphy-db/mqi.h \
- mqi.c db.h mdb-backend.h mdb-backend.c
+libmqi_ladir = \
+ $(includedir)/murphy-db
+
+libmqi_la_HEADERS = \
+ ../include/murphy-db/mqi.h
+
+libmqi_la_SOURCES = \
+ $(libmqi_ls_HEADERS) \
+ mqi.c db.h mdb-backend.h mdb-backend.c
+
+libmqi_la_LDFLAGS = \
+ -Wl,-version-script=$(LINKER_SCRIPT)
+# -version-info @MURPHYDB_VERSION_INFO@
+
+libmqi_la_DEPENDENCIES = $(LINKER_SCRIPT)
+
+# linker script generation
+$(LINKER_SCRIPT): $(libmqi_la_HEADERS)
+ $(top_builddir)/build-aux/gen-linker-script -p "^mqi_" -o $@ $^
+
+clean-$(LINKER_SCRIPT):
+ -rm -f $(LINKER_SCRIPT)
+# cleanup
+clean-local:: clean-$(LINKER_SCRIPT)
+ rm -f *~
AM_YFLAGS = -p $(PARSER_PREFIX)
LEX_OUTPUT_ROOT = ./lex.$(PARSER_PREFIX)
+LINKER_SCRIPT = linker-script.mql
libmql_la_CFLAGS = -I../include
-libmql_la_SOURCES = ../include/murphy-db/mql.h \
- ../include/murphy-db/mql-statement.h \
- ../include/murphy-db/mql-result.h \
- ../include/murphy-db/mql-trigger.h \
- mql-scanner.l mql-parser.y \
- statement.c result.c trigger.c transaction.c
+libmql_ladir = \
+ $(includedir)/murphy-db
+
+libmql_la_HEADERS = \
+ ../include/murphy-db/mql.h \
+ ../include/murphy-db/mql-statement.h \
+ ../include/murphy-db/mql-result.h \
+ ../include/murphy-db/mql-trigger.h
+
+libmql_la_SOURCES = \
+ $(libmql_la_HEADERS) \
+ mql-scanner.l mql-parser.y \
+ statement.c result.c trigger.c transaction.c
+
+libmql_la_LDFLAGS = \
+ -Wl,-version-script=$(LINKER_SCRIPT)
+# -version-info @MURPHYDB_VERSION_INFO@
+
+libmql_la_DEPENDENCIES = $(LINKER_SCRIPT)
+
mql-parser.h mql-parser.c: mql-parser.y
$(YACCCOMPILE) $<
$(LEXCOMPILE) $<
mv lex.$(PARSER_PREFIX).c $@
+clean-parser:
+ -rm -f mql-parser.[hc] *.tab.[hc]
+
+clean-scanner:
+ -rm -f mql-scanner.c
+
+# linker script generation
+$(LINKER_SCRIPT): $(libmql_la_HEADERS)
+ $(top_builddir)/build-aux/gen-linker-script -p "^mql_" -o $@ $^
+
+clean-$(LINKER_SCRIPT):
+ -rm -f $(LINKER_SCRIPT)
-clean-local::
- rm -f *~ mql-scanner.c mql-parser.[hc] *.tab.[hc]
+# cleanup
+clean-local:: clean-parser clean-scanner clean-$(LINKER_SCRIPT)
+ rm -f *~