2014-10-14 23:16:11 -07:00
|
|
|
|
2013-09-19 20:57:40 +01:00
|
|
|
CC = gcc
|
2014-10-15 16:23:59 -07:00
|
|
|
STND=-ansi
|
2015-11-09 13:34:39 +00:00
|
|
|
CFLAGS = $(STND) -pedantic -O3 -g -Wall -Werror -Wextra -Wformat=2 -Wshadow \
|
2015-03-10 10:44:29 +00:00
|
|
|
-Wno-long-long -Wno-overlength-strings -Wno-format-nonliteral -Wcast-align \
|
|
|
|
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Wredundant-decls \
|
|
|
|
-Wnested-externs -Wmissing-include-dirs -Wswitch-default
|
2014-10-14 23:16:11 -07:00
|
|
|
|
2013-09-19 20:57:40 +01:00
|
|
|
TESTS = $(wildcard tests/*.c)
|
2014-01-26 11:25:50 +00:00
|
|
|
EXAMPLES = $(wildcard examples/*.c)
|
|
|
|
EXAMPLESEXE = $(EXAMPLES:.c=)
|
2013-09-19 20:57:40 +01:00
|
|
|
|
2014-01-26 11:25:50 +00:00
|
|
|
all: $(EXAMPLESEXE) check
|
2014-10-14 22:33:21 -07:00
|
|
|
|
2013-09-19 20:57:40 +01:00
|
|
|
check: $(TESTS) mpc.c
|
2014-10-14 22:33:21 -07:00
|
|
|
$(CC) $(filter-out -Werror, $(CFLAGS)) $^ -lm -o test
|
2013-09-19 20:57:40 +01:00
|
|
|
./test
|
2014-10-14 22:33:21 -07:00
|
|
|
|
2014-01-26 11:25:50 +00:00
|
|
|
examples/%: examples/%.c mpc.c
|
|
|
|
$(CC) $(CFLAGS) $^ -lm -o $@
|
|
|
|
|
2013-09-19 20:57:40 +01:00
|
|
|
clean:
|
2016-05-04 10:32:02 +05:30
|
|
|
rm -rf test examples/doge examples/lispy examples/maths examples/smallc \
|
|
|
|
examples/foobar examples/tree_traversal
|