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