blob: 1f4e6b1e3ae8fd11e63f45651c1939ce664a5ecc [file] [log] [blame]
swissChili0fc3f262021-08-09 22:05:17 -07001# -*- mode:tcl -*-
2
swissChili0fc3f262021-08-09 22:05:17 -07003init lisp
4
swissChilia890aed2022-07-30 17:13:07 -07005# Make this `readline', `edit', or `none'
6option READLINE readline
swissChili35558852022-07-02 18:15:45 -07007
8set lisp_libpath "$::root/lib/lisp"
swissChili0fc3f262021-08-09 22:05:17 -07009
swissChilia890aed2022-07-30 17:13:07 -070010if {$options(READLINE) == "none"} {
swissChili0fc3f262021-08-09 22:05:17 -070011 cflags -DNO_READLINE
swissChilia890aed2022-07-30 17:13:07 -070012} else {
13 cflags -L/usr/lib/i386-linux-gnu -l$options(READLINE)
swissChili0fc3f262021-08-09 22:05:17 -070014}
15
swissChilia890aed2022-07-30 17:13:07 -070016presets 32 debug warn nasm
17cflags -Ivendor/luajit/dynasm -O0
18asmflags -felf32
19
20set 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
swissChilia890aed2022-07-30 17:13:07 -070037srcs main.c lisp.c compiler.c lib/std.c plat/linux.c istream.c gc.c \
38 call_list.s error.c
39
swissChili35558852022-07-02 18:15:45 -070040type executable