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 | |||||
swissChili | 6d6525e | 2021-06-15 21:20:53 -0700 | [diff] [blame^] | 12 | archetype(c, asm) |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 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 \ |
swissChili | 6d6525e | 2021-06-15 21:20:53 -0700 | [diff] [blame^] | 21 | istream.o \ |
22 | gc.o | ||||
swissChili | 8cfb7c4 | 2021-04-18 21:17:58 -0700 | [diff] [blame] | 23 | |
swissChili | ca107a0 | 2021-04-14 12:07:30 -0700 | [diff] [blame] | 24 | LUA = vendor/luajit/src/host/minilua |
25 | |||||
26 | vendor/luajit/src/host/minilua: vendor/luajit/src/host/minilua.c | ||||
27 | status_log(CC, $<) | ||||
28 | @$(CC) $< -o $@ -lm | ||||
29 | |||||
30 | compiler.c: compiler.dasc | ||||
31 | status_log(DYNASM, $<) | ||||
32 | @$(LUA) vendor/luajit/dynasm/dynasm.lua -o $@ $< | ||||
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 33 | |
34 | type(executable) | ||||
35 | |||||
36 | run: lisp | ||||
swissChili | 1b83922 | 2021-06-03 13:54:40 -0700 | [diff] [blame] | 37 | status_log(LISP, test.lisp) |
swissChili | 923b536 | 2021-05-09 20:31:43 -0700 | [diff] [blame] | 38 | @./lisp ./test.lisp |
swissChili | bed8092 | 2021-04-13 21:58:05 -0700 | [diff] [blame] | 39 | |
40 | format: | ||||
41 | status_log(FORMAT, *) | ||||
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 42 | @clang-format -i *.c *.h *.dasc plat/* lib/* |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 43 | |
44 | finish |