1
0
forked from alex-eg/sex

infra: pepper some GNU on top of Makefile

This commit is contained in:
2025-10-31 15:57:55 +03:00
parent 37ec122054
commit 7c0b511aeb
2 changed files with 21 additions and 0 deletions

View File

@@ -2,6 +2,10 @@ CHICKEN_C = csc
CSC_FLAGS += -K prefix
CHICKEN_INSTALL = chicken-install
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
MODULES = sexc fmt-c fmt-c-writer semen sex-macros sex-modules sex-reader utils
OBJ = $(MODULES:%=%.o)
@@ -26,6 +30,15 @@ main.o: main.scm
%.o: %.scm
$(CHICKEN_C) $(CSC_FLAGS) $< -e -c -o $@
install: sexc installdirs
install -m 755 ./sexc $(bindir)
installdirs:
mkdir -pv $(bindir)
uninstall:
rm -fv $(bindir)/sexc
sex-tests: $(OBJ) tests/*.scm
cd ./tests && $(CHICKEN_C) $(CSC_FLAGS) run.scm -c -o sex-tests.o
$(CHICKEN_C) $(CSC_FLAGS) $(OBJ) ./tests/sex-tests.o -o sex-tests

View File

@@ -32,6 +32,14 @@ If you want to make a self-contained binary, you'll need `chicken` with `libchic
CSC_FLAGS=-static make
#+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