universalservice/Makefile

34 lines
1.0 KiB
Makefile

.PHONY: test_strings clean
COMMON_OBJECTS=uns.o
CHENEY_C89_OBJECTS=cheney_c89.o c89_relo.o
CFLAGS=-Wall -Wno-overlength-strings -std=c89 -Werror -pedantic -fPIC -g -Iinclude
libuniversalservice.so: $(COMMON_OBJECTS) $(CHENEY_C89_OBJECTS)
$(CC) -shared $(COMMON_OBJECTS) $(CHENEY_C89_OBJECTS) -o libuniversalservice.so
.c.o:
$(CC) $(CFLAGS) $< -c -o $@
#############################################
## Examples
#############################################
STRING_TEST_OBJS=examples/string/test_common.o examples/string/uns_string.o
STRING_TESTS= examples/string/test_small
examples/string/test_small: examples/string/test_small.c $(STRING_TEST_OBJS) libuniversalservice.so
$(CC) -I. -Iext $(CFLAGS) examples/string/test_small.c $(STRING_TEST_OBJS) -L. -luniversalservice -o examples/string/test_small
test_strings: $(STRING_TESTS)
for i in $(STRING_TESTS); do \
LD_LIBRARY_PATH=$$(pwd) valgrind $$i; \
done
###################
## Clean
##################
clean:
rm -f $(STRING_TEST_OBJS) $(STRING_TESTS) $(COMMON_OBJECTS) $(CHENEY_STRING_OBJECTS)