2013-05-08 19:41:21 -04:00
|
|
|
CC ?= gcc
|
|
|
|
CARBON_HEADERS ?= "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/Developer/Headers"
|
2009-08-23 21:11:36 -04:00
|
|
|
|
|
|
|
NAME = flisp
|
|
|
|
SRCS = $(NAME).c builtins.c string.c equalhash.c table.c iostream.c
|
|
|
|
OBJS = $(SRCS:%.c=%.o)
|
|
|
|
DOBJS = $(SRCS:%.c=%.do)
|
|
|
|
EXENAME = $(NAME)
|
2012-02-17 17:58:21 -05:00
|
|
|
LIBTARGET = lib$(NAME)
|
|
|
|
LLTDIR = llt
|
2009-08-23 21:11:36 -04:00
|
|
|
LLT = $(LLTDIR)/libllt.a
|
|
|
|
|
2017-08-13 14:15:45 -04:00
|
|
|
CONFIG = -DBITS64 -D__CPU__=686 -I$(CARBON_HEADERS)
|
2012-02-17 17:58:21 -05:00
|
|
|
FLAGS = -falign-functions -Wall -Wno-strict-aliasing -I$(LLTDIR) $(CFLAGS) -DUSE_COMPUTED_GOTO $(CONFIG)
|
2009-08-23 21:11:36 -04:00
|
|
|
LIBFILES = $(LLT)
|
|
|
|
LIBS = $(LIBFILES) -lm -framework ApplicationServices
|
|
|
|
|
|
|
|
DEBUGFLAGS = -g -DDEBUG $(FLAGS)
|
|
|
|
SHIPFLAGS = -O2 -DNDEBUG $(FLAGS)
|
|
|
|
|
|
|
|
default: release test
|
|
|
|
|
|
|
|
test:
|
2012-02-17 17:58:21 -05:00
|
|
|
cd tests && ../flisp unittest.lsp
|
2009-08-23 21:11:36 -04:00
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(SHIPFLAGS) -c $< -o $@
|
|
|
|
%.do: %.c
|
|
|
|
$(CC) $(DEBUGFLAGS) -c $< -o $@
|
|
|
|
|
2010-02-05 14:56:10 -05:00
|
|
|
flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c
|
|
|
|
flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c
|
2012-02-17 17:58:21 -05:00
|
|
|
flmain.o: flmain.c flisp.h
|
|
|
|
flmain.do: flmain.c flisp.h
|
2009-08-23 21:11:36 -04:00
|
|
|
|
|
|
|
$(LLT):
|
2012-10-11 22:36:02 -04:00
|
|
|
cd $(LLTDIR) && make -f Makefile.macosx
|
2009-08-23 21:11:36 -04:00
|
|
|
|
2012-02-17 17:58:21 -05:00
|
|
|
$(LIBTARGET).da: $(DOBJS)
|
|
|
|
rm -rf $@
|
|
|
|
ar rs $@ $(DOBJS)
|
|
|
|
|
|
|
|
$(LIBTARGET).a: $(OBJS)
|
|
|
|
rm -rf $@
|
|
|
|
ar rs $@ $(OBJS)
|
|
|
|
|
|
|
|
debug: $(DOBJS) $(LIBFILES) $(LIBTARGET).da flmain.do
|
|
|
|
$(CC) $(DEBUGFLAGS) $(DOBJS) flmain.do -o $(EXENAME) $(LIBS) $(LIBTARGET).da
|
2009-08-23 21:11:36 -04:00
|
|
|
make test
|
|
|
|
|
2012-02-17 17:58:21 -05:00
|
|
|
release: $(OBJS) $(LIBFILES) $(LIBTARGET).a flmain.o
|
|
|
|
$(CC) $(SHIPFLAGS) $(OBJS) flmain.o -o $(EXENAME) $(LIBS) $(LIBTARGET).a
|
2009-08-23 21:11:36 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
rm -f *.do
|
|
|
|
rm -f $(EXENAME)
|
2012-02-17 17:58:21 -05:00
|
|
|
rm -f $(LIBTARGET).a
|
|
|
|
rm -f $(LIBTARGET).da
|