makefile updates
This commit is contained in:
parent
2b34bcfbd3
commit
2f9d6593d4
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ OBJS = $(SRCS:%.c=%.o)
|
||||||
DOBJS = $(SRCS:%.c=%.do)
|
DOBJS = $(SRCS:%.c=%.do)
|
||||||
EXENAME = $(NAME)
|
EXENAME = $(NAME)
|
||||||
LIBTARGET = lib$(NAME)
|
LIBTARGET = lib$(NAME)
|
||||||
LLTDIR = ../llt
|
LLTDIR = llt
|
||||||
LLT = $(LLTDIR)/libllt.a
|
LLT = $(LLTDIR)/libllt.a
|
||||||
|
|
||||||
# OS flags: LINUX, WIN32, MACOSX
|
# OS flags: LINUX, WIN32, MACOSX
|
||||||
|
|
|
@ -5,10 +5,12 @@ SRCS = $(NAME).c builtins.c string.c equalhash.c table.c iostream.c
|
||||||
OBJS = $(SRCS:%.c=%.o)
|
OBJS = $(SRCS:%.c=%.o)
|
||||||
DOBJS = $(SRCS:%.c=%.do)
|
DOBJS = $(SRCS:%.c=%.do)
|
||||||
EXENAME = $(NAME)
|
EXENAME = $(NAME)
|
||||||
LLTDIR = ../llt
|
LIBTARGET = lib$(NAME)
|
||||||
|
LLTDIR = llt
|
||||||
LLT = $(LLTDIR)/libllt.a
|
LLT = $(LLTDIR)/libllt.a
|
||||||
|
|
||||||
FLAGS = -falign-functions -Wall -Wno-strict-aliasing -I$(LLTDIR) $(CFLAGS) -DUSE_COMPUTED_GOTO
|
CONFIG = -DMACOSX -DARCH_X86_64 -DBITS64 -D__CPU__=686
|
||||||
|
FLAGS = -falign-functions -Wall -Wno-strict-aliasing -I$(LLTDIR) $(CFLAGS) -DUSE_COMPUTED_GOTO $(CONFIG)
|
||||||
LIBFILES = $(LLT)
|
LIBFILES = $(LLT)
|
||||||
LIBS = $(LIBFILES) -lm -framework ApplicationServices
|
LIBS = $(LIBFILES) -lm -framework ApplicationServices
|
||||||
|
|
||||||
|
@ -18,7 +20,7 @@ SHIPFLAGS = -O2 -DNDEBUG $(FLAGS)
|
||||||
default: release test
|
default: release test
|
||||||
|
|
||||||
test:
|
test:
|
||||||
./flisp unittest.lsp
|
cd tests && ../flisp unittest.lsp
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(SHIPFLAGS) -c $< -o $@
|
$(CC) $(SHIPFLAGS) -c $< -o $@
|
||||||
|
@ -27,18 +29,30 @@ test:
|
||||||
|
|
||||||
flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c
|
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
|
flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c
|
||||||
|
flmain.o: flmain.c flisp.h
|
||||||
|
flmain.do: flmain.c flisp.h
|
||||||
|
|
||||||
$(LLT):
|
$(LLT):
|
||||||
cd $(LLTDIR) && make
|
cd $(LLTDIR) && make
|
||||||
|
|
||||||
debug: $(DOBJS) $(LIBFILES)
|
$(LIBTARGET).da: $(DOBJS)
|
||||||
$(CC) $(DEBUGFLAGS) $(DOBJS) -o $(EXENAME) $(LIBS)
|
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
|
||||||
make test
|
make test
|
||||||
|
|
||||||
release: $(OBJS) $(LIBFILES)
|
release: $(OBJS) $(LIBFILES) $(LIBTARGET).a flmain.o
|
||||||
$(CC) $(SHIPFLAGS) $(OBJS) -o $(EXENAME) $(LIBS)
|
$(CC) $(SHIPFLAGS) $(OBJS) flmain.o -o $(EXENAME) $(LIBS) $(LIBTARGET).a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
rm -f *.do
|
rm -f *.do
|
||||||
rm -f $(EXENAME)
|
rm -f $(EXENAME)
|
||||||
|
rm -f $(LIBTARGET).a
|
||||||
|
rm -f $(LIBTARGET).da
|
||||||
|
|
Loading…
Reference in New Issue