shithub: femtolisp

ref: f5c6e64d0cac5529490919e737f0858f8a42fc16
dir: /Makefile/

View raw version
DESTDIR?=
PREFIX?=/usr/local
BIN=${DESTDIR}${PREFIX}/bin

TARG=flisp
LLT=llt/libllt.a
CFLAGS?=-O2 -pipe -g
CFLAGS+=-Wall -Wextra -falign-functions -Wno-strict-aliasing -std=c99
LDFLAGS?=
LDFLAGS+=${LLT} -lm

OBJS=\
	flmain.o\
	flisp.o\
	builtins.o\
	string.o\
	equalhash.o\
	table.o\
	iostream.o\

.PHONY: all default test clean

all: default

default: ${TARG}

test: ${TARG}
	cd test && ../$(TARG) unittest.lsp

${TARG}: ${OBJS} ${LLT}
	${CC} -o $@ ${OBJS} ${LDFLAGS}

.SUFFIXES: .c .o
.c.o:
	${CC} -o $@ -c $< ${CFLAGS} -Illt -DUSE_COMPUTED_GOTO

flisp.o:  flisp.c cvalues.c operators.c types.c flisp.h print.c read.c equal.c
flmain.o: flmain.c flisp.h

${LLT}:
	${MAKE} -C llt CFLAGS="${CFLAGS}" CC="${CC}"

clean:
	rm -f *.o ${TARG}
	${MAKE} -C llt clean