blob: 7c1fe8e3475f2cc26c717fee194d41cfdb2a5fe6 [file] [log] [blame]
# -*- 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)
CFLAGS += -Ivendor/luajit/dynasm
ASMFLAGS += -felf -Fdwarf
OBJECTS = main.o \
lisp.o \
compiler.o \
lib/std.o \
plat/linux.o \
istream.o \
gc.o \
call_list.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
run: lisp
status_log(LISP, $(F))
@./lisp $(F)
leak-check: lisp
status_log(VALGRIND, lisp $(F))
@valgrind --leak-check=full ./lisp $(F)
format:
status_log(FORMAT, *)
@clang-format -i *.c *.h *.dasc plat/* lib/*
finish