-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
142 lines (106 loc) · 3.63 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
##############################################################################
CC = gcc
CPPFLAGS =
CFLAGS = -march=native -O3 -funroll-loops -fpic -fstack-protector-all \
-Wall -Wextra -Werror -Wno-deprecated-declarations #-Og -g
LDFLAGS = -L. -lsp -llzma -lX11 -lm
REASON = @if [ -f $@ ]; then echo "[$@: $?]"; else echo "[$@]"; fi
.PHONY: tags depend clean distclean
.SUFFIXES: .png .pbm
.c.o:
$(REASON)
$(COMPILE.c) $< $(OUTPUT_OPTION)
.png.pbm:
$(REASON)
pngtopnm $< | ppmtopgm| pgmtopbm > $@
################################################################################
all: spres spclr tty2sp pbm2sp pbms2sp robots bubbles disks tunnel eyes airport watch
pbm: frame-01.pbm frame-02.pbm frame-03.pbm frame-04.pbm frame-05.pbm \
frame-06.pbm frame-07.pbm frame-08.pbm frame-09.pbm frame-10.pbm \
frame-11.pbm frame-12.pbm frame-13.pbm frame-14.pbm frame-15.pbm \
frame-16.pbm frame-17.pbm frame-18.pbm frame-19.pbm
spres: spres.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
spclr: spclr.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
tty2sp: tty2sp.o display_text.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
pbm2sp: pbm2sp.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
pbms2sp: pbms2sp.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
robots: robots.o robots_auto.o robots_bsd.o term.o port.o display_text.o display.o \
display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
bubbles: bubbles.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
disks: disks.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
tunnel: tunnel.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
eyes: eyes.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
airport: airport.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
watch: watch.o display_text.o display.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnetpbm
################################################################################
graphix_test: graphix_test.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
sp_test: sp_test.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
display_graphix_test: display_graphix_test.o display_graphix.o graphix.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
display_test: display_test.o display.o display_graphix.o graphix.o servicepoint.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
display_text_test: display_text_test.c display_text.o display.o display_graphix.o graphix.o servicepoint.o
$(REASON)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
################################################################################
test: test_offline test_online
test_offline: graphix_test display_graphix_test display_test
$(REASON)
graphix_test
display_graphix_test
display_test gx
test_online: spclr sp_test servicepoint_test display_test
$(REASON)
spclr
sp_test
spclr
servicepoint_test
spclr
display_test sp
spclr
display_test
################################################################################
tags:
$(REASON)
ctags --format=2 -o $@ *.h *.c
deps depend: *.h *.c
$(REASON)
$(CC) -MM $(CPPFLAGS) *.c > deps
clean:
$(REASON)
$(RM) *.o *~ *_test *.pbm
distclean: clean
$(REASON)
git clean -xdf
-include deps
################################################################################