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:
10
Makefile
10
Makefile
@@ -1,18 +1,18 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -ansi -pedantic -Wall -Wno-overlength-strings -Werror -O3 -g
|
CFLAGS = -std=c11 -Wall -Wextra -Werror -O3 -g
|
||||||
|
|
||||||
TESTS = $(wildcard tests/*.c)
|
TESTS = $(wildcard tests/*.c)
|
||||||
EXAMPLES = $(wildcard examples/*.c)
|
EXAMPLES = $(wildcard examples/*.c)
|
||||||
EXAMPLESEXE = $(EXAMPLES:.c=)
|
EXAMPLESEXE = $(EXAMPLES:.c=)
|
||||||
|
|
||||||
all: $(EXAMPLESEXE) check
|
all: $(EXAMPLESEXE) check
|
||||||
|
|
||||||
check: $(TESTS) mpc.c
|
check: $(TESTS) mpc.c
|
||||||
$(CC) $(CFLAGS) $^ -lm -o test
|
$(CC) $(filter-out -Werror, $(CFLAGS)) $^ -lm -o test
|
||||||
./test
|
./test
|
||||||
|
|
||||||
examples/%: examples/%.c mpc.c
|
examples/%: examples/%.c mpc.c
|
||||||
$(CC) $(CFLAGS) $^ -lm -o $@
|
$(CC) $(CFLAGS) $^ -lm -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm test
|
rm -rf test examples/doge examples/lispy examples/maths examples/smallc
|
||||||
|
Reference in New Issue
Block a user