1
0
Fork 0
lesson-lisp/Makefile

49 lines
1.2 KiB
Makefile

all: test
CAT = cat
CC = gcc
DIFF_Q = diff -q
RM_F = rm -f
CFLAGS = -Wall -Wextra
LISP_REQ = -r lib/lists.scm
OBJS = \
src/builtins.c.o \
src/ctype.c.o \
src/eval.c.o \
src/lexer.c.o \
src/main.c.o \
src/object.c.o \
src/parser.c.o \
src/syntax.c.o \
src/tokens.c.o
repl: arcana-lisp
./arcana-lisp $(LISP_REQ)
test: arcana-lisp
$(CAT) tests/arcana/builtin.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/arcana/tokenize.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/arcana/typeof.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/arcana/parse.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/arithm_ops.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/basic_data_structs.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/equiv.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/logic_ops.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/syntax.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/type_conv.scm | ./arcana-lisp $(LISP_REQ)
$(CAT) tests/type_preds.scm | ./arcana-lisp $(LISP_REQ)
clean:
$(RM_F) arcana-lisp $(OBJS)
arcana-lisp: $(OBJS)
$(CC) -o $@ $^ $(CFLAGS)
%.c.o: %.c
$(CC) -c $< -o $@ $(CFLAGS)
tests/%.out: tests/%.scm arcana-lisp
$(CAT) $< | ./arcana-lisp > $@