Files
ioccc/2014/iocccsize.mk
Landon Curt Noll c0663537cb Add preview of 1984-2019
The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.

One will find HTML commented out with:

    <!-- XXX remove when 2020 is ready
    2020 links here
    XXX remove when 2020 is ready -->

The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks.  Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known.  The following files
have such HTML comment blocks in them.

    ./winners.html
    ./years-spoiler.html
    ./years.html

In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.

The 2020 winner code AND write-ups are NOT part of this set.

p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).
2020-12-30 16:57:03 -08:00

72 lines
1.8 KiB
Makefile

.POSIX :
#######################################################################
CFLAGS := -pedantic -Wall -std=c99 -g
LDFLAGS :=
LIBS :=
IT := iocccsize
#######################################################################
all: ${IT}$E
${IT}$E: ${IT}.c
${CC} ${CFLAGS} -o ${IT}$E ${IT}.c
#
# Exercise the IOCCC size tool.
#
test: test-k test-wc test-rcount
#
# -k should pass through the source with block comments intact.
#
test-k: ${IT}$E
@{ t="-k keep comments" ;\
if ./${IT} -k <${IT}.c 2>/dev/null | diff - ${IT}.c ; then echo "-OK- $$t" ; else echo "FAIL $$t" ; fi ;\
}
#
# First 3 counters should match wc(1)
#
test-wc: ${IT}$E
@{ t="wc counts" ;\
a=$$(./${IT} -s -k <${IT}.c 2>&1 | cut -d' ' -f1-3) ;\
b=$$(wc ${IT}.c | sed -e's/^ *//; s/ */ /g' | cut -d' ' -f1-3) ;\
if [ "$$a" = "$$b" ]; then echo "-OK- $$t"; else echo "FAIL $$t: expected '$$b', got '$$a'"; fi ;\
}
#
# Show counters for different option combinations.
#
test-show: ${IT}$E
./${IT} -s <${IT}.c
./${IT} -s -r <${IT}.c
./${IT} -s -k <${IT}.c
./${IT} -s -r -k <${IT}.c
#
# Reserved word counter should be same for all option combinations.
#
test-rcount: ${IT}$E
@{ t="rcount" ;\
./${IT} -s <${IT}.c 2>&1 | cut -d" " -f 6 >/tmp/$$$$.tmp ;\
./${IT} -s -r <${IT}.c 2>&1 | cut -d" " -f 6 >>/tmp/$$$$.tmp ;\
./${IT} -s -k <${IT}.c 2>&1 | cut -d" " -f 6 >>/tmp/$$$$.tmp ;\
./${IT} -s -r -k <${IT}.c 2>&1 | cut -d" " -f 6 >>/tmp/$$$$.tmp ;\
n=$$(sort -u /tmp/$$$$.tmp | wc -l | sed -e's/^ *//') ;\
if [ $$n -eq 1 ]; then echo "-OK- $$t"; else echo "FAIL $$t: expected 1 unique line, got $$n"; echo "see make test-show"; fi ;\
rm -f /tmp/$$$$.tmp ;\
}
clean:
rm -f iocccsize.o
rm -rf iocccsize.dSYM
clobber: clean
rm -f iocccsize
install:
@echo "no thank you on the install :-)"