2016-10-15 22:34:23 +00:00
|
|
|
.PHONY: all check clean default distclean help install release
|
|
|
|
default: all
|
|
|
|
|
|
|
|
.config.make: configure GNUmakefile
|
|
|
|
./configure
|
|
|
|
|
|
|
|
OUT:=out
|
2016-07-27 06:49:45 +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
|
|
|
|
#CFLAGS:=-std=c99 -O0 -g
|
2016-07-27 06:49:45 +00:00
|
|
|
|
2016-10-20 20:03:17 +00:00
|
|
|
export BOOT
|
|
|
|
ifneq ($(BOOT),)
|
|
|
|
CFLAGS+=-DBOOT=1
|
|
|
|
endif
|
|
|
|
|
2016-10-15 22:34:23 +00:00
|
|
|
include .config.make
|
|
|
|
-include .local.make
|
|
|
|
include make/install.make
|
|
|
|
|
2016-05-15 22:07:44 +00:00
|
|
|
|
2016-07-18 20:43:16 +00:00
|
|
|
all: mes
|
2016-05-15 22:07:44 +00:00
|
|
|
|
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
|
|
|
|
mes.o: mes.c mes.environment.h mes.environment.i mes.symbols.i
|
2016-10-22 17:36:54 +00:00
|
|
|
mes.o: define.c define.environment.h define.environment.i
|
2016-10-22 18:51:32 +00:00
|
|
|
mes.o: lib.c lib.environment.h lib.environment.i
|
2016-10-22 18:07:12 +00:00
|
|
|
mes.o: math.c math.environment.h math.environment.i
|
2016-10-22 17:26:12 +00:00
|
|
|
mes.o: quasiquote.c quasiquote.environment.h quasiquote.environment.i
|
2016-10-22 18:18:03 +00:00
|
|
|
mes.o: string.c string.environment.h string.environment.i
|
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: type.c type.environment.h type.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
|
|
|
|
|
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
|
|
|
%.environment.h %.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:=\
|
|
|
|
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-10-12 21:40:11 +00:00
|
|
|
tests/record.test\
|
|
|
|
tests/let-syntax.test\
|
2016-10-30 15:16:20 +00:00
|
|
|
tests/psyntax.test\
|
2016-10-12 21:40:11 +00:00
|
|
|
tests/match.test\
|
|
|
|
#
|
|
|
|
|
|
|
|
BASE-0:=module/mes/base-0.mes
|
|
|
|
MES-0:=guile/mes-0.scm
|
|
|
|
MES:=./mes
|
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-10-16 07:44:52 +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-10-30 15:16:20 +00:00
|
|
|
guile -s <(cat $(MES-0) $$(scripts/include.mes $$i | grep -Ev 'let.mes|quasiquote.mes|base-0|loop-0|psyntax-|srfi-0') $$i);\
|
2016-10-12 21:40:11 +00:00
|
|
|
done
|
2016-10-25 06:59:20 +00:00
|
|
|
set -e; for i in $(TESTS); do\
|
2016-10-12 21:40:11 +00:00
|
|
|
guile -s <(cat $(MES-0) module/mes/test.mes $$i);\
|
|
|
|
done
|
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-10-16 12:57:30 +00:00
|
|
|
scripts/mescc.mes $(MAIN_C)
|
2016-10-12 21:40:11 +00:00
|
|
|
./a.out
|
2016-07-24 23:12:22 +00:00
|
|
|
|
2016-10-12 21:40:11 +00:00
|
|
|
mescc.cat: $(MES-0) module/mes/lalr.mes module/mes/elf.mes module/mes/libc-i386.mes $(shell scripts/include.mes scripts/mescc.mes | grep -Ev '/mes/|/srfi/')
|
|
|
|
echo '(compile)' | cat $^ - > $@
|
2016-07-24 21:18:53 +00:00
|
|
|
|
2016-10-10 21:24:44 +00:00
|
|
|
guile-mescc: mescc.cat
|
2016-10-16 12:57:30 +00:00
|
|
|
cat $(MAIN_C) | guile -s $^ > a.out
|
2016-08-12 14:38:59 +00:00
|
|
|
chmod +x a.out
|
2016-10-12 21:40:11 +00:00
|
|
|
./a.out
|
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"
|