2016-10-15 22:34:23 +00:00
|
|
|
.PHONY: all check clean default distclean help install release
|
|
|
|
default: all
|
|
|
|
|
|
|
|
.config.make: configure GNUmakefile
|
|
|
|
./configure
|
|
|
|
|
2016-12-17 09:57:38 +00:00
|
|
|
GUILE:=guile
|
|
|
|
export GUILE
|
2016-10-15 22:34:23 +00:00
|
|
|
OUT:=out
|
2016-11-21 08:36:32 +00:00
|
|
|
CFLAGS:=-std=c99 -O3 -finline-functions
|
2016-10-15 22:34:23 +00:00
|
|
|
#CFLAGS:=-std=c99 -O0
|
2016-10-12 19:14:06 +00:00
|
|
|
#CFLAGS:=-pg -std=c99 -O0
|
2016-11-21 08:36:32 +00:00
|
|
|
#CFLAGS:=-std=c99 -O0 -g
|
2016-07-27 06:49:45 +00:00
|
|
|
|
2016-12-07 19:26:41 +00:00
|
|
|
include .config.make
|
|
|
|
include make/install.make
|
|
|
|
|
|
|
|
CPPFLAGS+=-DPREFIX='"$(PREFIX)"'
|
|
|
|
|
2016-10-20 20:03:17 +00:00
|
|
|
export BOOT
|
|
|
|
ifneq ($(BOOT),)
|
2016-12-07 19:26:41 +00:00
|
|
|
CPPFLAGS+=-DBOOT=1
|
2016-10-20 20:03:17 +00:00
|
|
|
endif
|
|
|
|
|
2016-10-15 22:34:23 +00:00
|
|
|
-include .local.make
|
2016-05-15 22:07:44 +00:00
|
|
|
|
2016-12-07 19:26:41 +00:00
|
|
|
all: mes module/mes/read-0.mo
|
2016-05-15 22:07:44 +00:00
|
|
|
|
2016-12-07 19:26:41 +00:00
|
|
|
mes.o: GNUmakefile
|
Move optional type predicates to type.c.
* mes.c (char_p, macro_p, number_p, pair_p, string_p, symbol_p,
vector_p, builtin_p, boolean_p): Move to type.c
* type.c: New file.
* GNUmakefile (mes.o): Depend on type snarf output.
* module/mes/loop-0.mes (cond, map, let, or, and not, evlis-env,
apply-env, eval-expand, uquote, add-unquoters, eval,
expand-macro-env, eval-begin-env, eval-if-env, sexp:define,
env:define, env:macro): Move to mes-0.mes.
* module/mes/mes-0.mes: New file.
* module/mes/type-0.mes: New file.
* scripts/include.mes: If BOOT, also include mes-0.mes. If TYPE0,
also include type-0.mes.
2016-10-22 10:16:19 +00:00
|
|
|
mes.o: mes.c
|
2016-11-21 08:28:34 +00:00
|
|
|
mes.o: mes.c mes.h mes.i mes.environment.i mes.symbols.i
|
2016-11-21 08:36:32 +00:00
|
|
|
mes.o: display.c display.h display.i display.environment.i
|
2016-11-21 08:28:34 +00:00
|
|
|
mes.o: lib.c lib.h lib.i lib.environment.i
|
|
|
|
mes.o: math.c math.h math.i math.environment.i
|
|
|
|
mes.o: posix.c posix.h posix.i posix.environment.i
|
2016-11-21 08:36:32 +00:00
|
|
|
mes.o: reader.c reader.h reader.i reader.environment.i
|
2016-07-09 21:12:25 +00:00
|
|
|
|
2016-10-12 21:40:11 +00:00
|
|
|
clean:
|
2016-10-22 18:07:12 +00:00
|
|
|
rm -f mes mes.o *.environment.i *.symbols.i *.environment.h *.cat a.out
|
2016-10-12 21:40:11 +00:00
|
|
|
|
2016-10-15 22:34:23 +00:00
|
|
|
distclean: clean
|
|
|
|
rm -f .config.make
|
|
|
|
|
2016-11-21 08:28:34 +00:00
|
|
|
%.h %.i %.environment.i %.symbols.i: %.c build-aux/mes-snarf.scm
|
2016-10-21 20:44:50 +00:00
|
|
|
build-aux/mes-snarf.scm $<
|
2016-07-09 21:12:25 +00:00
|
|
|
|
2016-10-08 06:38:29 +00:00
|
|
|
check: all guile-check mes-check
|
|
|
|
|
2016-10-12 21:40:11 +00:00
|
|
|
TESTS:=\
|
2016-11-19 22:25:24 +00:00
|
|
|
tests/read.test\
|
2016-10-12 21:40:11 +00:00
|
|
|
tests/base.test\
|
|
|
|
tests/closure.test\
|
|
|
|
tests/quasiquote.test\
|
|
|
|
tests/let.test\
|
2016-10-21 08:51:09 +00:00
|
|
|
tests/vector.test\
|
2016-10-12 21:40:11 +00:00
|
|
|
tests/scm.test\
|
2016-11-02 08:40:58 +00:00
|
|
|
tests/cwv.test\
|
2016-12-20 09:44:43 +00:00
|
|
|
tests/srfi-1.test\
|
2016-12-11 20:26:27 +00:00
|
|
|
tests/srfi-13.test\
|
2016-12-20 11:26:20 +00:00
|
|
|
tests/srfi-14.test\
|
2016-12-16 22:34:08 +00:00
|
|
|
tests/optargs.test\
|
2016-12-17 13:51:45 +00:00
|
|
|
tests/fluids.test\
|
2016-12-17 21:21:46 +00:00
|
|
|
tests/catch.test\
|
2016-10-30 15:16:20 +00:00
|
|
|
tests/psyntax.test\
|
2016-11-10 09:20:47 +00:00
|
|
|
tests/let-syntax.test\
|
|
|
|
tests/record.test\
|
2016-10-12 21:40:11 +00:00
|
|
|
tests/match.test\
|
2016-12-22 19:16:44 +00:00
|
|
|
tests/peg.test\
|
2016-10-12 21:40:11 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
BASE-0:=module/mes/base-0.mes
|
|
|
|
MES-0:=guile/mes-0.scm
|
|
|
|
MES:=./mes
|
2016-11-19 22:25:24 +00:00
|
|
|
# use module/mes/read-0.mes rather than C-core reader
|
|
|
|
MES_FLAGS:=--load
|
|
|
|
export MES_FLAGS
|
2016-12-10 11:07:04 +00:00
|
|
|
MES_DEBUG:=1
|
2016-12-13 19:55:50 +00:00
|
|
|
#export MES_DEBUG
|
2016-07-09 11:23:58 +00:00
|
|
|
|
2016-10-12 21:40:11 +00:00
|
|
|
mes-check: all
|
2016-10-25 06:59:20 +00:00
|
|
|
set -e; for i in $(TESTS); do ./$$i; done
|
2016-12-18 14:44:09 +00:00
|
|
|
scripts/nyacc.mes
|
|
|
|
scripts/nyacc-calc.mes
|
2016-10-16 07:44:52 +00:00
|
|
|
|
2016-12-07 19:26:41 +00:00
|
|
|
module/mes/read-0.mo: module/mes/read-0.mes mes
|
|
|
|
./mes --dump < $< > $@
|
|
|
|
|
|
|
|
dump: module/mes/read-0.mo
|
2016-11-19 22:25:24 +00:00
|
|
|
|
2016-07-23 13:17:03 +00:00
|
|
|
guile-check:
|
2016-10-25 06:59:20 +00:00
|
|
|
set -e; for i in $(TESTS); do\
|
2016-12-21 16:08:36 +00:00
|
|
|
$(GUILE) -s <(cat $(MES-0) module/mes/test.mes $$i);\
|
2016-10-12 21:40:11 +00:00
|
|
|
done
|
2016-12-18 14:44:09 +00:00
|
|
|
guile/nyacc.scm
|
|
|
|
guile/nyacc-calc.scm
|
2016-07-24 21:18:53 +00:00
|
|
|
|
2016-10-16 12:57:30 +00:00
|
|
|
MAIN_C:=doc/examples/main.c
|
2016-07-24 23:12:22 +00:00
|
|
|
mescc: all
|
2016-12-17 09:57:38 +00:00
|
|
|
rm -f a.out
|
2016-10-16 12:57:30 +00:00
|
|
|
scripts/mescc.mes $(MAIN_C)
|
2016-12-17 09:57:38 +00:00
|
|
|
./a.out; r=$$?; [ $$r = 42 ]
|
2016-07-24 23:12:22 +00:00
|
|
|
|
2016-12-17 09:57:38 +00:00
|
|
|
mescc.cat: all $(MES-0) module/rnrs/bytevectors.mes module/mes/elf.mes module/mes/libc-i386.mes module/language/c/lexer.mes module/language/c/parser.mes module/language/c/compiler.mes
|
|
|
|
echo '(compile)' | cat $(filter %.scm %.mes, $^) - > $@
|
2016-07-24 21:18:53 +00:00
|
|
|
|
2016-10-10 21:24:44 +00:00
|
|
|
guile-mescc: mescc.cat
|
2016-12-17 09:57:38 +00:00
|
|
|
rm -f a.out
|
|
|
|
cat $(MAIN_C) | $(GUILE) -s $^ > a.out
|
2016-08-12 14:38:59 +00:00
|
|
|
chmod +x a.out
|
2016-12-17 09:57:38 +00:00
|
|
|
./a.out; r=$$?; [ $$r = 42 ]
|
2016-10-15 22:34:23 +00:00
|
|
|
|
2016-11-19 22:25:24 +00:00
|
|
|
paren: all
|
|
|
|
scripts/paren.mes
|
|
|
|
|
2016-12-22 18:49:41 +00:00
|
|
|
GUILE_GIT:=$(HOME)/src/guile-1.8
|
|
|
|
GUILE_COMMIT:=ba8a709
|
|
|
|
psyntax-import: module/mes/psyntax.ss module/mes/psyntax.pp
|
|
|
|
|
|
|
|
module/mes/psyntax.%: $(GUILE_GIT)/ice-9/psyntax.%
|
|
|
|
git --git-dir=$(GUILE_GIT)/.git --work-tree=$(GUILE_GIT) show $(GUILE_COMMIT):ice-9/$(@F > $@
|
2016-12-19 18:41:43 +00:00
|
|
|
|
2016-10-15 22:34:23 +00:00
|
|
|
help: help-top
|
|
|
|
|
|
|
|
install: all
|
|
|
|
|
|
|
|
release: all
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo
|
|
|
|
|
|
|
|
define HELP_TOP
|
|
|
|
Usage: make [OPTION]... [TARGET]...
|
|
|
|
|
|
|
|
Targets:
|
|
|
|
all update everything
|
|
|
|
check run unit tests
|
|
|
|
clean remove all generated stuff
|
|
|
|
dist create tarball in $(TARBALL)
|
|
|
|
distclean also clean configuration
|
|
|
|
mescc compile cc/main.c to a.out
|
|
|
|
install install in $$(PREFIX) [$(PREFIX)]
|
|
|
|
release make a release
|
2016-10-18 21:50:09 +00:00
|
|
|
update-hash update hash in guix.scm
|
2016-10-15 22:34:23 +00:00
|
|
|
endef
|
|
|
|
export HELP_TOP
|
|
|
|
help-top:
|
|
|
|
@echo "$$HELP_TOP"
|