blob: 4d0825f120fdfd376e8bab0f07a705ad219b61d3 [file] [log] [blame]
swissChili8cfb7c42021-04-18 21:17:58 -07001# -*- mode:makefile -*-
2
swissChili7a6f5eb2021-04-13 16:46:02 -07003init(lisp, lisp)
4
swissChili8cfb7c42021-04-18 21:17:58 -07005option(PLAT, "`platform to build for: either linux or bluejay'", linux)
6
swissChili7a6f5eb2021-04-13 16:46:02 -07007preset(optimize)
8preset(32)
9preset(debug)
10preset(warn)
11
12archetype(c)
13
swissChilica107a02021-04-14 12:07:30 -070014CFLAGS += -Ivendor/luajit/dynasm
15
16OBJECTS = main.o \
17 lisp.o \
swissChilib3ca4fb2021-04-20 10:33:00 -070018 compiler.o \
swissChili53472e82021-05-08 16:06:32 -070019 lib/std.o \
swissChili923b5362021-05-09 20:31:43 -070020 plat/linux.o \
21 istream.o
swissChili8cfb7c42021-04-18 21:17:58 -070022
swissChilica107a02021-04-14 12:07:30 -070023LUA = vendor/luajit/src/host/minilua
24
25vendor/luajit/src/host/minilua: vendor/luajit/src/host/minilua.c
26 status_log(CC, $<)
27 @$(CC) $< -o $@ -lm
28
29compiler.c: compiler.dasc
30 status_log(DYNASM, $<)
31 @$(LUA) vendor/luajit/dynasm/dynasm.lua -o $@ $<
swissChili7a6f5eb2021-04-13 16:46:02 -070032
33type(executable)
34
35run: lisp
36 status_log(RUN, ./lisp)
swissChili923b5362021-05-09 20:31:43 -070037 @./lisp ./test.lisp
swissChilibed80922021-04-13 21:58:05 -070038
39format:
40 status_log(FORMAT, *)
swissChili53472e82021-05-08 16:06:32 -070041 @clang-format -i *.c *.h *.dasc plat/* lib/*
swissChili7a6f5eb2021-04-13 16:46:02 -070042
43finish