universalservice/examples/string/Makefile

26 lines
743 B
Makefile

.PHONY: test clean
TESTS=test_small.test test_inefficient.test test_large.test
COMMON_OBJS=../test_common.o uns_string.o
.SUFFIXES: .test
CFLAGS=-Wall -Wno-overlength-strings -std=c89 -Werror -pedantic -fPIC -g -Iinclude
libunsstring.so: uns_string.o
$(CC) -shared -I../../include $(CFLAGS) $< -o libunsstring.so
test: $(TESTS) $(COMMON_OBJS)
for i in $(TESTS); do \
LD_LIBRARY_PATH=$$(pwd)/../../ valgrind ./$$i || exit 1; \
done
test_inefficient.test: $(COMMON_OBJS)
test_small.test: $(COMMON_OBJS)
test_large.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) libunsstring.so