blob: e9f31b20fb0102a79b73f3bcab849456ca66ced5 [file] [log] [blame]
swissChili0fc3f262021-08-09 22:05:17 -07001# -*- mode:tcl -*-
2
swissChili0fc3f262021-08-09 22:05:17 -07003init lisp
4
5presets 32 debug warn nasm
6cflags -Ivendor/luajit/dynasm -O0
7
8option NO_READLINE 0
9
swissChili35558852022-07-02 18:15:45 -070010srcs main.c lisp.c compiler.c lib/std.c plat/linux.c istream.c gc.c \
11 call_list.s error.c
12
13set lisp_libpath "$::root/lib/lisp"
swissChili0fc3f262021-08-09 22:05:17 -070014
15if {$options(NO_READLINE) == 0} {
16 cflags -lreadline
17} else {
18 cflags -DNO_READLINE
19}
20
21set lua vendor/luajit/src/host/minilua
22
23rule $lua ${lua}.c {
swissChili35558852022-07-02 18:15:45 -070024 log CC $::src
25 cc "$::src -o $::target -lm"
swissChili0fc3f262021-08-09 22:05:17 -070026}
27
28rule compiler.c "compiler.dasc $lua" {
swissChili35558852022-07-02 18:15:45 -070029 log DYNASM $::first_src
30 shell "$::lua vendor/luajit/dynasm/dynasm.lua -o $::target $::first_src"
swissChili0fc3f262021-08-09 22:05:17 -070031}
32
swissChili35558852022-07-02 18:15:45 -070033rule repl lisp {
34 log LISP repl
35 shell "LISP_LIBRARY_PATH=$::lisp_libpath ./lisp $::root/lib/lisp/repl/repl.lisp"
36}
37
38type executable