diff options
author | 2024-06-11 23:40:34 -0400 | |
---|---|---|
committer | 2024-06-11 23:40:34 -0400 | |
commit | fe131f6e4b80bad56be3e1f6e79f4defa61aa99b (patch) | |
tree | 518f236ea2e8bbdc76021ccf3d8f509310aff4aa /Makefile |
cheney copying collector
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6a20cbb --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +.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) |