Fixed make throwing error on repeated invokation of make clean, added example executables to clean list.

Filtered out -Werror on compilation of ptest.c (was thowing errors).
This commit is contained in:
Dalton Woodard
2014-10-14 22:33:21 -07:00
parent 0963ddab1b
commit 1a6ed8de32

View File

@@ -1,18 +1,18 @@
CC = gcc
CFLAGS = -ansi -pedantic -Wall -Wno-overlength-strings -Werror -O3 -g
CFLAGS = -std=c11 -Wall -Wextra -Werror -O3 -g
TESTS = $(wildcard tests/*.c)
EXAMPLES = $(wildcard examples/*.c)
EXAMPLESEXE = $(EXAMPLES:.c=)
all: $(EXAMPLESEXE) check
check: $(TESTS) mpc.c
$(CC) $(CFLAGS) $^ -lm -o test
$(CC) $(filter-out -Werror, $(CFLAGS)) $^ -lm -o test
./test
examples/%: examples/%.c mpc.c
$(CC) $(CFLAGS) $^ -lm -o $@
clean:
rm test
rm -rf test examples/doge examples/lispy examples/maths examples/smallc