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