swissChili | 0fc3f26 | 2021-08-09 22:05:17 -0700 | [diff] [blame] | 1 | # -*- mode:tcl -*- |
| 2 | |
swissChili | 3555885 | 2022-07-02 18:15:45 -0700 | [diff] [blame^] | 3 | # source "../../share/jmk/jmk.tcl" |
swissChili | 0fc3f26 | 2021-08-09 22:05:17 -0700 | [diff] [blame] | 4 | |
| 5 | init lisp |
| 6 | |
| 7 | presets 32 debug warn nasm |
| 8 | cflags -Ivendor/luajit/dynasm -O0 |
| 9 | |
| 10 | option NO_READLINE 0 |
| 11 | |
swissChili | 3555885 | 2022-07-02 18:15:45 -0700 | [diff] [blame^] | 12 | srcs main.c lisp.c compiler.c lib/std.c plat/linux.c istream.c gc.c \ |
| 13 | call_list.s error.c |
| 14 | |
| 15 | set lisp_libpath "$::root/lib/lisp" |
swissChili | 0fc3f26 | 2021-08-09 22:05:17 -0700 | [diff] [blame] | 16 | |
| 17 | if {$options(NO_READLINE) == 0} { |
| 18 | cflags -lreadline |
| 19 | } else { |
| 20 | cflags -DNO_READLINE |
| 21 | } |
| 22 | |
| 23 | set lua vendor/luajit/src/host/minilua |
| 24 | |
| 25 | rule $lua ${lua}.c { |
swissChili | 3555885 | 2022-07-02 18:15:45 -0700 | [diff] [blame^] | 26 | log CC $::src |
| 27 | cc "$::src -o $::target -lm" |
swissChili | 0fc3f26 | 2021-08-09 22:05:17 -0700 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | rule compiler.c "compiler.dasc $lua" { |
swissChili | 3555885 | 2022-07-02 18:15:45 -0700 | [diff] [blame^] | 31 | log DYNASM $::first_src |
| 32 | shell "$::lua vendor/luajit/dynasm/dynasm.lua -o $::target $::first_src" |
swissChili | 0fc3f26 | 2021-08-09 22:05:17 -0700 | [diff] [blame] | 33 | } |
| 34 | |
swissChili | 3555885 | 2022-07-02 18:15:45 -0700 | [diff] [blame^] | 35 | rule repl lisp { |
| 36 | log LISP repl |
| 37 | shell "LISP_LIBRARY_PATH=$::lisp_libpath ./lisp $::root/lib/lisp/repl/repl.lisp" |
| 38 | } |
| 39 | |
| 40 | type executable |