blob: ec4e5da39433b152fd12859109cfc65fce942670 [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
swissChili6d6525e2021-06-15 21:20:53 -070012archetype(c, asm)
swissChili7a6f5eb2021-04-13 16:46:02 -070013
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 \
swissChili6d6525e2021-06-15 21:20:53 -070021 istream.o \
22 gc.o
swissChili8cfb7c42021-04-18 21:17:58 -070023
swissChilica107a02021-04-14 12:07:30 -070024LUA = vendor/luajit/src/host/minilua
25
swissChili9e57da42021-06-15 22:22:46 -070026$(LUA): vendor/luajit/src/host/minilua.c
swissChilica107a02021-04-14 12:07:30 -070027 status_log(CC, $<)
28 @$(CC) $< -o $@ -lm
29
swissChili9e57da42021-06-15 22:22:46 -070030compiler.c: compiler.dasc | $(LUA)
swissChilica107a02021-04-14 12:07:30 -070031 status_log(DYNASM, $<)
32 @$(LUA) vendor/luajit/dynasm/dynasm.lua -o $@ $<
swissChili7a6f5eb2021-04-13 16:46:02 -070033
34type(executable)
35
36run: lisp
swissChili1b839222021-06-03 13:54:40 -070037 status_log(LISP, test.lisp)
swissChili923b5362021-05-09 20:31:43 -070038 @./lisp ./test.lisp
swissChilibed80922021-04-13 21:58:05 -070039
40format:
41 status_log(FORMAT, *)
swissChili53472e82021-05-08 16:06:32 -070042 @clang-format -i *.c *.h *.dasc plat/* lib/*
swissChili7a6f5eb2021-04-13 16:46:02 -070043
44finish