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
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
CPPFLAGS+=-I.
|
2016-12-07 19:26:41 +00:00
|
|
|
CPPFLAGS+=-DPREFIX='"$(PREFIX)"'
|
2016-12-25 14:38:26 +00:00
|
|
|
CPPFLAGS+=-DVERSION='"$(VERSION)"'
|
2016-12-07 19:26:41 +00:00
|
|
|
|
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
|
|
|
|
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
|
mescc: Run module/base-0.mes.
* gc.c: New file.
* vector.c: New file.
* mes.c: Remove vector and gc functions, include vector.c, gc.c.
* GNUmakefile (mes.o): Add gc, vector dependencies.
* scaffold/mini-mes.c (eval_apply): Support primitive-load through
read_input_file.
(getenv_, open_input_file, current_input_port,
set_current_input_port force_output, exit_, values, arity_, xassq,
is_p, minus, plus, divide, modulo multiply, logior, ash): New function.
(mes_symbols): Add symbols %gnuc, %mesc.
* scaffold/mini-mes.c (): New functions.
* scaffold/b-0.mes: New file.
* scaffold/t-0.mes: New file.
2017-03-26 19:13:01 +00:00
|
|
|
mes.o: gc.c gc.h gc.i gc.environment.i
|
|
|
|
mes.o: vector.c vector.h vector.i vector.environment.i
|
2016-07-09 21:12:25 +00:00
|
|
|
|
2016-10-12 21:40:11 +00:00
|
|
|
clean:
|
core+mini-mes: Replace manual snippets by snarfed includes.
* build-aux/mes-snarf.scm (symbol->source, function->header,
function->source, function->environment): Add workarounds to
avoid struct-copy initializers.
* GNUmakefile (mini-mes): Snarf symbols and functions.
* scaffold/mini-mes.c: Include mini-mes.h, mini-mes.symbols.h,
mini-mes.symbols.i, mini-mes.i, mini-mes.environment.i.
Add snarfable symbol/special definitions.
(type_t): Prefix all types with `T', update users.
(assert_defined, gc_push_frame, gc_peek_frame, gc_init_cells): Mark
as internal.
* mes.c (type_t): Prefix all types with `T', update users.
* scaffold/mini-mes.c (eq_p, type_, car_, cdr_,
list_of_char_equal_p, lookup_macro, write_byte): New functions (from
mes.c).
(assq): Add debugging, workaround.
2017-03-10 19:56:18 +00:00
|
|
|
rm -f mes *.o *.environment.i *.symbols.i *.environment.h *.cat a.out
|
2017-03-19 12:41:56 +00:00
|
|
|
rm -f mes-32
|
|
|
|
rm -f cons-mes m main micro-mes mini-mes t tiny-mes
|
|
|
|
rm -f guile-cons-mes guile-m guile-main guile-micro-mes guile-mini-mes guile-t guile-tiny-mes
|
|
|
|
rm -f module/mes/*.mo
|
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
|
|
|
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
check: all guile-check mes-check mescc-check
|
2016-10-08 06:38:29 +00:00
|
|
|
|
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\
|
|
|
|
tests/scm.test\
|
2016-12-24 10:10:11 +00:00
|
|
|
tests/display.test\
|
2016-11-02 08:40:58 +00:00
|
|
|
tests/cwv.test\
|
2017-04-02 09:34:40 +00:00
|
|
|
tests/math.test\
|
|
|
|
tests/vector.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\
|
2017-03-29 06:07:51 +00:00
|
|
|
tests/pmatch.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
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
|
|
|
|
mes-check-nyacc: all
|
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
|
|
|
|
core: Prepare gc.c for mescc, non-POSIX_SOURCE.
* mes.c (NLENGTH, NVALUE, NVECTOR): New macros.
(mes_builtins): Add comment on .i include order.
* module/language/c99/compiler.mes (mescc): Add define _POSIX_SOURCE=0.
* gc.c (gc_up_arena, gc_flip, gc_loop, gc)[!_POSIX_SOURCE]: Use eputs
rather than fprintf.
(gc_loop): Use CAR, TYPE, NVECTOR rather than .car, .type, .vector.
* gc.c (gc_up_arena)[!_POSIX_SOURCE]: Add non-POSIX mlib.c
implementation.
2017-03-26 13:55:12 +00:00
|
|
|
mes-32: gc.c lib.c math.c posix.c vector.c
|
2017-03-19 12:41:56 +00:00
|
|
|
mes-32: mes.c lib.c
|
2017-01-10 19:05:47 +00:00
|
|
|
rm -f mes mes.o
|
|
|
|
guix environment --system=i686-linux --ad-hoc gcc-toolchain -- bash -c 'make mes CC=i686-unknown-linux-gnu-gcc LIBRARY_PATH=$${PATH%%/bin:*}/lib'
|
2017-03-25 14:58:44 +00:00
|
|
|
rm -f mes.o
|
2017-01-10 19:05:47 +00:00
|
|
|
mv mes mes-32
|
|
|
|
|
2017-03-22 05:59:50 +00:00
|
|
|
module/mes/read-0-32.mo: module/mes/read-0.mes mes-32
|
2017-03-19 12:41:56 +00:00
|
|
|
MES_MINI=1 ./mes-32 --dump < $< > $@
|
|
|
|
|
|
|
|
module/mes/tiny-0-32.mo: module/mes/tiny-0.mes mes-32
|
|
|
|
MES_TINY=1 ./mes-32 --dump < $< > $@
|
2017-01-10 19:05:47 +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-calc.scm
|
2016-07-24 21:18:53 +00:00
|
|
|
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
t-check: t
|
|
|
|
./t
|
|
|
|
|
|
|
|
mescc-check: t-check
|
|
|
|
rm -f a.out
|
|
|
|
guile/mescc.scm scaffold/t.c > a.out
|
|
|
|
chmod +x a.out
|
|
|
|
./a.out
|
|
|
|
|
core+mini-mes: Replace manual snippets by snarfed includes.
* build-aux/mes-snarf.scm (symbol->source, function->header,
function->source, function->environment): Add workarounds to
avoid struct-copy initializers.
* GNUmakefile (mini-mes): Snarf symbols and functions.
* scaffold/mini-mes.c: Include mini-mes.h, mini-mes.symbols.h,
mini-mes.symbols.i, mini-mes.i, mini-mes.environment.i.
Add snarfable symbol/special definitions.
(type_t): Prefix all types with `T', update users.
(assert_defined, gc_push_frame, gc_peek_frame, gc_init_cells): Mark
as internal.
* mes.c (type_t): Prefix all types with `T', update users.
* scaffold/mini-mes.c (eq_p, type_, car_, cdr_,
list_of_char_equal_p, lookup_macro, write_byte): New functions (from
mes.c).
(assq): Add debugging, workaround.
2017-03-10 19:56:18 +00:00
|
|
|
%.h %.i %.environment.i %.symbols.i: scaffold/%.c build-aux/mes-snarf.scm
|
|
|
|
build-aux/mes-snarf.scm $<
|
|
|
|
|
|
|
|
mini-mes: mini-mes.h mini-mes.i mini-mes.environment.i mini-mes.symbols.i
|
2017-03-25 16:15:07 +00:00
|
|
|
mini-mes: vector.c
|
core: Prepare gc.c for mescc, non-POSIX_SOURCE.
* mes.c (NLENGTH, NVALUE, NVECTOR): New macros.
(mes_builtins): Add comment on .i include order.
* module/language/c99/compiler.mes (mescc): Add define _POSIX_SOURCE=0.
* gc.c (gc_up_arena, gc_flip, gc_loop, gc)[!_POSIX_SOURCE]: Use eputs
rather than fprintf.
(gc_loop): Use CAR, TYPE, NVECTOR rather than .car, .type, .vector.
* gc.c (gc_up_arena)[!_POSIX_SOURCE]: Add non-POSIX mlib.c
implementation.
2017-03-26 13:55:12 +00:00
|
|
|
mini-mes: gc.c
|
2017-03-19 12:41:56 +00:00
|
|
|
mini-mes: mlibc.c mstart.c
|
core+mini-mes: Replace manual snippets by snarfed includes.
* build-aux/mes-snarf.scm (symbol->source, function->header,
function->source, function->environment): Add workarounds to
avoid struct-copy initializers.
* GNUmakefile (mini-mes): Snarf symbols and functions.
* scaffold/mini-mes.c: Include mini-mes.h, mini-mes.symbols.h,
mini-mes.symbols.i, mini-mes.i, mini-mes.environment.i.
Add snarfable symbol/special definitions.
(type_t): Prefix all types with `T', update users.
(assert_defined, gc_push_frame, gc_peek_frame, gc_init_cells): Mark
as internal.
* mes.c (type_t): Prefix all types with `T', update users.
* scaffold/mini-mes.c (eq_p, type_, car_, cdr_,
list_of_char_equal_p, lookup_macro, write_byte): New functions (from
mes.c).
(assq): Add debugging, workaround.
2017-03-10 19:56:18 +00:00
|
|
|
mini-mes: GNUmakefile
|
2017-03-19 12:41:56 +00:00
|
|
|
mini-mes: module/mes/read-0-32.mo
|
|
|
|
mini-mes: scaffold/mini-mes.c
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
rm -f $@
|
2017-03-19 12:41:56 +00:00
|
|
|
# gcc -nostdlib --std=gnu99 -m32 -g -o $@ '-DPREFIX=' '-DVERSION='"$(VERSION)"' $<
|
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -g -I. -o $@ $(CPPFLAGS) $<
|
2017-03-25 14:58:44 +00:00
|
|
|
rm -f mes.o
|
2017-03-19 12:41:56 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
|
|
|
guile-mini-mes: mini-mes.h mini-mes.i mini-mes.environment.i mini-mes.symbols.i
|
2017-03-25 16:15:07 +00:00
|
|
|
guile-mini-mes: vector.c
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-mini-mes: module/mes/read-0-32.mo
|
|
|
|
guile-mini-mes: scaffold/mini-mes.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
cons-mes: module/mes/tiny-0-32.mo
|
2017-04-02 10:13:04 +00:00
|
|
|
cons-mes: scaffold/cons-mes.c GNUmakefile
|
|
|
|
rm -f $@
|
2017-04-02 10:29:09 +00:00
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -g -o $@ '-DVERSION="0.4"' $<
|
2017-04-02 10:13:04 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-cons-mes: module/mes/tiny-0-32.mo
|
|
|
|
guile-cons-mes: scaffold/cons-mes.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
|
|
|
tiny-mes: module/mes/tiny-0-32.mo
|
2017-04-02 10:10:38 +00:00
|
|
|
tiny-mes: scaffold/tiny-mes.c GNUmakefile
|
|
|
|
rm -f $@
|
2017-04-02 10:29:09 +00:00
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -g -o $@ '-DVERSION="0.4"' $<
|
2017-04-02 10:10:38 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-tiny-mes: module/mes/tiny-0-32.mo
|
|
|
|
guile-tiny-mes: scaffold/tiny-mes.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
2017-04-02 10:10:38 +00:00
|
|
|
m: scaffold/m.c GNUmakefile
|
|
|
|
rm -f $@
|
2017-04-02 10:29:09 +00:00
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -g -o $@ '-DVERSION="0.4"' $<
|
2017-04-02 10:10:38 +00:00
|
|
|
# gcc --std=gnu99 -g -o $@ '-DVERSION="0.4"' $<
|
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-m: scaffold/m.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
2017-04-02 10:31:15 +00:00
|
|
|
malloc: scaffold/malloc.c GNUmakefile
|
|
|
|
rm -f $@
|
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -g -o $@ '-DVERSION="0.4"' $<
|
|
|
|
chmod +x $@
|
|
|
|
|
|
|
|
guile-malloc: scaffold/malloc.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
micro-mes: scaffold/micro-mes.c GNUmakefile
|
|
|
|
rm -f $@
|
2017-04-02 10:29:09 +00:00
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -o $@ '-DVERSION="0.4"' $<
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-micro-mes: scaffold/micro-mes.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
main: doc/examples/main.c GNUmakefile
|
|
|
|
rm -f $@
|
2017-04-02 10:29:09 +00:00
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -o $@ '-DVERSION="0.4"' $<
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-main: doc/examples/main.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
|
|
|
t: mlibc.c
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
t: scaffold/t.c GNUmakefile
|
|
|
|
rm -f $@
|
2017-04-02 10:29:09 +00:00
|
|
|
gcc -nostdlib -I. --std=gnu99 -m32 -g -o $@ '-DVERSION="0.4"' $<
|
mescc: Beginning of expression and test template.
* scaffold/t.c: New file.
* GNUmakefile (mescc-check, t-check): New targets.
* module/language/c99/compiler.mes (write-any): Catch weirdness.
(make): Add <function> slot.
(.function): New accessor.
(clone): Handle it.
(function->info): Set it.
(ast->info): Make tests generic in if, for, while. Add goto, label,
!, ==, !=, -, &&.
* module/mes/elf-util.mes (lambda/label->list): New function.
(text->list): Use it.
(functions->text, function-prefix): New function.
(function-offset): Use it.
(label-offset): New function.
* module/mes/elf-util.scm (mes): Export them.
* module/mes/elf.mes (make-elf): Use text->list.
* module/mes/libc-i386.mes (eputs, puts): Remove.
(i386:byte-base-sub): Rename from sub-byte-base.
(i386:byte-jump-z): Rename from i386:Xjump-byte-z.
(i386:byte-mem->accu): Rename from i386:Xmem-byte->accu.
(i386:byte-mem->base): Rename from i386:Xmem-byte->base.
(i386:accu->local, i386:accu-non-zero?, i386:accu-zero?,
i386:base-sub, i386:byte-sub-base, i386:jump-c, i386:jump-cz,
i386:jump-nc, i386:jump-ncz, i386:byte-mem->base, i386:sub-base,
i386:test-accu, i386:test-base, i386:test-jump-z, i386:value->base,
i386:xor-zf): New functions.
2017-04-02 10:23:00 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-t: scaffold/t.c
|
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
2016-10-16 12:57:30 +00:00
|
|
|
MAIN_C:=doc/examples/main.c
|
2016-12-31 08:03:07 +00:00
|
|
|
mescc: all $(MAIN_C)
|
2016-12-17 09:57:38 +00:00
|
|
|
rm -f a.out
|
2016-12-31 08:03:07 +00:00
|
|
|
scripts/mescc.mes $(MAIN_C) > a.out
|
2016-12-17 09:57:38 +00:00
|
|
|
./a.out; r=$$?; [ $$r = 42 ]
|
2016-07-24 23:12:22 +00:00
|
|
|
|
2016-12-31 08:03:07 +00:00
|
|
|
guile-mescc: $(MAIN_C)
|
2016-12-17 09:57:38 +00:00
|
|
|
rm -f a.out
|
2016-12-31 08:03:07 +00:00
|
|
|
guile/mescc.scm $(MAIN_C) > 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"
|