-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
36 lines (26 loc) · 867 Bytes
/
Makefile
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
.PHONY: all clean
CFLAGS := -Wall -Wextra -pedantic -std=c99 -g3 #-Wno-unused-parameter
ifdef DECIMAL_TEN
CFLAGS += -DDECIMAL_TEN
endif
all: sol spider freecell
#canfield:
sol: sol.c sol.h schemes.h
$(CC) $(CFLAGS) -DKLONDIKE $< -o $@
spider: sol.c sol.h schemes.h
$(CC) $(CFLAGS) -DSPIDER sol.c -o $@
freecell: sol.c sol.h schemes.h
$(CC) $(CFLAGS) -DFREECELL sol.c -o $@
clean:
rm -f sol spider freecell
.PHONY: getfuns test
getfuns: sol.c
@grep -o '^\w.* \w.*(.*)[^/]*{\|^#if.*\|^#e[ln].*' $<|sed 's/ *{$$/;/' \
| perl -0777 -pe 's{#if[^\n]*\n(#elif[^\n]*\n)?#endif[^\n]*\n}{}igs'
test:
@grep -n --color=always 'TODO\|XXX' README.md sol.*
longtest: test
sed 's/\t/ /g' sol.c|grep -n --color=always '^.\{81\}'|awk '{print "\033[35msol.c\033[36m:" $$0}'
.PHONY: frtest # TODO: remove me
frtest:
$(MAKE) test | grep FREECELL --color=always