branch: elpa/emacsql
commit 65a942cabe165b02886a2d6d612dfa2ba01c26f4
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    Add default.mk
    
    For consistency with other packages I maintain.
---
 Makefile   | 51 +--------------------------------------------------
 default.mk | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 50 deletions(-)

diff --git a/Makefile b/Makefile
index 4f27a6d6b8d..2b35aa423da 100644
--- a/Makefile
+++ b/Makefile
@@ -1,43 +1,5 @@
 -include config.mk
-
-PKG = emacsql
-
-ELS   = $(PKG)-compiler.el
-ELS  += $(PKG).el
-ELS  += $(PKG)-sqlite.el
-ELS  += $(PKG)-sqlite-builtin.el
-ELS  += $(PKG)-sqlite-module.el
-ELS  += $(PKG)-mysql.el
-ELS  += $(PKG)-psql.el
-ELS  += $(PKG)-pg.el
-ELCS  = $(ELS:.el=.elc)
-
-TEST_ELS  = test/emacsql-compiler-tests.el
-TEST_ELS += test/emacsql-external-tests.el
-TEST_ELCS = $(TEST_ELS:.el=.elc)
-
-DEPS  = pg
-DEPS += peg
-DEPS += sqlite3
-
-LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
-LOAD_PATH += -L .
-LOAD_PATH += -L ./test
-
-ifdef NIX_PATH
-export SQLITE3_API_BUILD_COMMAND = nix-shell -p sqlite.dev --run "make all"
-endif
-
-ifeq ($(CI), true)
-# Workaround for bug#58252 on Emacs 28.x.
-override EMACS_ARGS += --eval "(setq byte-compile-docstring-max-column 120)"
-else
-EMACS_ARGS ?=
-endif
-
-EMACS       ?= emacs
-EMACS_Q_ARG ?= -Q
-EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH)
+include default.mk
 
 .PHONY: test stats
 
@@ -91,17 +53,6 @@ test: all $(TEST_ELCS)
        @$(EMACS_BATCH) -L tests \
        -l test/emacsql-external-tests.elc -f ert-run-tests-batch-and-exit
 
-ifeq ($(CI), true)
-override GITSTATS = ../_gitstats/gitstats
-endif
-GITSTATS      ?= gitstats
-GITSTATS_DIR  ?= stats
-GITSTATS_ARGS ?= -c style=https://magit.vc/assets/stats.css -c max_authors=999
-
-DOMAIN      ?= magit.vc
-CFRONT_DIST ?= E2LUHBKU1FBV02
-S3_BUCKET   ?= s3://$(DOMAIN)
-
 stats:
        @printf "Generating statistics\n"
        @$(GITSTATS) $(GITSTATS_ARGS) . $(GITSTATS_DIR)
diff --git a/default.mk b/default.mk
new file mode 100644
index 00000000000..6d806eaaab7
--- /dev/null
+++ b/default.mk
@@ -0,0 +1,51 @@
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))
+
+PKG = emacsql
+
+ELS   = $(PKG)-compiler.el
+ELS  += $(PKG).el
+ELS  += $(PKG)-sqlite.el
+ELS  += $(PKG)-sqlite-builtin.el
+ELS  += $(PKG)-sqlite-module.el
+ELS  += $(PKG)-mysql.el
+ELS  += $(PKG)-psql.el
+ELS  += $(PKG)-pg.el
+ELCS  = $(ELS:.el=.elc)
+
+TEST_ELS  = test/emacsql-compiler-tests.el
+TEST_ELS += test/emacsql-external-tests.el
+TEST_ELCS = $(TEST_ELS:.el=.elc)
+
+DEPS  = pg
+DEPS += peg
+DEPS += sqlite3
+
+LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
+LOAD_PATH += -L .
+LOAD_PATH += -L ./test
+
+ifdef NIX_PATH
+export SQLITE3_API_BUILD_COMMAND = nix-shell -p sqlite.dev --run "make all"
+endif
+
+ifeq ($(CI), true)
+# Workaround for bug#58252 on Emacs 28.x.
+override EMACS_ARGS += --eval "(setq byte-compile-docstring-max-column 120)"
+else
+EMACS_ARGS ?=
+endif
+
+EMACS       ?= emacs
+EMACS_Q_ARG ?= -Q
+EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH)
+
+ifeq ($(CI), true)
+override GITSTATS = ../_gitstats/gitstats
+endif
+GITSTATS      ?= gitstats
+GITSTATS_DIR  ?= stats
+GITSTATS_ARGS ?= -c style=https://magit.vc/assets/stats.css -c max_authors=999
+
+DOMAIN      ?= magit.vc
+CFRONT_DIST ?= E2LUHBKU1FBV02
+S3_BUCKET   ?= s3://$(DOMAIN)

Reply via email to