2017-04-02 16:50:07 +00:00
|
|
|
SHELL:=bash
|
|
|
|
|
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-04-02 16:50:07 +00:00
|
|
|
MACHINE:=$(shell $(CC) -dumpmachine)
|
|
|
|
##CC:=gcc
|
|
|
|
LIBRARY_PATH=:$(dir $(shell type -p ldd))../lib
|
|
|
|
CC:=LIBRARY_PATH=$(LIBRARY_PATH) gcc
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
CPPFLAGS+=-I.
|
2017-04-02 16:50:07 +00:00
|
|
|
CPPFLAGS+=-DDATADIR='"$(DATADIR)/"'
|
|
|
|
CPPFLAGS+=-DDOCDIR='"$(DOCDIR)/"'
|
|
|
|
CPPFLAGS+=-DMODULEDIR='"$(MODULEDIR)/"'
|
|
|
|
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
|
|
|
|
2017-04-02 15:01:22 +00:00
|
|
|
all: mes module/mes/read-0.mo module/mes/read-0-32.mo
|
|
|
|
|
2017-04-02 16:50:07 +00:00
|
|
|
ifeq ($(MES_BOOTSTRAP),mes-mini-mes)
|
|
|
|
all: mes-mini-mes
|
|
|
|
endif
|
|
|
|
|
2017-04-02 15:01:22 +00:00
|
|
|
S:=
|
|
|
|
mes.o$(S): GNUmakefile
|
|
|
|
mes.o$(S): mes.c
|
|
|
|
mes.o$(S): mes.c mes.h mes.i mes.environment.i mes.symbols.i
|
|
|
|
mes.o$(S): lib.c lib.h lib.i lib.environment.i
|
|
|
|
mes.o$(S): math.c math.h math.i math.environment.i
|
|
|
|
mes.o$(S): posix.c posix.h posix.i posix.environment.i
|
|
|
|
mes.o$(S): reader.c reader.h reader.i reader.environment.i
|
|
|
|
mes.o$(S): gc.c gc.h gc.i gc.environment.i
|
|
|
|
mes.o$(S): 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:
|
2017-04-02 15:01:22 +00:00
|
|
|
rm -f mes *.o *.o-32 *.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\
|
2017-04-01 10:51:35 +00:00
|
|
|
tests/guile.test\
|
2016-11-10 09:20:47 +00:00
|
|
|
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
|
|
|
|
2017-04-02 16:50:07 +00:00
|
|
|
export C_INCLUDE_PATH
|
|
|
|
|
2016-10-12 21:40:11 +00:00
|
|
|
mes-check: all
|
2017-04-02 16:50:07 +00:00
|
|
|
set -e; for i in $(TESTS); do MES_MAX_ARENA=20000000 ./$$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
|
|
|
|
2017-04-02 15:01:22 +00:00
|
|
|
mini-mes-check: all mini-mes
|
|
|
|
$(MAKE) mes-check MES=./mini-mes
|
2016-10-16 07:44:52 +00:00
|
|
|
|
2017-04-02 16:50:07 +00:00
|
|
|
module/mes/read-0.mo: module/mes/read-0.mes mes
|
|
|
|
rm -f $@
|
2016-12-07 19:26:41 +00:00
|
|
|
./mes --dump < $< > $@
|
|
|
|
|
|
|
|
dump: module/mes/read-0.mo
|
2016-11-19 22:25:24 +00:00
|
|
|
|
2017-04-02 15:01:22 +00:00
|
|
|
mes.o$(S): mes.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
mes$(S): mes.o$(S)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
|
|
|
|
|
2017-04-02 16:50:07 +00:00
|
|
|
ifeq ($(MACHINE),i686-unknown-linux-gnu)
|
|
|
|
mes-32: mes
|
|
|
|
ln -f $< $@
|
|
|
|
else
|
2017-04-02 15:01:22 +00:00
|
|
|
mes$(S)-32: GNUmakefile
|
|
|
|
mes$(S)-32: mes.c gc.c lib.c math.c posix.c vector.c
|
|
|
|
guix environment --system=i686-linux --ad-hoc gcc-toolchain -- bash -c 'make mes-32 S=-32 CC=i686-unknown-linux-gnu-gcc LIBRARY_PATH=$${PATH%%/bin:*}/lib'
|
2017-04-02 16:50:07 +00:00
|
|
|
endif
|
2017-01-10 19:05:47 +00:00
|
|
|
|
2017-04-02 15:01:22 +00:00
|
|
|
module/mes/read-0-32.mo: module/mes/read-0.mes
|
|
|
|
module/mes/read-0-32.mo: module/mes/read-0.mo
|
|
|
|
module/mes/read-0-32.mo: mes-32
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
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
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
2017-03-19 12:41:56 +00:00
|
|
|
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-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
|
|
|
|
|
2017-04-02 15:01:22 +00:00
|
|
|
%.h %.i %.environment.i %.symbols.i: scaffold/%.c build-aux/mes-snarf.scm GNUmakefile
|
|
|
|
build-aux/mes-snarf.scm --mini $<
|
|
|
|
|
|
|
|
mini-%.h mini-%.i mini-%.environment.i mini-%.symbols.i: %.c build-aux/mes-snarf.scm GNUmakefile
|
|
|
|
build-aux/mes-snarf.scm --mini $<
|
|
|
|
|
|
|
|
mini-mes.h mini-mes.i mini-mes.environment.i mini-mes.symbols.i: scaffold/mini-mes.c build-aux/mes-snarf.scm GNUmakefile
|
|
|
|
build-aux/mes-snarf.scm --mini $<
|
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: mini-mes.h mini-mes.i mini-mes.environment.i mini-mes.symbols.i
|
2017-04-02 15:01:22 +00:00
|
|
|
mini-mes: gc.c mini-gc.h mini-gc.i mini-gc.environment.i
|
|
|
|
mini-mes: vector.c mini-vector.h mini-vector.i mini-vector.environment.i
|
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-04-02 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -g -o $@ $(CPPFLAGS) $<
|
2017-03-25 14:58:44 +00:00
|
|
|
rm -f mes.o
|
2017-03-19 12:41:56 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-04-04 12:37:17 +00:00
|
|
|
guile-mini-mes: module/language/c99/compiler.mes # and others...
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-mini-mes: mini-mes.h mini-mes.i mini-mes.environment.i mini-mes.symbols.i
|
2017-04-02 15:01:22 +00:00
|
|
|
guile-mini-mes: gc.c mini-gc.h mini-gc.i mini-gc.environment.i
|
mini-mes: Merge with mes.c: lib.c, math.c, posix.c.
* mes.c: Include math.c after posix.c.
(assert_defined, check_formals, check_apply, load_env,
bload_env): Move from lib.c
* scaffold/mini-mes.c: Include mini-lib.h, lib.c., mini-math.h,
math.c, mini-posix.h, posix.c.
(greater_p, less_p, is_p, minus, plus, divide, modulo, multiply,
logior, ash): Remove.
(ungetchar, peekchar, peek_byte, read_byte, write_byte,
string_to_cstring, getenv_, open_input_file, current_input_port,
set_current_input_port, force_output): Remove.
(mes_builtins): include mini-lib.i, mini-lib.environment.i.
mini-math.i, mini-math.environment.i mini-posix.i,
mini-posix.environment.i.
* GNUmakefile (guile-mini-mes): Add dependencies.
2017-04-08 13:01:24 +00:00
|
|
|
guile-mini-mes: lib.c mini-lib.h mini-lib.i mini-lib.environment.i
|
|
|
|
guile-mini-mes: math.c mini-math.h mini-math.i mini-math.environment.i
|
|
|
|
guile-mini-mes: posix.c mini-posix.h mini-posix.i mini-posix.environment.i
|
2017-04-02 15:01:22 +00:00
|
|
|
guile-mini-mes: vector.c mini-vector.h mini-vector.i mini-vector.environment.i
|
|
|
|
guile-mini-mes: mlibc.c mstart.c
|
|
|
|
guile-mini-mes: GNUmakefile
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-mini-mes: module/mes/read-0-32.mo
|
|
|
|
guile-mini-mes: scaffold/mini-mes.c
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
2017-03-19 12:41:56 +00:00
|
|
|
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-04-02 15:01:22 +00:00
|
|
|
mes-mini-mes: mini-mes.h mini-mes.i mini-mes.environment.i mini-mes.symbols.i
|
|
|
|
mes-mini-mes: gc.c mini-gc.h mini-gc.i mini-gc.environment.i
|
|
|
|
mes-mini-mes: vector.c mini-vector.h mini-vector.i mini-vector.environment.i
|
|
|
|
mes-mini-mes: mlibc.c mstart.c
|
|
|
|
mes-mini-mes: GNUmakefile
|
|
|
|
mes-mini-mes: module/mes/read-0-32.mo
|
|
|
|
mes-mini-mes: scaffold/mini-mes.c
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
|
|
|
# MES_FLAGS= MES_DEBUG=1 scripts/mescc.mes $< > $@ || rm -f $@
|
|
|
|
MES_FLAGS= MES_DEBUG=1 scripts/mescc.mes $< > $@
|
|
|
|
chmod +x $@
|
|
|
|
|
|
|
|
mes-hello: GNUmakefile
|
|
|
|
mes-hello: mlibc.c mstart.c
|
|
|
|
mes-hello: module/mes/read-0-32.mo
|
|
|
|
mes-hello: scaffold/hello.c
|
|
|
|
rm -f $@
|
2017-04-02 15:01:22 +00:00
|
|
|
MES_FLAGS= MES_DEBUG=1 scripts/mescc.mes $< > $@ || rm -f $@
|
|
|
|
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
|
2017-04-02 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -g -o $@ $(CPPFLAGS) $<
|
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
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
2017-03-19 12:41:56 +00:00
|
|
|
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
|
2017-04-02 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -g -o $@ $(CPPFLAGS) $<
|
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
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
2017-03-19 12:41:56 +00:00
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
2017-04-02 10:10:38 +00:00
|
|
|
m: scaffold/m.c GNUmakefile
|
2017-04-02 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -g -o $@ $(CPPFLAGS) $<
|
|
|
|
# gcc --std=gnu99 -g -o $@ $(CPPFLAGS) $<
|
2017-04-02 10:10:38 +00:00
|
|
|
chmod +x $@
|
|
|
|
|
2017-03-19 12:41:56 +00:00
|
|
|
guile-m: scaffold/m.c
|
2017-04-02 16:50:07 +00:00
|
|
|
rm -f $@
|
2017-03-19 12:41:56 +00:00
|
|
|
guile/mescc.scm $< > $@ || rm -f $@
|
|
|
|
chmod +x $@
|
|
|
|
|
2017-04-02 10:31:15 +00:00
|
|
|
malloc: scaffold/malloc.c GNUmakefile
|
2017-04-02 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -g -o $@ $(CPPFLAGS) $<
|
2017-04-02 10:31:15 +00:00
|
|
|
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 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -o $@ $(CPPFLAGS) $<
|
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 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -o $@ $(CPPFLAGS) $<
|
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 15:01:22 +00:00
|
|
|
gcc -nostdlib --std=gnu99 -m32 -g -o $@ $(CPPFLAGS) $<
|
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)
|
2017-04-02 16:50:07 +00:00
|
|
|
mescc: doc/examples/main.c all
|
2016-12-17 09:57:38 +00:00
|
|
|
rm -f a.out
|
2017-04-02 16:50:07 +00:00
|
|
|
MES_DEBUG=1 scripts/mescc.mes $< > a.out
|
2016-12-17 09:57:38 +00:00
|
|
|
./a.out; r=$$?; [ $$r = 42 ]
|
2016-07-24 23:12:22 +00:00
|
|
|
|
2017-04-02 16:50:07 +00:00
|
|
|
guile-mescc: doc/examples/main.c
|
2016-12-17 09:57:38 +00:00
|
|
|
rm -f a.out
|
2017-04-02 16:50:07 +00:00
|
|
|
guile/mescc.scm $< > 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-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"
|