Commit graph

43 commits

Author SHA1 Message Date
Jan Nieuwenhuizen 9e1c618b00
build: Install ChangeLog.
* ChangeLog: New file.
* install.sh: Regenerate it, install it.
2018-07-21 23:56:08 +02:00
Jan Nieuwenhuizen 5d3fa50384
build: Prepare for autoconfiscation.
Make build system more in alignment with how autotools work.  This
will make transition easier.

* mes/module/mes/boot-0.scm.in: Update from module/mes/boot-0.scm.
* scripts/mescc.in: Update from scripts/mescc.
* build-aux/pre-inst-env.in: New file.
* build-aux/cc-mes.sh: Use pre-inst-env.
* configure: Substitute new .in files.
* install.sh: Do not substitute mescc, boot-0.scm.
2018-07-21 18:28:47 +02:00
Jan Nieuwenhuizen 4f2c685753
build: Refactor mes tests.
* build-aux/check-mes.sh: New file.
* check.sh: Invoke it for Guile and Mes.
* .gitignore: Ignore new guile logs.
* mes/module/mes/boot-0.scm: Ignore some standard Guile options.
* module/mes/test.scm: Make a module.
* tests/base.test: Use it.  Make a module, support invoking with Guile
  or Mes alike.
* tests/boot.test: Likewise.
* tests/catch.test: Likewise.
* tests/closure.test: Likewise.
* tests/cwv.test: Likewise.
* tests/display.test: Likewise.
* tests/fluids.test: Likewise.
* tests/getopt-long.test: Likewise.
* tests/guile.test: Likewise.
* tests/let-syntax.test: Likewise.
* tests/let.test: Likewise.
* tests/match.test: Likewise.
* tests/math.test: Likewise.
* tests/module.test: Likewise.
* tests/optargs.test: Likewise.
* tests/peg.test: Likewise.
* tests/pmatch.test: Likewise.
* tests/psyntax.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/read.test: Likewise.
* tests/scm.test: Likewise.
* tests/srfi-13.test: Likewise.
* tests/srfi-14.test: Likewise.
* tests/srfi-16.test: Likewise.
* tests/srfi-1.test: Likewise.
* tests/srfi-43.test: Likewise.
* tests/srfi-9.test: Likewise.
* tests/syntax.test: Likewise.
* tests/vector.test: Likewise.
* tests/base.test-guile: Remove.
* tests/boot.test-guile: Remove.
* tests/catch.test-guile: Remove.
* tests/closure.test-guile: Remove.
* tests/cwv.test-guile: Remove.
* tests/display.test-guile: Remove.
* tests/fluids.test-guile: Remove.
* tests/getopt-long.test-guile: Remove.
* tests/guile.test-guile: Remove.
* tests/let-syntax.test-guile: Remove.
* tests/let.test-guile: Remove.
* tests/match.test-guile: Remove.
* tests/math.test-guile: Remove.
* tests/module.test-guile: Remove.
* tests/optargs.test-guile: Remove.
* tests/peg.test-guile: Remove.
* tests/pmatch.test-guile: Remove.
* tests/psyntax.test-guile: Remove.
* tests/quasiquote.test-guile: Remove.
* tests/read.test-guile: Remove.
* tests/scm.test-guile: Remove.
* tests/srfi-13.test-guile: Remove.
* tests/srfi-14.test-guile: Remove.
* tests/srfi-16.test-guile: Remove.
* tests/srfi-1.test-guile: Remove.
* tests/srfi-43.test-guile: Remove.
* tests/srfi-9.test-guile: Remove.
* tests/syntax.test-guile: Remove.
* tests/vector.test-guile: Remove.
2018-07-21 13:48:50 +02:00
Jan Nieuwenhuizen 7f6676a4c2
doc: Add html, pdf.
* GNUmakefile (html, pdf): New target.
* .gitignore: Ignore html, pdf targets.
2018-07-12 22:30:00 +02:00
Jan Nieuwenhuizen 72e147f53f
build: Build and install manual pages.
* build-aux/export.make: New file.
* GNUmakefile (man): New target.
  (doc): Depend on man.
  include build-aux/export.make, remove exports.
* guix.scm (mes): Add dependency on help2man.
* configure: Check for help2man.
* install.sh: Install manual pages if built.
2018-07-12 22:29:59 +02:00
Jan Nieuwenhuizen a4770c1eed
doc: Initial version.
* doc/mes.texi: New file.
* doc/fdl-1.3.texi: New file.
* AUTHORS: Mention it.
* GNUmakefile (doc, info, install-info): New targets.
* install.sh: Install info if available.
* guix: (mes): Add texinfo to native-inputs.
* configure: Check for makeinfo.
2018-07-12 22:29:59 +02:00
Jan Nieuwenhuizen 350d94aa77
build: Support tcc, create tinycc-seed with tcc.
* configure: check for tcc.
* build-aux/cc32-mes.sh: Rename from cc-mes-gcc.sh.  Support
  tcc.  Update users.
* build-aux/build-cc32-mes.sh: Rename from build-mes-gcc.sh.  Update users.
* GNUmakefile (mes-tcc): New target.
* .gitignore: Ignore mes-tcc arch output.
* lib/crt1.c (_start): Add "rm" constraint so satisfy tcc.
* lib/linux-gcc.c (_sys_call, _sys_call1 _sys_call2 _sys_call3): Likewise.
2018-06-24 09:28:23 +02:00
Jan Nieuwenhuizen de964f3e1f
mescc: Support gcc-2.6.3.
* TODO
2018-06-02 11:41:06 +02:00
Jan Nieuwenhuizen 272b522962
build: Use arch-dir.
* lib/x86-mes: Move from stage0.
* build-aux/build-cc.sh: Create libraries in lib/gcc.  Update users.
* build-aux/build-mes.sh: Create libraries in lib/x86-mes.  Update users.
* build-aux/build-mes-gcc.sh: Rename from build-mlibc.sh.  Create
  libraries in lib/x86-mes-gcc.  Update callers.
* build-aux/cc-mes-gcc.sh: Rename from cc-mlibc.sh.  Update callers.
2018-05-29 20:07:46 +02:00
Jan Nieuwenhuizen a10c48735d
mescc: Posixify interface.
* module/mescc/compile.mes: Move from language/c99/compiler.mes.
* module/mescc: New module..
* module/mescc/M1.scm: Move from mes/M1.mes.
* module/mescc/as.scm: Likewise.
* module/mescc/bytevectors.scm: Likewise.
* module/mescc/mescc.scm: New file.
* scripts/mescc: Update to new layout and posixy interface.
* GNUmakefile: Likewise.
* build-aux/build-cc.sh: Likewise.
* build-aux/build-guile.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/build-mlibc.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/cc-mlibc.sh: Likewise.
* build-aux/cc.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* build-aux/test.sh: Likewise.
* build.sh: Likewise.
* .gitignore: Update for posixy extensions.
2018-05-25 08:05:02 +02:00
Jan Nieuwenhuizen ba17eeeefe
build: Fixes for Debian and /bin/sh == dash.
* build.sh: Use separate export stanzas.  Use command -v (WAS: type
  -p).  Fixes sh, /bin/sh == dash.
* build-aux/build-cc.sh: Likewise.
* build-aux/build-guile.sh: Likewise.
* build-aux/build-mes.sh: Likewise.
* build-aux/build-mlibc.sh: Likewise.
* build-aux/cc-mes.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* check.sh: Likewise.
* install.sh: Likewise.
* scripts/mescc: Likewise.
2018-05-03 20:32:06 +02:00
Jan Nieuwenhuizen 98417537a2
test: enable all tests, use expect count, add tinycc tests.
* build-aux/check-mescc.sh (tests): Add tinycc tests.
* build-aux/diff.scm: Naive diff for tinycc tests.
* build-aux/test.sh: Run diff when .expect found.
2018-05-01 16:50:29 +02:00
Jan Nieuwenhuizen a937d18c38
build: Simplify, drop make.scm experiment.
* build.sh: Rewrite.
* build-aux/build-cc.sh: New file.
* build-aux/build-mes.sh: New file.
* build-aux/build-mlibc.sh: New file.
* build-aux/cc.sh: New file.
* build-aux/cc-mes.sh: New file.
* build-aux/cc-mlibc.sh: New file.
* install.sh: Update.
* make.scm: Remove.
* guile/guix/make.scm: Remove.
* guile/guix/records.scm: Remove.
* guile/guix/shell-utilsg.scm: Remove.
2018-04-29 18:38:57 +02:00
Jan Nieuwenhuizen e8884d83e1 mlibc: GNU Gcc support: setjmp, longjmp.
* stage0/x86.M1 (jmp____*%ebx): New macro.
  (mov____0x8(%ebp),%ebp): New macro.
  (mov____0x8(%ebp),%esp): New macro.
* include/setjmp.h (jmp_buf): Redefine as struct.
* lib/libc-mes+tcc.c (longjmp, setjmp): Implement.
* scaffold/tests/80-setjmp.c: Test it.
* make.scm ("80-setjmp"): Build it.
* .gitignore: Ignore *.tcc-guile.
2017-11-26 13:10:46 +01:00
Jan Nieuwenhuizen 7ab279bf7b bootstrap: Add bootstrap build scripts.
* build.sh: New file.
* check-mescc.sh: New file.
* check.sh: New file.
* install.sh: New File.
2017-11-24 19:02:58 +01:00
Jan Nieuwenhuizen 89a9decfff build: Ignore some files.
.gitignore: Update for make.scm.
2017-07-26 11:36:07 +02:00
Jan Nieuwenhuizen 83a43b81b3 mescc: Produce M1 output instead of hex2.
Use: ./make.scm [TARGET]
     ./make.scm check

* stage0/x86.M1: New file.
* mlibc/mini-libc-mes.c (exit, write): Use M1 instead of .byte.
* mlibc/libc-mes.c (_start, exit, read, write, open, access, brk,
  fsync, printf): Use M1 instead of .byte.
* module/mes/as-i386.mes: Use M1.
* module/mes/make.scm: New file.
* make.scm: New file.
* guile/guix/records.scm: New File.
* guile/guix/shell-utils.scm: New file.
* module/mes/M1.mes: Rename from hex2.mes.
* module/mes/M1.scm: Rename from hex2.scm.
* scripts/mescc.mes: Update callers.
* guile/mescc.scm: Update callers.
2017-07-02 16:25:14 +02:00
Jan Nieuwenhuizen 9f56b8b102 core: Always include reader.c, drop binary read-0-32.mo dependency.
* module/language/c99/compiler.mes (c99-input->full-ast): Remove
  obsolete __NYACC__ and MES_FULL defines.
* src/mes.c [!MES_FULL]: Include reader-mes.h.
  (mes_builtins) [!MES_FULL]: Include reader.mes.i, reader.me.environment.i.
  [!MES_FULL]: Include reader.c.
  (main) [!MES_FULL]: By default call load_env, only call bload_env
  when --load is supplied.  WAS: Always bload read-0-32.mo.
* src/reader.c (__end_of__mes_): Remove.
  (dump): Remove option of dumping tiny test program.
* make/mescc-mes.make ($(OUT)/$(TARGET), mescc.mes-ccompile,
  mescc.mes.c-compile-E): Depend on $(OUT)/mes, scripts/mes.
* src/src.make (mes.guile): Remove module/mes/read-32-0 dependency.
  Do not build $(OUT)/mes.mes.
* module/module.make (module/mes/read-0.mo, module/mes/read-0-32.mo,
  module/mes/tiny-0-32.mo): Remove targets.
  (CLEAN): Do not add them.  Neither install $(OUT)/mes.mes.
* .gitignore: Remove exceptions for them.
* make/install.make (install): Do not install them.
* HACKING: Update info about creating module/mes/read-32-0.mo.
* scaffold/mini-mes.c: Remove.
* scaffold/tiny-mes.c: Remove.
* scaffold/cons-mes.c: Remove.
* scaffold/scaffold.make (tiny-mes.libc, tiny-mes.guile, tiny-mes.mes,
  mini-mes.libc, mini-mes.guile, mini-mes.mes): Reemove targets.
2017-05-28 16:03:45 +02:00
Jan Nieuwenhuizen 38d30a3e42 build: Refactor.
* GNUmakefile (OUT,QUIET,SUBDIRS): New variables.
  include make/common.make
* .gitignore: Remove toplevel targets.
* build-aux/compile-all.scm: Import from GNU Guix.
* configure (gulp-pipe): Check exit status.  Actually test for CC,
  CC32.
* make/bin.make: New file.
* make/check.make: New file.
* make/clean.make: New file.
* make/common.make: New file.
* make/compile.make: New file.
* make/guile.make: New file.
* make/mescc-guile.make: New file.
* make/mescc-mes.make: New file.
* make/reset.make: New file.
* lib/mlibc.c: Rename from top.
* lib/start.c: Rename from top.
* module/module.make: New file.
* scaffold/scaffold.make: New file.
* scripts/scripts.make: New file.
* src/mes.c: Rename from top.
* src/src.make: New file.
* src/mes.c: Rename from top.
* src/gc..c: Rename from top.
* src/lib.c: Rename from top.
* src/posix.c: Rename from top.
* src/reader.c: Rename from top.
* src/vector.c: Rename from top.
* tests/tests.make: New file.
2017-04-12 21:27:59 +02:00
Jan Nieuwenhuizen 8f09f1a5cf bootstrap: Regenerate.
* mes-mini-mes: First self-hosting binary.
2017-04-02 12:41:33 +02:00
Jan Nieuwenhuizen fc263de433 build: Cleanup, use gcc-specific snarfing.
* .gitignore: Ignore *.o-32, mes-mini-mes.
* scripts/nyacc-calc.mes: Remove.
* scripts/nyacc.mes: Remove.
* scripts/paren.mes: Remove.
* make/install.make (install): Remove them.
p* module/mes/mes-0.mes: Remove.
* module/mes/loop-0.mes: Remove.
* build-aux/mes-snarf.scm (main): Add --mini option.
* GNUmakefile (mini-mes): Use it.
2017-04-02 17:01:22 +02:00
Jan Nieuwenhuizen 0685c9e7e8 mescc: Add brk, naive malloc.
* scaffold/mini-mes.c (gc_init_cells): Use malloc to init g_cells.
* scaffold/malloc.c: New file.
* GNUmakefile (malloc, guile-malloc): New targets.
* module/mes/libc-i386.mes (i386:brk): New function.
  (i386:libc): Add it.
* mlibc.c (brk): New function.
  (malloc): Use it.
  (realloc): New function.
* module/mes/libc.mes (malloc, realloc): New functions.
2017-04-02 12:31:15 +02:00
Jan Nieuwenhuizen 9a02352a15 mescc: Run full scheme reader read-0.mes.
* lib.c (load_env)[MINI_MES]: Load full reader, module/mes/read-0.mes.
* GNUmakefile (module/mes/read-0-32.mo): Update dependency.
* module/mes/mini-0.mes: Remove.
* doc/examples/t.c (struct_test):
* module/mes/read-0-32.mo: New file: bootstrap binary reader.
2017-03-22 06:59:50 +01:00
Jan Nieuwenhuizen 240f2814f4 mescc: Cleanup mini-mes build and test.
* GNUmakefile (guile-cons-mes guile-m guile-main guile-micro-mes
  guile-mini-mes guile-t guile-tiny-mes): New targets.
  (clean): Clean them.
* .gitignore: Ignore them.
* HACKING: Update.
* scaffold/tiny-mes.c (bload_env): Read module/mes/tiny-0-32.mo.
* scaffold/cons-mes.c (simple_bload_env): Likewise.
* lib.c (dump)[MES_TINY]: Write crafted dump: module/mes/tiny-0-32.mo.
  (load_env): Read module/mes/mini-0.mes.
  (bload_env): Read module/mes/read-0-32.mo.
* module/mes/mini-0.mes: New file.
* module/mes/tiny-0.mes : New file.
2017-03-19 13:41:56 +01:00
Jan Nieuwenhuizen 70e4aec861 mescc: Run mini-mes.
* .gitignore: Ignore tiny-mes and tiny .mo's.
* doc/examples/tiny-mes.c: Simplify.
* doc/examples/mini-mes.c: Use simplifications from tiny-mes.
* doc/examples/t.c (read_test, struct_test): New functions.
  (test): Add tests for arena, g_cells globals.
* module/mes/elf-util.mes (dec->hex): New function.
  (lambda/label->list): Add text-address parameter.  Update callers.
* module/language/c99/compiler.mes (make, info, clone): Add init field.
  (.init): New function.
  (ident->accu): Add exceptions for globals.
* module/mes/elf-util.scm: Export it.
* module/mes/libc-i386.mes (i386:accu->base-ref,
  i386:byte-accu->base-ref, i386:accu->base-ref+n,
  i386:accu->global-ref, i386:global-ref->accu, i386:global-ref->base,
  i386:global-add, i386:global->accu):, i386:local-ref->accu,
  i386:local-ptr->accu, i386:local-ptr->base): New functions.
* module/mes/libc-i386.scm: Export them.
2017-01-29 15:22:39 +01:00
Jan Nieuwenhuizen 4d5ba83392 doc: Add fosdem talk.
* .gitignore: Ignore beamer/tex stuff.
* doc/fosdem/fosdem.org: New file.
* doc/fosdem/GuixSD.png: New file.
* doc/fosdem/LISP-1-5-page-13-bottom.png: New file.
* doc/fosdem/LISP-1.5-page-13-bottom.png: New file.
* doc/fosdem/LISP-1.5-page-13.pdf: New file.
* doc/fosdem/LISP-1.5-page-13.png: New file.
* doc/fosdem/beamercolorthemeX.sty: New file.
* doc/fosdem/beamerthemeX.sty: New file.
* doc/fosdem/bootstrap-graph.png: New file.
* doc/fosdem/egg.jpeg: New file.
* doc/fosdem/egg.png: New file.
* doc/fosdem/egg.xcf: New file.
* doc/fosdem/fosdem.pdf: New file.
* doc/fosdem/fsb-logo-guile-guix-gnu.png: New file.
* doc/fosdem/fsb-logo-guile-guix-gnu.xcf: New file.
* doc/fosdem/fsb-logo-guile-guix-mes.png: New file.
* doc/fosdem/fsb-logo-guile-guix-mes.xcf: New file.
* doc/fosdem/fsb-logo.png: New file.
* doc/fosdem/guix-build-bootstrap-tarballs.log: New file.
* doc/fosdem/html.sty: New file.
* doc/fosdem/mes.png: New file.
* doc/fosdem/mes.xcf: New file.
2017-01-21 16:15:34 +01:00
Jan Nieuwenhuizen 8989dab8b0 mescc: Scaffolding of Nyacc compile experiments.
* scaffold/micro-mes.c: New file.
* scaffold/mini-mes.c: New file.
* GNUmakefile (mini-mes, micro-mes): New targets.
* .gitignore: Ignore them.
2017-04-02 12:01:33 +02:00
Jan Nieuwenhuizen 2b577eaee0 Add loadable modules.
* module/mes/base-0.mes (mes-use-module): Implement.
* module/mes: Update users.
* HACKING: Update.
* NEWS: Update.
* configure (main): Use shell expansion for prefix.
* make/install.make (install): Substitute prefix.
2016-12-12 20:35:19 +01:00
Jan Nieuwenhuizen 1614d13439 Add reader in Scheme.
* module/mes/read-0.mes: New file.
* mes.c (char_to_integer, integer_to_char, null_p): Move to core.
 (peek_byte, read_byte, unread_byte): New function.
 (main): --dump, --load: New option.
* lib.c (char_to_integer, integer_to_char): Remove.
* NEWS: Update.
2016-12-12 20:35:19 +01:00
Jan Nieuwenhuizen 61e42e8527 core: Number based cells.
* mes.c (scm_t): Change car, string, ref, cdr, macro, vector into g_cell index
  [WAS]: scm_t pointer.
* define.c: Update.
* lib.c: Update.
* math.c: Update.
* posix.c: Update.
* quasiquote.c: Update.
* string.c: Update.
* type.c: Update.
* build-aux/mes-snarf.mes Update.
* tests/gc-4.test: New test.
* tests/gc-5.test: New test.
* tests/gc-6.test: New test.
2016-12-12 20:35:18 +01:00
Jan Nieuwenhuizen 3e03a12a4d Generate C header and includes using snarfing.
* mes.c: Move specific renames and n-args to alist annotation.
* build-aux/mes-snarf.scm: New file.
* GNUmakefile (mes.environment.h): Use it.
  (mes.h): Remove.
  (clean): Update.
  (mes.o): New dependency rule.
* .gitignore: Update.
2016-10-21 22:44:50 +02:00
Jan Nieuwenhuizen 3128c4b976 Prepare for 0.1 release: gnu-build-system.
* configure: New file.
* make/install.make: New file.
* .gitignore: Ignore generated files.
* build-aux/gitlog-to-changelog: New file.
2016-10-16 00:34:23 +02:00
Jan Nieuwenhuizen d114634203 Prepare for 0.1 release: new directory structure.
* scripts/elf.mes: New file.
* scripts/include.mes: New file.
* scripts/mescc.mes: New file.
* scripts/paren.mes: New file.
* scripts/repl.mes: New file.
* doc/examples/main.c: Move from ./main.c.
* module/mes/base-0.mes: Move from ./base0.mes.
* module/mes/base.mes: Move from top.
* module/mes/elf.mes: Likewise.
* module/mes/let-syntax.mes: Likewise.
* module/mes/let.mes: Likewise.
* module/mes/mes.mes: Likewise.
* module/mes/quasiquote.mes: Likewise.
* module/mes/repl.mes: Likewise.
* module/mes/scm.mes: Likewise.
* module/mes/syntax.mes: Likewise.
* module/mes/lalr-0.mes: Move from lib/lalr.mes.
* module/mes/lalr.mes: Move from lib/lalr.scm.
* module/mes/match.mes: Move from lib/match.scm.
* module/mes/record-0.mes: Move from lib/record.mes.
* module/mes/record.mes: Move from lib/record.scm.
* module/mes/test.mes: Move flom lib/.
* module/rnrs/bytevectors.mes: Move from lib/rnrs.
* module/srfi/srfi-0.mes: Move from lib/srfi.
* module/srfi/srfi-1.mes: Likewise.
* module/srfi/srfi-9.mes: Likewise.
* module/language/c/lexer.mes: Move from ./c-lexer.scm.
* module/language/c/parser.mes: Move from ./mescc.scm.
* module/language/c/compiler.mes: New file, split from parser.mes.
* module/language/paren.mes: Move from ./paren.scm.
* module/mes/libc-i386.mes: New file, split from elf.mes.
* tests/base.test: Move from test/.
* tests/closure.test: Likewise.
* tests/let-syntax.test: Likewise.
* tests/let.test: Likewise.
* tests/match.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/record.test: Likewise.
* tests/scm.test: Likewise.
* hello.S: Remove.
* hello.c: Remove.
* loop2.mes: Remove.
* test/foo.test: Remove.
2016-10-12 23:40:11 +02:00
Jan Nieuwenhuizen 7ff86c393f cleanup and doc update. 2016-10-10 23:24:44 +02:00
Jan Nieuwenhuizen 0829c5762c mescc/elf.mes: write minimal ELF header. 2016-08-12 14:17:55 +02:00
Jan Nieuwenhuizen 384a88dd53 hello.c, hello.S: hello world target for C compiler. 2016-07-26 07:30:53 +02:00
Jan Nieuwenhuizen 60a7c9099f mescc.scm: parse simple main.c. 2016-07-24 23:18:53 +02:00
Jan Nieuwenhuizen cc1ad30652 ADD .gitignore. 2016-10-18 22:43:23 +02:00
Jan Nieuwenhuizen 3a28828bdf remove booting into mes (would need VM), boot.mes; rewrite test.mes. 2016-07-18 22:43:16 +02:00
Jan Nieuwenhuizen fda8ff7cc4 ignore 2016-07-10 10:43:52 +02:00
Jan Nieuwenhuizen 72d96eb485 snarf scm functions and environment. 2016-07-09 23:12:25 +02:00
Jan Nieuwenhuizen 1513c0d5fb boot.mes: generate from mes.mes, scm.mes, test.mes. 2016-07-09 13:23:58 +02:00
Jan Nieuwenhuizen b99afdbbb7 Add Guile version of John McCarthy's Maxwell Equations of Software.
* .gitignore: New file.
* AUTHORS: Idem.
* COPYING: Idem.
* README: Idem.
* mes.scm: Idem.
2016-05-28 16:26:06 +02:00