blob: aa75bf6dfcf8cbacf0e3acdaa9fac91d0a13db15 [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 \
20 plat/linux.o
swissChili8cfb7c42021-04-18 21:17:58 -070021
swissChilica107a02021-04-14 12:07:30 -070022LUA = vendor/luajit/src/host/minilua
23
24vendor/luajit/src/host/minilua: vendor/luajit/src/host/minilua.c
25 status_log(CC, $<)
26 @$(CC) $< -o $@ -lm
27
28compiler.c: compiler.dasc
29 status_log(DYNASM, $<)
30 @$(LUA) vendor/luajit/dynasm/dynasm.lua -o $@ $<
swissChili7a6f5eb2021-04-13 16:46:02 -070031
32type(executable)
33
34run: lisp
35 status_log(RUN, ./lisp)
swissChilibed80922021-04-13 21:58:05 -070036 @./lisp "$$(cat test.lisp)"
37
38format:
39 status_log(FORMAT, *)
swissChili53472e82021-05-08 16:06:32 -070040 @clang-format -i *.c *.h *.dasc plat/* lib/*
swissChili7a6f5eb2021-04-13 16:46:02 -070041
42finish