forked from alex-eg/sex
Compare commits
4 Commits
ca71ae6e91
...
pkulev/fea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c0b511aeb | ||
|
|
37ec122054 | ||
|
|
601b687d1b | ||
|
|
e0803e4c3d |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,3 +1,8 @@
|
||||
*.o
|
||||
# Chicken dependencies
|
||||
/.eggs
|
||||
/.eggs.lock
|
||||
|
||||
# Compilation artifacts
|
||||
sexc
|
||||
sex-tests
|
||||
*.o
|
||||
|
||||
41
Makefile
41
Makefile
@@ -1,9 +1,26 @@
|
||||
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)
|
||||
|
||||
DEPSFILE = dependencies.txt
|
||||
DEPSLOCK = .eggs.lock
|
||||
|
||||
DEPENDENCIES = $(shell cat $(DEPSFILE))
|
||||
CHICKEN_EXTERNAL_REPOSITORY := $(shell chicken-install -repository)
|
||||
|
||||
export CHICKEN_EGG_CACHE=$(abspath .eggs)/cache
|
||||
export CHICKEN_REPOSITORY_PATH=$(abspath .eggs):$(CHICKEN_EXTERNAL_REPOSITORY)
|
||||
export CHICKEN_INSTALL_REPOSITORY=$(abspath .eggs)
|
||||
|
||||
all: sexc
|
||||
|
||||
sexc: main.o $(OBJ)
|
||||
$(CHICKEN_C) $(CSC_FLAGS) $^ -o $@
|
||||
|
||||
@@ -13,9 +30,33 @@ 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
|
||||
|
||||
run-tests: sex-tests
|
||||
./sex-tests
|
||||
|
||||
.eggs.lock: $(DEPSFILE)
|
||||
env | grep CHICKEN
|
||||
$(CHICKEN_INSTALL) $(DEPENDENCIES)
|
||||
touch $(DEPSLOCK)
|
||||
|
||||
deps: $(DEPSLOCK)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) sexc sex-tests main.o ./tests/sex-tests.o
|
||||
|
||||
depclean:
|
||||
rm -rf .eggs $(DEPSLOCK)
|
||||
|
||||
.PHONY: all deps depclean clean
|
||||
|
||||
19
Readme.org
19
Readme.org
@@ -21,7 +21,24 @@ https://wiki.call-cc.org/man/5/Extension%20tools#changing-the-repository-locatio
|
||||
~chicken-install `cat dependencies.txt`~
|
||||
|
||||
** Compilation
|
||||
~make~
|
||||
#+begin_src sh
|
||||
make
|
||||
#+end_src
|
||||
|
||||
** Static compilation
|
||||
If you want to make a self-contained binary, you'll need `chicken` with `libchicken.a` installed.
|
||||
|
||||
#+begin_src sh
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user