aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 78d7e5ba0e8e81342daef897d29636de20263aca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
.POSIX:
.PHONY: tests clean string_tests htable_tests
.SUFFIXES:
.SUFFIXES: .c .o .test
CC=cc

CFLAGS=-Wall -std=c89 -Werror -pedantic -fPIC -g -Iinclude

tests: string_tests htable_tests

COMMON_OBJECTS=uns.o

uns.o: uns.c include/uns.h

libuniversalservice.so: uns.o ${ALL_COLLECTORS}
	${CC} -shared uns.o ${ALL_COLLECTORS} -o libuniversalservice.so

.c.o:
	${CC} ${CFLAGS} $< -c -o $@

## Collectors
CHENEY_C89_OBJS = cheney_c89.o
cheney_c89.o: cheney_c89.c include/uns.h include/cheney_c89.h

COLLECTOR_OBJS=${CHENEY_C89_OBJS}
## Example libraries

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

EXAMPLE_OBJS=${UNS_STRING_OBJS} ${UNS_HASHTABLE_OBJS}

## Clean
clean:
	${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