2008-06-30 21:53:51 -04:00
|
|
|
CC = gcc
|
|
|
|
|
2009-03-02 22:16:30 -05:00
|
|
|
SRCS = bitvector.c hashing.c socket.c timefuncs.c dblprint.c ptrhash.c \
|
2008-11-28 16:44:59 -05:00
|
|
|
utf8.c ios.c operators.c cplxprint.c dirpath.c htable.c \
|
2009-03-02 22:16:30 -05:00
|
|
|
bitvector-ops.c fp.c int2str.c dump.c random.c bswap.c memalign.c \
|
2010-01-06 15:27:04 -05:00
|
|
|
swapreverse.c lltinit.c
|
2008-06-30 21:53:51 -04:00
|
|
|
OBJS = $(SRCS:%.c=%.o)
|
|
|
|
DOBJS = $(SRCS:%.c=%.do)
|
|
|
|
TARGET = libllt.a
|
|
|
|
TESTSRC = unittest.c
|
|
|
|
TESTER = llttest
|
|
|
|
|
2009-08-28 20:54:51 -04:00
|
|
|
FLAGS = -Wall -Wno-strict-aliasing $(CFLAGS)
|
2008-06-30 21:53:51 -04:00
|
|
|
LIBS =
|
|
|
|
|
|
|
|
DEBUGFLAGS = -g -DDEBUG $(FLAGS)
|
2009-06-09 14:46:02 -04:00
|
|
|
SHIPFLAGS = -O3 -DNDEBUG $(FLAGS)
|
2008-06-30 21:53:51 -04:00
|
|
|
|
|
|
|
default: release
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(SHIPFLAGS) -c $< -o $@
|
|
|
|
%.do: %.c
|
|
|
|
$(CC) $(DEBUGFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
debug: $(DOBJS)
|
|
|
|
rm -rf $(TARGET)
|
|
|
|
ar rs $(TARGET) $(DOBJS)
|
|
|
|
|
|
|
|
release: $(OBJS)
|
|
|
|
rm -rf $(TARGET)
|
|
|
|
ar rs $(TARGET) $(OBJS)
|
|
|
|
|
|
|
|
test:
|
|
|
|
make clean
|
2008-08-16 23:47:32 -04:00
|
|
|
make debug CFLAGS=-DENABLE_LLT_TEST
|
2008-06-30 21:53:51 -04:00
|
|
|
gcc $(TESTSRC) $(TARGET) -o $(TESTER) -lm
|
|
|
|
./$(TESTER)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
rm -f *.do
|
|
|
|
rm -f *~
|
|
|
|
rm -f core*
|
|
|
|
rm -f $(TARGET)
|
|
|
|
rm -f $(TESTER)
|