aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2021-12-07 23:45:11 +0100
committerJonas Bernoulli <jonas@bernoul.li>2021-12-07 23:45:11 +0100
commitc7834354f663ac9a9e6bbdc71947f8b2c36f8d65 (patch)
treee060761e23f613912b42a1754266f8e41bc78186
parenta0f3bb0d9c16bdaef7df8348c5d0d4748fb27f27 (diff)
make: Add check-declare target
It would be best to automatically run this after compiling, but for most people that would result in false-positives because of missing and entirely optional extensions but anyone can opt-in by adding "check-declare" to LISP_EXTRA_TARGETS in config.mk.
-rw-r--r--Makefile4
-rw-r--r--lisp/Makefile9
2 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 12a5381..0481f02 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,7 @@ help:
$(info make test - run tests)
$(info make test-interactive - run tests interactively)
$(info make emacs-Q - run emacs -Q plus Magit)
+ $(info make check-declare - check function declarations)
$(info )
$(info Release Management)
$(info ==================)
@@ -122,6 +123,9 @@ emacs-Q: clean-lisp
(require 'magit)\
(global-set-key \"\\C-xg\" 'magit-status))"
+check-declare:
+ @$(MAKE) -C lisp check-declare
+
## Clean #############################################################
clean: clean-lisp clean-docs clean-archives
diff --git a/lisp/Makefile b/lisp/Makefile
index 2a87e30..72dcc91 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -3,7 +3,7 @@ include ../default.mk
## ###################################################################
-.PHONY: magit-version.el install
+.PHONY: magit-version.el check-declare install
all: lisp
@@ -70,7 +70,7 @@ magit-obsolete.elc: magit.elc
## Build #############################################################
-lisp: $(ELCS) loaddefs
+lisp: $(ELCS) loaddefs $(LISP_EXTRA_TARGETS)
loaddefs: $(PKG)-autoloads.el
versionlib: $(PKG)-version.el
@@ -99,6 +99,11 @@ $(PKG)-version.el:
@printf "Generating $@\n"
@printf "%s" "$$VERSIONLIB_TMPL" > $@
+check-declare:
+ @printf "Checking function declarations\n"
+ @$(BATCH) -L $(TOP)../borg -L $(TOP)../forge/lisp \
+ --eval "(check-declare-directory default-directory)"
+
## Install ###########################################################
install: lisp versionlib