[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql d3d76ea72a 409/427: make: Use essentially same Mak
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql d3d76ea72a 409/427: make: Use essentially same Makefile as for other packages I maintain |
Date: |
Tue, 13 Dec 2022 03:00:23 -0500 (EST) |
branch: elpa/emacsql
commit d3d76ea72a80be03def8cc4570b8ff14f4197b1d
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
make: Use essentially same Makefile as for other packages I maintain
I wasn't going to do that now, but then I noticed that the old
Makefile failed to recompile an Elisp library when it was modified.
---
Makefile | 93 +++++++++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 65 insertions(+), 28 deletions(-)
diff --git a/Makefile b/Makefile
index e13a3f82bf..b1f1b4a00b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,43 +6,80 @@
# Or set LOAD_PATH to point at these packages elsewhere:
# $ make LOAD_PATH='-L path/to/pg'
-.POSIX:
-.SUFFIXES: .el .elc
-EMACS ?= emacs
-LOAD_PATH ?= -L ../pg
-BATCH = $(EMACS) -batch -Q -L . -L tests $(LOAD_PATH)
-
-EL = emacsql-compiler.el \
- emacsql.el \
- emacsql-sqlite.el \
- emacsql-psql.el \
- emacsql-mysql.el \
- emacsql-pg.el
-ELC = $(EL:.el=.elc)
-TEST_EL = \
- tests/emacsql-compiler-tests.el \
- tests/emacsql-external-tests.el \
- tests/emacsql-tests.el
-TEST_ELC = $(TEST_EL:.el=.elc)
-EXTRA_DIST = README.md UNLICENSE
-
-all: test
+PKG = emacsql
+
+ELS = $(PKG)-compiler.el
+ELS += $(PKG).el
+ELS += $(PKG)-mysql.el
+ELS += $(PKG)-pg.el
+ELS += $(PKG)-psql.el
+ELS += $(PKG)-sqlite.el
+ELCS = $(ELS:.el=.elc)
+
+TEST_ELS = tests/emacsql-compiler-tests.el
+TEST_ELS += tests/emacsql-external-tests.el
+TEST_ELS += tests/emacsql-tests.el
+TEST_ELCS = $(TEST_ELS:.el=.elc)
+
+DEPS = pg
+
+EMACS ?= emacs
+EMACS_ARGS ?=
+
+LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
+LOAD_PATH += -L .
+
+all: binary lisp
+
+help:
+ $(info make all - generate binary, byte-code and autoloads)
+ $(info make binary - generate binary)
+ $(info make lisp - generate byte-code and autoloads)
+ $(info make test - run tests)
+ $(info make clean - remove byte-code and autoloads)
+ $(info make distclean - remove binary, byte-code and autoloads)
+ @printf "\n"
binary: sqlite/emacsql-sqlite
sqlite/emacsql-sqlite:
$(MAKE) -C sqlite
-compile: binary $(ELC)
+lisp: $(ELCS) loaddefs check-declare
+
+loaddefs: $(PKG)-autoloads.el
+
+%.elc: %.el
+ @printf "Compiling $<\n"
+ @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<
-check: test
-test: compile $(TEST_ELC)
- $(BATCH) -l tests/emacsql-tests.elc -f ert-run-tests-batch
+check-declare:
+ @printf " Checking function declarations\n"
+ @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
+ --eval "(check-declare-directory default-directory)"
+
+CLEAN = $(ELCS) $(PKG)-autoloads.el
clean:
- rm -f $(ELC) $(TEST_ELC)
+ @printf " Cleaning...\n"
+ @rm -rf $(CLEAN)
distclean: clean
$(MAKE) -C sqlite clean
-.el.elc:
- $(BATCH) -f batch-byte-compile $<
+$(PKG)-autoloads.el: $(ELS)
+ @printf " Creating $@\n"
+ @$(EMACS) -Q --batch -l autoload -l cl-lib --eval "\
+(let ((file (expand-file-name \"$@\"))\
+ (autoload-timestamps nil) \
+ (backup-inhibited t)\
+ (version-control 'never)\
+ (coding-system-for-write 'utf-8-emacs-unix))\
+ (write-region (autoload-rubric file \"package\" nil) nil file nil 'silent)\
+ (cl-letf (((symbol-function 'progress-reporter-do-update) (lambda (&rest
_)))\
+ ((symbol-function 'progress-reporter-done) (lambda (_))))\
+ (let ((generated-autoload-file file))\
+ (update-directory-autoloads default-directory))))"
+
+test: all $(TEST_ELCS)
+ @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
+ -L tests -l tests/emacsql-tests.elc -f ert-run-tests-batch
- [nongnu] elpa/emacsql 9dca599616 383/427: Fix whitespace, (continued)
- [nongnu] elpa/emacsql 9dca599616 383/427: Fix whitespace, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 2fa32d2ab7 395/427: Create new log buffer if existing one isn't live anymore, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 374726060d 385/427: Fix buffer struct allocation size (fixes #91), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d5c37d905d 379/427: Put emacs-version in path for out-of-package binary, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1ce92a6f4a 397/427: No longer require emacsql-psql in emacsql-pg, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d03c1a606f 392/427: Include optional .config.mk in Makefile, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6622516e15 393/427: Update library headers, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b405d99aed 408/427: make: Don't use LDFLAGS to set Emacs load-path, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b907279bab 418/427: Fix docstring of emacsql-sqlite-condition-alist, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 9ee397b2be 413/427: Whitespace cosmetics, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d3d76ea72a 409/427: make: Use essentially same Makefile as for other packages I maintain,
ELPA Syncer <=
- [nongnu] elpa/emacsql b4d5ef41fe 410/427: make: Don't require pg.el to be available to build and test, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5818000c7d 412/427: make: Update pg repository url, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0da3f06e89 416/427: Fix docstring typo, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 20cdad6fe6 417/427: Include sqlite error code in error data, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 1becb00945 419/427: Define a few constants as such, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 40c41d0d97 421/427: Release version 3.1.0, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql bfbd0c3a73 422/427: Resume development, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5c4aa1030b 415/427: Do not warn about missing pg functions, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql be95788334 214/427: Use global timeout in tests., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 944de63e9d 298/427: Add functions to fix vector indentation., ELPA Syncer, 2022/12/13