File: Makefile

package info (click to toggle)
netproc 0.6.6-0.1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 908 kB
  • sloc: ansic: 7,876; makefile: 101; sh: 12
file content (45 lines) | stat: -rw-r--r-- 913 bytes parent folder | download
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

# specific unity, only append this variables
C_SOURCE= ./unity/unity.c
INC_DIRS= -Iunity

CFLAGS=-Wall -Wextra -pedantic -ggdb -O0 -fsanitize=address
LDFLAGS+= -fsanitize=address

INC_DIRS += -I../src -I ../src/resolver

C_TMP= $(wildcard ./test*.c)
OBJS_TEST= $(C_TMP:.c=.o)

TEST = tests_all

# include here source module to test
C_SOURCE += ../src/hashtable.c \
 						../src/full_read.c \
						../src/resolver/queue.c \
						../src/str.c \
						../src/rate.c \
						../src/round.c \
						../src/human_readable.c \
						../src/vector.c \
						../src/timer.c \
						../src/m_error.c

OBJS_MODS = $(C_SOURCE:.c=.o)

.PHONY: all clean run

all: $(TEST) run clean

$(TEST): $(OBJS_TEST) $(OBJS_MODS)
	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

%.o : %.c
	$(CC) $(CFLAGS) $(INC_DIRS) $(CPPFLAGS) -c $< -o $@

run:
	- ./$(TEST)

clean:
	@ find . -type f -name '*.o' -delete
#	@ find . -executable -type f -delete