Compare commits
4 Commits
63801b47b2
...
ca71ae6e91
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca71ae6e91 | ||
|
|
0256aa8a22 | ||
|
|
c0a34fc64c | ||
|
|
94c4a7008f |
@@ -57,20 +57,9 @@ jobs:
|
||||
hash -r
|
||||
csc -version
|
||||
|
||||
- name: Install eggs
|
||||
run: |
|
||||
set -eu
|
||||
mkdir -p .eggs
|
||||
repo="$(chicken-install -repository)"
|
||||
echo "CHICKEN_INSTALL_REPOSITORY=${PWD}/.eggs" >> "$GITHUB_ENV"
|
||||
echo "CHICKEN_REPOSITORY_PATH=${PWD}/.eggs:${repo}" >> "$GITHUB_ENV"
|
||||
export CHICKEN_INSTALL_REPOSITORY="${PWD}/.eggs"
|
||||
export CHICKEN_REPOSITORY_PATH="${PWD}/.eggs:${repo}"
|
||||
# shellcheck disable=SC2046
|
||||
chicken-install $(cat dependencies.txt)
|
||||
|
||||
# Eggs are pinned in eggs.lock and installed by the Makefile into .eggs/.
|
||||
- name: Build sexc
|
||||
run: make sexc && ./sexc --help
|
||||
run: make && ./sexc --help
|
||||
|
||||
- name: Run tests
|
||||
run: make run-tests
|
||||
run: make check
|
||||
|
||||
20
Makefile
20
Makefile
@@ -14,6 +14,15 @@ CSC_FLAGS += -K prefix -static
|
||||
# error.
|
||||
# -c: Stop after compilation to object files. This one is obvious.
|
||||
|
||||
# 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
|
||||
@@ -91,7 +100,7 @@ check-modules: sexc
|
||||
check-exit-code: sexc
|
||||
@$(MAKE) --no-print-directory -C ./tests/exit-code check SEXC=../../sexc
|
||||
|
||||
run-tests: sexc sex-tests sextest
|
||||
check 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
|
||||
@@ -129,6 +138,13 @@ clean:
|
||||
rm -f *.import.scm
|
||||
rm -f *.link
|
||||
rm -f sexc sex-tests sextest
|
||||
$(MAKE) -C ./tests clean
|
||||
$(MAKE) -C ./tests/modules clean
|
||||
$(MAKE) -C ./tools/sextest 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 deps-clean clean sex-tests sextest
|
||||
|
||||
29
Readme.org
29
Readme.org
@@ -12,19 +12,22 @@ Sex is statically typed, compiled general purpose language.
|
||||
First, get yourself a Chicken, then, some Chicken deps. You also will
|
||||
need a C compiler.
|
||||
|
||||
** Install Chicken Eggs
|
||||
Tip: there's a way to make Chicken install eggs non-globally. You need
|
||||
to export ~CHICKEN_INSTALL_REPOSITORY~ and ~CHICKEN_REPOSITORY_PATH~
|
||||
environment variables. Refer to the documentation for more info:
|
||||
https://wiki.call-cc.org/man/5/Extension%20tools#changing-the-repository-location
|
||||
|
||||
~chicken-install `cat dependencies.txt`~
|
||||
Eggs are installed into a project-local ~.eggs/~ repository; they do not
|
||||
touch the Chicken system repository.
|
||||
|
||||
** Compilation
|
||||
#+begin_src sh
|
||||
make
|
||||
#+end_src
|
||||
|
||||
That installs pinned eggs from ~eggs.lock~ into ~.eggs/~ if needed, then
|
||||
builds ~sexc~. ~dependencies.txt~ is the unpinned request list. To
|
||||
refresh ~eggs.lock~ after changing it:
|
||||
|
||||
#+begin_src sh
|
||||
make deps-update
|
||||
#+end_src
|
||||
|
||||
** Static compilation
|
||||
The default ~CSC_FLAGS~ include ~-static~, so ~sexc~ does not need
|
||||
~.eggs~ at runtime and ~make install~ stays relocatable. Chicken must
|
||||
@@ -38,6 +41,18 @@ tree's ~.eggs~ path):
|
||||
make CSC_FLAGS='-K prefix'
|
||||
#+end_src
|
||||
|
||||
** Installation
|
||||
GNU directory variables: ~prefix~, ~exec_prefix~, ~bindir~, ~DESTDIR~.
|
||||
|
||||
#+begin_src sh
|
||||
# default installation (/usr/local/bin/)
|
||||
make install
|
||||
# customize the prefix (installs to ~/.local/bin)
|
||||
make prefix=$(HOME)/.local install
|
||||
# staged install for packaging
|
||||
make DESTDIR=/tmp/stage prefix=/usr install
|
||||
#+end_src
|
||||
|
||||
* Usage
|
||||
** Summary
|
||||
#+begin_src
|
||||
|
||||
8
eggs.lock
Normal file
8
eggs.lock
Normal file
@@ -0,0 +1,8 @@
|
||||
(brev-separate "1.100")
|
||||
(fmt "0.8.14")
|
||||
(getopt-long "4.0")
|
||||
(matchable "1.2")
|
||||
(srfi-1 "0.5.1")
|
||||
(srfi-13 "0.3.8")
|
||||
(srfi-69 "0.5.3")
|
||||
(test "1.3")
|
||||
@@ -46,3 +46,5 @@ clean:
|
||||
rm -f *.import.scm
|
||||
rm -f *.link
|
||||
rm -f sex-tests
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
Reference in New Issue
Block a user