femtolisp/femtolisp/Makefile

44 lines
909 B
Makefile
Raw Normal View History

2008-06-30 21:54:22 -04:00
CC = gcc
NAME = flisp
2009-02-08 22:22:31 -05:00
SRCS = $(NAME).c equal.c builtins.c string.c equalhash.c table.c iostream.c
2008-06-30 21:54:22 -04:00
OBJS = $(SRCS:%.c=%.o)
DOBJS = $(SRCS:%.c=%.do)
EXENAME = $(NAME)
LLTDIR = ../llt
LLT = $(LLTDIR)/libllt.a
2008-06-30 21:54:22 -04:00
FLAGS = -falign-functions -Wall -Wextra -Wno-strict-aliasing -I$(LLTDIR) $(CFLAGS) -DUSE_COMPUTED_GOTO
2008-06-30 21:54:22 -04:00
LIBS = $(LLT) -lm
DEBUGFLAGS = -g -DDEBUG $(FLAGS)
SHIPFLAGS = -O2 -DNDEBUG -march=native $(FLAGS)
2008-06-30 21:54:22 -04:00
default: release test
test:
./flisp unittest.lsp
%.o: %.c
$(CC) $(SHIPFLAGS) -c $< -o $@
%.do: %.c
$(CC) $(DEBUGFLAGS) -c $< -o $@
flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c
flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c
2008-06-30 21:54:22 -04:00
$(LLT):
cd $(LLTDIR) && make
2008-06-30 21:54:22 -04:00
debug: $(DOBJS) $(LIBS)
$(CC) $(DEBUGFLAGS) $(DOBJS) -o $(EXENAME) $(LIBS)
make test
2008-06-30 21:54:22 -04:00
release: $(OBJS) $(LIBS)
$(CC) $(SHIPFLAGS) $(OBJS) -o $(EXENAME) $(LIBS)
clean:
rm -f *.o
rm -f *.do
rm -f $(EXENAME)