universalservice/examples/hashtable/Makefile

24 lines
651 B
Makefile
Raw Normal View History

2024-06-13 20:57:07 -04:00
.PHONY: test clean
2024-06-21 16:49:55 -04:00
TESTS=test_insert.test test_insert_delete.test
2024-06-13 20:57:07 -04:00
COMMON_OBJS=../test_common.o uns_hashtable.o
.SUFFIXES: .test
CFLAGS=-Wall -std=c89 -Werror -pedantic -fPIC -g -Iinclude
2024-06-21 16:49:55 -04:00
libunshashtable.so: uns_hashtable.o
$(CC) -shared -I../../include $(CFLAGS) $< -o libunshashtable.so
2024-06-13 20:57:07 -04:00
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:
2024-06-21 16:49:55 -04:00
rm -f $(TESTS) $(COMMON_OBJS) libunshashtable.so