swissChili | 8cfb7c4 | 2021-04-18 21:17:58 -0700 | [diff] [blame] | 1 | # -*- mode:makefile -*- |
2 | |||||
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 3 | init(lisp, lisp) |
4 | |||||
swissChili | 8cfb7c4 | 2021-04-18 21:17:58 -0700 | [diff] [blame] | 5 | option(PLAT, "`platform to build for: either linux or bluejay'", linux) |
6 | |||||
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 7 | preset(optimize) |
8 | preset(32) | ||||
9 | preset(debug) | ||||
10 | preset(warn) | ||||
11 | |||||
12 | archetype(c) | ||||
13 | |||||
swissChili | ca107a0 | 2021-04-14 12:07:30 -0700 | [diff] [blame] | 14 | CFLAGS += -Ivendor/luajit/dynasm |
15 | |||||
16 | OBJECTS = main.o \ | ||||
17 | lisp.o \ | ||||
swissChili | b3ca4fb | 2021-04-20 10:33:00 -0700 | [diff] [blame] | 18 | compiler.o \ |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 19 | lib/std.o \ |
swissChili | 923b536 | 2021-05-09 20:31:43 -0700 | [diff] [blame] | 20 | plat/linux.o \ |
21 | istream.o | ||||
swissChili | 8cfb7c4 | 2021-04-18 21:17:58 -0700 | [diff] [blame] | 22 | |
swissChili | ca107a0 | 2021-04-14 12:07:30 -0700 | [diff] [blame] | 23 | LUA = vendor/luajit/src/host/minilua |
24 | |||||
25 | vendor/luajit/src/host/minilua: vendor/luajit/src/host/minilua.c | ||||
26 | status_log(CC, $<) | ||||
27 | @$(CC) $< -o $@ -lm | ||||
28 | |||||
29 | compiler.c: compiler.dasc | ||||
30 | status_log(DYNASM, $<) | ||||
31 | @$(LUA) vendor/luajit/dynasm/dynasm.lua -o $@ $< | ||||
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 32 | |
33 | type(executable) | ||||
34 | |||||
35 | run: lisp | ||||
swissChili | 1b83922 | 2021-06-03 13:54:40 -0700 | [diff] [blame] | 36 | status_log(LISP, test.lisp) |
swissChili | 923b536 | 2021-05-09 20:31:43 -0700 | [diff] [blame] | 37 | @./lisp ./test.lisp |
swissChili | bed8092 | 2021-04-13 21:58:05 -0700 | [diff] [blame] | 38 | |
39 | format: | ||||
40 | status_log(FORMAT, *) | ||||
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 41 | @clang-format -i *.c *.h *.dasc plat/* lib/* |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 42 | |
43 | finish |