blob: a54cd870a1533e84015d04109f7eb22e657b1c4e [file] [log] [blame]
swissChili0fc3f262021-08-09 22:05:17 -07001# -*- mode:tcl -*-
2
swissChili0fc3f262021-08-09 22:05:17 -07003init lisp
4
swissChili56cf8172022-07-30 18:47:48 -07005presets 32 debug warn nasm
6cflags -Ivendor/luajit/dynasm -O0
7asmflags -felf32
8
swissChilia890aed2022-07-30 17:13:07 -07009# Make this `readline', `edit', or `none'
10option READLINE readline
swissChili35558852022-07-02 18:15:45 -070011
12set lisp_libpath "$::root/lib/lisp"
swissChili0fc3f262021-08-09 22:05:17 -070013
swissChilia890aed2022-07-30 17:13:07 -070014if {$options(READLINE) == "none"} {
swissChili0fc3f262021-08-09 22:05:17 -070015 cflags -DNO_READLINE
swissChilia890aed2022-07-30 17:13:07 -070016} else {
17 cflags -L/usr/lib/i386-linux-gnu -l$options(READLINE)
swissChili0fc3f262021-08-09 22:05:17 -070018}
19
swissChilia890aed2022-07-30 17:13:07 -070020set lua [pwd]/vendor/luajit/src/host/minilua
swissChili0fc3f262021-08-09 22:05:17 -070021
22rule $lua ${lua}.c {
swissChili35558852022-07-02 18:15:45 -070023 log CC $::src
24 cc "$::src -o $::target -lm"
swissChili0fc3f262021-08-09 22:05:17 -070025}
26
swissChilia890aed2022-07-30 17:13:07 -070027rule [pwd]/compiler.c "[pwd]/compiler.dasc $lua" {
swissChili35558852022-07-02 18:15:45 -070028 log DYNASM $::first_src
29 shell "$::lua vendor/luajit/dynasm/dynasm.lua -o $::target $::first_src"
swissChili0fc3f262021-08-09 22:05:17 -070030}
31
swissChilia890aed2022-07-30 17:13:07 -070032rule repl [pwd]/lisp {
swissChili35558852022-07-02 18:15:45 -070033 log LISP repl
34 shell "LISP_LIBRARY_PATH=$::lisp_libpath ./lisp $::root/lib/lisp/repl/repl.lisp"
35}
36
swissChilic0acce42022-07-31 13:38:17 -070037rule valgrind [pwd]/lisp {
38 log VALGRIND "lisp test-gc.lisp"
swissChili9d428a82022-08-01 20:47:40 -070039 shell "LISP_LIBRARY_PATH=$::lisp_libpath valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all ./lisp quicksort.lisp"
swissChilic0acce42022-07-31 13:38:17 -070040}
41
swissChilia890aed2022-07-30 17:13:07 -070042srcs main.c lisp.c compiler.c lib/std.c plat/linux.c istream.c gc.c \
43 call_list.s error.c
44
swissChili35558852022-07-02 18:15:45 -070045type executable