~swisschili/bluejay

ref: 6d02af472f6ce87ea50ff24aa77f88928dbf31bc bluejay/src/lisp/Jmk -rw-r--r-- 1.1 KiB
6d02af47swissChili Add detailed error reporting, remove panics 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- mode:makefile -*-

init(lisp, lisp)

option(PLAT, "`platform to build for: either linux or bluejay'", linux)

# preset(optimize)
preset(32)
preset(debug)
preset(warn)
preset(nasm)

archetype(c)
archetype(asm)

NO_READLINE ?= 0

CFLAGS += -Ivendor/luajit/dynasm -Werror -lreadline # -fsanitize=address
LDFLAGS += -lreadline
ASMFLAGS += -felf -Fdwarf

ifeq ($(NO_READLINE),1)
CFLAGS += -DNO_READLINE
endif

OBJECTS = main.o \
			lisp.o \
			compiler.o \
			lib/std.o \
			plat/linux.o \
			istream.o \
			gc.o \
			call_list.o \
			error.o

LUA = vendor/luajit/src/host/minilua

$(LUA): vendor/luajit/src/host/minilua.c
	status_log(CC, $<)
	@$(CC) $< -o $@ -lm

compiler.c: compiler.dasc | $(LUA)
	status_log(DYNASM, $<)
	@$(LUA) vendor/luajit/dynasm/dynasm.lua -o $@ $<

type(executable)

F ?= test.lisp
lisp_libpath = $(ROOT)/lib/lisp

run: lisp
	status_log(LISP, $(F))
	@LISP_LIBRARY_PATH="$(lisp_libpath)" ./lisp $(F)

leak-check: lisp
	status_log(VALGRIND, lisp $(F))
	@LISP_LIBRARY_PATH="$(lisp_libpath)" valgrind --leak-check=full ./lisp $(F)

format:
	status_log(FORMAT, *)
	@clang-format -i *.c *.h *.dasc plat/* lib/*

finish