always pass vectors by reference
[cvector.git] / Makefile
blob795445d4daf262b5c301f4fb12168e03d8dc1a58
1 CC = gcc
2 CFLAGS = -Wall -Wextra -Werror -Wconversion -pedantic -std=c99
3 LDFLAGS =
5 ifdef RELEASE
6 CFLAGS += -O9 -DNDEBUG
7 else
8 CFLAGS += -g -O0
9 endif
11 OBJECTS = test/test.o test/test1.o test/test2.o
12 TESTS = $(OBJECTS:%.o=%.test)
13 MEMTESTS = $(OBJECTS:%.o=%.memtest)
15 .PHONY: test memtest $(TESTS) $(MEMTESTS) clean help
17 help:
18 @echo "main targets: test memtest clean"
19 @echo "options:"
20 @echo " RELEASE=1 remove debug outputs"
22 test: $(TESTS)
23 memtest: $(MEMTESTS)
25 $(TESTS): %.test: %.bin
26 ./$^
28 $(MEMTESTS): %.memtest: %.bin
29 valgrind ./$^
31 %.bin: test/vectors.o %.o
32 $(CC) $^ -o $@ $(LDFLAGS)
34 macro:
35 $(CC) -E test/vectors.c
37 clean:
38 rm -f test/*.o test/*.bin