1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
CFLAGS = -Iinclude
LDFLAGS = -L. -lcanlock
CC = gcc
STATIC_LIB = libcanlock.a
all: hmactest canlocktest $(STATIC_LIB)
sha1test: t/sha1test.c $(STATIC_LIB)
$(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
hmactest: t/hmactest.c $(STATIC_LIB)
$(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
canlocktest: t/canlocktest.c $(STATIC_LIB)
$(CC) $(CFLAGS) t/$@.c -o $@ $(LDFLAGS)
$(STATIC_LIB):
cd src && make
ln -s src/libcanlock.a libcanlock.a
clean:
rm -f src/*.o t/*.o t/*.out *.gmon gmon.*
cd src && make clean
rm -f *.a canlocktest hmactest sha1test *.exe *.h lib-stamp
install: all
cd src && make install DESTDIR=$(DESTDIR)
install --mode=644 include/canlock.h $(DESTDIR)/usr/include
test: all
@echo "hmactest: "
@./hmactest > t/hmactest.out || echo hmm
@diff t/hmactest.shouldbe t/hmactest.out && echo " Pass." || (echo " **FAIL**" ; exit 1)
@echo "=-=-=-="
@echo "canlocktest: "
@./canlocktest > t/canlocktest.out
@diff t/canlocktest.shouldbe t/canlocktest.out && echo " Pass." || (echo " **FAIL**" ; exit 1)
@echo "=-=-=-="
|