infra: pepper some GNU on top of Makefile

This commit is contained in:
2025-10-31 15:57:55 +03:00
parent c1fd43c8f0
commit 731ccc7c6b
3 changed files with 36 additions and 1 deletions

View File

@@ -13,6 +13,15 @@ CSC_FLAGS += -K prefix -static
# -c: Stop after compilation to object files. This one is obvious.
CHICKEN_INSTALL = chicken-install
# GNU directory variables. Command line overrides, e.g.
# make prefix=$(HOME)/.local install
# make DESTDIR=/tmp/stage prefix=/usr install
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
MODULE_FLAGS = -emit-all-import-libraries -module-registration -c
# Order matters, since module check correctness on compilation
@@ -87,6 +96,18 @@ check-exit-code: sexc
run-tests: sexc sex-tests sextest
./sex-tests && ./sextest --sexc=./sexc $(SEX_TEST_PROGRAMS:%=./tests/sex-programs/%.sex) && $(MAKE) check-modules && $(MAKE) check-exit-code
install: all installdirs
$(INSTALL_PROGRAM) sexc $(DESTDIR)$(bindir)/sexc
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
installdirs:
$(INSTALL) -d $(DESTDIR)$(bindir)
uninstall:
rm -f $(DESTDIR)$(bindir)/sexc
run-tests: sex-tests
./sex-tests
@@ -104,4 +125,8 @@ clean:
rm -f sexc sex-tests sextest
$(MAKE) -C ./tests/modules clean
.PHONY: clean depclean deps run-tests sex-tests sextest check-modules check-exit-code
deps-clean:
rm -rf $(EGGS_DIR)
.PHONY: all check run-tests check-modules check-exit-code install install-strip installdirs
uninstall deps deps-update clean depsclean sex-tests sextest

View File

@@ -38,6 +38,14 @@ tree's ~.eggs~ path):
make CSC_FLAGS='-K prefix'
#+end_src
** Installation
#+begin_src sh
# default installation (/usr/local/bin/)
make install
# you can customize the prefix (will install to ~/.local/bin)
make prefix=~/.local install
#+end_src
* Usage
** Summary
#+begin_src

View File

@@ -46,3 +46,5 @@ clean:
rm -f *.import.scm
rm -f *.link
rm -f sex-tests
.PHONY: clean