branch: elpa/emacsql commit e8c090e11f9e3be7fd9aa24159abe5082c8a73cb Author: Christopher Wellons <well...@nullprogram.com> Commit: Christopher Wellons <well...@nullprogram.com>
Improve Makefile portability and dump Cask --- Makefile | 24 +++++++++++++++--------- sqlite/Makefile | 29 ++++++++++------------------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 2341f0b409..c8eb4c9d1c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,18 @@ +# Clone the two dependencies of this package in sibling directories: +# $ cd .. +# $ git clone https://github.com/cbbrowne/pg.el pg +# $ git clone https://github.com/skeeto/elisp-finalize finalize +# $ cd - +# $ make +# +# Or set LDFLAGS to point at these packages elsewhere: +# $ make LDFLAGS='-L path/to/finalize -L path/to/pg' + +.POSIX: +.SUFFIXES: .el .elc EMACS = emacs -CASK = cask -BATCH = $(CASK) exec $(EMACS) -batch -Q -L . -L tests +LDFLAGS = -L ../finalize -L ../pg +BATCH = $(EMACS) -batch -Q -L . -L tests $(LDFLAGS) EL = emacsql-compiler.el \ emacsql-system.el \ @@ -19,14 +31,10 @@ EXTRA_DIST = README.md UNLICENSE all: test -.cask: Cask - cask install - touch .cask - binary: $(MAKE) -C sqlite -compile: .cask $(ELC) +compile: $(ELC) package: emacsql-$(VERSION).tar @@ -40,7 +48,5 @@ distclean: clean rm -f bin/* $(MAKE) -C sqlite clean -.SUFFIXES: .el .elc - .el.elc: $(BATCH) -f batch-byte-compile $< diff --git a/sqlite/Makefile b/sqlite/Makefile index 75a3002c8c..0d16da08a9 100644 --- a/sqlite/Makefile +++ b/sqlite/Makefile @@ -1,31 +1,22 @@ +.POSIX: EMACS = emacs +BINARY = emacsql-sqlite GETTUPLE = -l ../emacsql-system.el -f emacsql-system-print-tuple -OSTUPLE = $(shell $(EMACS) -Q -batch $(GETTUPLE)) -BINARY = emacsql-sqlite-$(OSTUPLE) - -ifneq (,$(findstring windows, $(OSTUPLE))) - ## Windows - BINARY := $(BINARY).exe -else - ## Unix-like - LDLIBS = -ldl -endif - -CFLAGS = -O2 -W -Wall -Wextra \ +SUFFIX = $$($(EMACS) -Q -batch $(GETTUPLE)) +LDLIBS = -ldl +CFLAGS = -O2 -W -Wall -Wextra \ -DSQLITE_THREADSAFE=0 \ -DSQLITE_DEFAULT_FOREIGN_KEYS=1 \ -DSQLITE_ENABLE_FTS4 \ -DSQLITE_ENABLE_FTS3_PARENTHESIS \ -DSQLITE_SOUNDEX -install: ../bin/$(BINARY) +emacsql-sqlite: emacsql.c sqlite3.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ emacsql.c sqlite3.c $(LDLIBS) -../bin/$(BINARY): $(BINARY) +install: emacsql-sqlite mkdir -p ../bin/ - cp $< ../bin/ - -$(BINARY): emacsql.o sqlite3.o - $(CC) $(LDLIBS) $(LDFLAGS) -o $@ $^ + cp emacsql-sqlite ../bin/emacsql-sqlite-$(SUFFIX) clean: - rm -f *.o $(BINARY) emacsql-sqlite-* ../bin/$(BINARY) + rm -f emacsql-sqlite ../bin/emacsql-sqlite-$(SUFFIX)