2024-07-08 19:58:22 -04:00
|
|
|
.POSIX:
|
|
|
|
.PHONY: tests clean string_tests htable_tests
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .c .o .test
|
|
|
|
CC=cc
|
|
|
|
|
2024-07-10 10:47:55 -04:00
|
|
|
CFLAGS=-Wall -std=c89 -Werror -pedantic -fPIC -g -Iinclude -I.
|
2024-07-08 19:58:22 -04:00
|
|
|
|
|
|
|
tests: string_tests htable_tests
|
2024-06-11 23:40:34 -04:00
|
|
|
|
|
|
|
COMMON_OBJECTS=uns.o
|
|
|
|
|
2024-07-08 19:58:22 -04:00
|
|
|
uns.o: uns.c include/uns.h
|
|
|
|
|
|
|
|
libuniversalservice.so: uns.o ${ALL_COLLECTORS}
|
|
|
|
${CC} -shared uns.o ${ALL_COLLECTORS} -o libuniversalservice.so
|
2024-06-11 23:40:34 -04:00
|
|
|
|
|
|
|
.c.o:
|
2024-07-08 19:58:22 -04:00
|
|
|
${CC} ${CFLAGS} $< -c -o $@
|
2024-06-11 23:40:34 -04:00
|
|
|
|
2024-07-08 19:58:22 -04:00
|
|
|
## Collectors
|
|
|
|
CHENEY_C89_OBJS = cheney_c89.o
|
|
|
|
cheney_c89.o: cheney_c89.c include/uns.h include/cheney_c89.h
|
2024-06-11 23:40:34 -04:00
|
|
|
|
2024-07-08 19:58:22 -04:00
|
|
|
COLLECTOR_OBJS=${CHENEY_C89_OBJS}
|
|
|
|
## Example libraries
|
2024-06-11 23:40:34 -04:00
|
|
|
|
2024-07-08 19:58:22 -04:00
|
|
|
examples/string/uns_string.o: examples/string/uns_string.c \
|
|
|
|
examples/string/uns_string.h \
|
|
|
|
include/uns.h
|
|
|
|
|
|
|
|
UNS_STRING_OBJS=examples/string/uns_string.o
|
|
|
|
|
|
|
|
examples/hashtable/uns_hashtable.o: examples/hashtable/uns_hashtable.c \
|
|
|
|
examples/hashtable/uns_hashtable.h \
|
|
|
|
include/uns.h
|
|
|
|
UNS_HASHTABLE_OBJS=examples/hashtable/uns_hashtable.o
|
|
|
|
|
2024-07-10 10:47:55 -04:00
|
|
|
examples/lisp/uns_lisp.o: include/uns.h \
|
|
|
|
examples/lisp/uns_lisp.c \
|
|
|
|
examples/string/uns_string.h
|
|
|
|
|
|
|
|
UNS_LISP_OBJS=examples/lisp/uns_lisp.o examples/string/uns_string.o
|
|
|
|
|
2024-07-08 19:58:22 -04:00
|
|
|
EXAMPLE_OBJS=${UNS_STRING_OBJS} ${UNS_HASHTABLE_OBJS}
|
|
|
|
|
|
|
|
## Clean
|
2024-07-08 20:06:01 -04:00
|
|
|
clean: clean_tests
|
2024-07-08 19:58:22 -04:00
|
|
|
${RM} -f ${COMMON_OBJECTS} libuniversalservice.so \
|
|
|
|
${TEST_OBJS} ${COLLECTOR_OBJS} ${EXAMPLE_OBJS}
|
|
|
|
|
|
|
|
tests.makefile: gen_tests.sh
|
|
|
|
./gen_tests.sh > tests.makefile
|
|
|
|
include tests.makefile
|