forked from ioccc-src/winner
-
Notifications
You must be signed in to change notification settings - Fork 8
/
1337.mk
173 lines (142 loc) Β· 4.35 KB
/
1337.mk
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
########################
# extended utility rules
########################
.PHONY: indent_clean indent_clobber install
# you may be able to misunderstand the source by reading indent.c
#
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no indent tool found, ident $< yourself, sorry"; \
echo "exit 17"; \
exit 17; \
fi
indent_clean: clean
@-if [ -f indent.c ]; then \
echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
indent_clobber: indent_clean clobber
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
echo 'ate sandwich'; \
fi
install:
@echo "Dr. Spock says that is not logical!"
@${TRUE}
#####################
# make a difference #
#####################
.PHONY: diff_orig_prog diff_prog_orig diff_alt_prog diff_prog_alt diff_orig_alt diff_alt_orig
# diff orig source and source
#
diff_orig_prog: ${PROG}.orig.c ${PROG}.c
@-${DIFF} -u ${PROG}.orig.c ${PROG}.c
# diff source and orig source
#
diff_prog_orig: ${PROG}.c ${PROG}.orig.c
@-${DIFF} -u ${PROG}.c ${PROG}.orig.c
# diff alt source and source
#
diff_alt_prog: ${PROG}.c
@-if [[ -e ${PROG}.alt.c ]]; then \
${DIFF} -u ${PROG}.alt.c ${PROG}.c; \
fi
# diff source and alt source
#
diff_prog_alt: ${PROG}.c
@-if [[ -e ${PROG}.alt.c ]]; then \
${DIFF} -u ${PROG}.c ${PROG}.alt.c; \
fi
# diff orig and alt
#
diff_orig_alt: ${PROG}.orig.c
@-if [[ -e ${PROG}.alt.c ]]; then \
${DIFF} -u ${PROG}.orig.c ${PROG}.alt.c; \
fi
# diff alt and orig
diff_alt_orig:
@-if [[ -e ${PROG}.alt.c ]]; then \
${DIFF} -u ${PROG}.alt.c ${PROG}.orig.c; \
fi
#############################################################
# NOTE: 'Don't Panic' if you don't understand the stuff below
#############################################################
##################
# 133t hacker rulz
##################
.PHONY: love haste waste maker easter_egg sandwich supernova more_magic magic charon pluto
love:
@echo 'not war?'
waste:
@echo $@
haste:
@echo make waste
@${MAKE} waste
maker: haste
@echo 'Participate in a maker faire'
@echo make love
@${MAKE} love
easter_egg: maker
@echo "You are expected to often misunderstand this $${RANDOM} magic, Eggy π₯!"
@echo "chongo '<was here>' /\\oo/\\"
@echo "p.s.: Careful with That Axe, Eugene!"
sandwich: easter_egg
@if [[ $$(id -u) -eq 0 ]]; then \
echo 'Okay π₯ͺ.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
echo "Did you forget the magic word?"; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [[ -r .code_analysis ]]; then \
${RM} -f .code_analysis_v7; \
else \
echo "Planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ π₯ helps ${MAKE} the elements that help form planets"
more_magic: supernova
@-if [[ -r .code_analysis ]]; then \
ccode_analysis --more_magic dd268dbcaac550362d98c384c4e576ccc8b1536847b6bbb31023b4c8caee0535 \
--FNV1a_hash_256_bit -v3 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 1; \
echo "Wrong! Do it again!"; \
sleep 1; \
echo "Wrong! Do it again!"; \
fi
magic: more_magic
@-if [[ -r .code_analysis ]]; then \
ccode_analysis --level 20003 --mode 5718856 --FNV1a_hash_256_bit -v3 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet πͺ"
@echo "Dwarf planets πͺπͺ are a type of planet πͺ"
@echo "Therefore IAU, $@ is a planet πͺ"
pluto: charon
@echo "See https://www.hou.usra.edu/meetings/lpsc2017/pdf/1448.pdf"
@echo "for a good definition of a planet"
@echo "$@ is a dwarf planet πͺ"
@echo "Dwarf planets πͺπͺ are a type of planet πͺ"
@echo "Therefore, $@ is a planet πͺ"
@echo "The geophysical definition of planet gives us ~110 planets πͺπͺ in our solar system"