forked from alex-eg/sex
infra: pepper some GNU on top of Makefile
This commit is contained in:
13
Makefile
13
Makefile
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user