universalservice/examples/hashtable/Makefile

24 lines
651 B
Makefile

.PHONY: test clean
TESTS=test_insert.test test_insert_delete.test
COMMON_OBJS=../test_common.o uns_hashtable.o
.SUFFIXES: .test
CFLAGS=-Wall -std=c89 -Werror -pedantic -fPIC -g -Iinclude
libunshashtable.so: uns_hashtable.o
$(CC) -shared -I../../include $(CFLAGS) $< -o libunshashtable.so
test: $(TESTS) $(COMMON_OBJS)
for i in $(TESTS); do \
LD_LIBRARY_PATH=$$(pwd)/../../ valgrind ./$$i || exit 1; \
done
test_insert.test: $(COMMON_OBJS)
.c.test:
$(CC) -I../../include $(CFLAGS) $< $(COMMON_OBJS) -L../../ -luniversalservice -o $@
.c.o:
$(CC) -I../../include $(CFLAGS) $< -c -o $@
clean:
rm -f $(TESTS) $(COMMON_OBJS) libunshashtable.so