From c7ce2a79cb221a8f0c6d9feca05393c559d67660 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Mon, 19 Sep 2022 00:39:54 -0700 Subject: [PATCH] Update 1998-2004 top level Makefiles --- 1988/Makefile | 391 ++++++++++++++++++++++++------- 1989/Makefile | 378 ++++++++++++++++++++++++------ 1990/Makefile | 363 ++++++++++++++++++++++++----- 1991/Makefile | 411 ++++++++++++++++++++++++--------- 1992/Makefile | 499 +++++++++++++++++++++++----------------- 1993/Makefile | 421 ++++++++++++++++++++++++---------- 1994/Makefile | 440 +++++++++++++++++++++++------------ 1995/Makefile | 400 ++++++++++++++++++++++++-------- 1996/Makefile | 440 ++++++++++++++++++++++++----------- 1998/Makefile | 448 ++++++++++++++++++++++++------------ 2000/Makefile | 479 +++++++++++++++++++++++--------------- 2001/Makefile | 430 +++++++++++++++++++++------------- 2004/Makefile | 622 +++++++++++++++++++++++--------------------------- 13 files changed, 3856 insertions(+), 1866 deletions(-) diff --git a/1988/Makefile b/1988/Makefile index b85fd9cc0..986aa8975 100644 --- a/1988/Makefile +++ b/1988/Makefile @@ -1,87 +1,318 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1988 makefile +# 1988 Makefile + +################################################################################ # -# Copyright (c) 1988, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CFLAGS=-O -CC=cc -CPP=/lib/cpp -# you may need a version of cpp that is faster and/or allows more symbols -# than the standard cpp. If so, adjust the BIG_CPP below. +# An Historical Makefile NOTE: # -# If you have the GNU cpp, you should use it below as it is MUCH faster -# than the standard cpp and does not have problems with memory usage. -# However you should note that the non-ANSI nature of defining symbols -# that start with '#' prevents GNU cpp from doing the initial pass. -# Thus you should not use the GNU cpp for the ${CPP} symbol. -BIG_CPP=${CPP} - -WINNERS=dale phillipps robison westley reddy isaak \ - litmaath spinellis zsmall - -all: ${WINNERS} - -dale: dale.c - ${CC} ${CFLAGS} $? -o $@ -phillipps: phillipps.c - ${CC} ${CFLAGS} $? -o $@ -robison: robison.c - ${CC} ${CFLAGS} $? -o $@ -westley: westley.c - ${CC} ${CFLAGS} $? -o $@ -reddy: reddy.c - ${CC} ${CFLAGS} $? -o $@ -isaak: isaak.c - ${CC} ${CFLAGS} -DI=B -DO=- -Dy $? -o $@ -litmaath: litmaath.c - ${CC} ${CFLAGS} $? -o $@ -spinellis: spinellis.c spinellis.data - @echo This program can not be portably compiled with a makefile - @echo because it reads from /dev/tty. - @echo Compile this program with: cc spinellis.c -o spinellis - @echo and type the following text followed by an EOF '(^D)'. - @cat spinellis.data - @-if [ ! -f spinellis ]; then \ - touch spinellis; \ - fi - -# not an official entry +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# The 'zsmall.c' program was obtained from 'applin.c' by reducing its recursion -# and running it thru the initial /lib/cpp. That is, 'zsmall.c' is a small -# version of the 'z.c' file as produced by the 'applin' make rule below. -zsmall: zsmall.c - @echo this reduced version of applin.c can take some time to compile... - ${CC} ${CFLAGS} zsmall.c -o $@ +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -# This entry took 75 minutes to compile on a Amdahl 5980-300E -# (a 55658 Dhyrstone/sec/cpu machine) using the System V cpp. -# (The GNU cpp when defined as BIG_CPP took only 45 seconds) -# Your cpp may not be able to compile it due to a common bug -# that results in ${CPP} running out of space. The routine -# 'zsmall' is a smaller version of the applin.c entry. -applin: applin.c - ${CPP} '-DM=#include "z.c"' '-DR=#include' '-DF=#if' \ - '-DI=#ifdef' '-DL=#else' '-DE=#endif' '-DN=#ifndef' \ - '-DD=#define' '-DU=#undef' applin.c z.c - @echo this is going to take a very very long time to C-preprocess - @echo perhaps you should do: make zsmall instead - ${BIG_CPP} z.c > large.c - @echo now for the real compile... - ${CC} ${CFLAGS} large.c -o $@ +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ + +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make + + +############### +# IOCCC winners +############### +# +WINNERS= applin dale isaak litmaath phillipps reddy robison spinellis westley + +YEAR= 1988 + +################### +# build all entries +################### +# +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### +# clean: - rm -f core *.o -clobber: clean - rm -f ${WINNERS} applin -nuke: clobber - rm -f large.c z.c -install: all - cat ${WINNERS} > /dev/null + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1989/Makefile b/1989/Makefile index 51237183d..a912d6278 100644 --- a/1989/Makefile +++ b/1989/Makefile @@ -1,90 +1,318 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1989 makefile +# 1988 Makefile + +################################################################################ # -# Copyright (c) 1989, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. +# An Historical Makefile NOTE: +# +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. +# +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ + +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL=/bin/sh -CFLAGS=-O -CC=cc +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make -WINNERS=ovdluhe jar.1 jar.2 fubar westley paul robison roemer vanb tromp.bsd -ALTERNATE=jar.1.orig fubar.orig tromp.s5 -all: ${WINNERS} +############### +# IOCCC winners +############### +# +WINNERS= fubar jar.1 jar.2 ovdluhe paul robison roemer tromp vanb westley -ovdluhe: ovdluhe.c - ${CC} ${CFLAGS} $? -o $@ +YEAR= 1989 -# NOTE: jar.1.c outputs its string in one section -# this program may not print well on some terminals -jar.1: jar.1.c jar.1.sh - rm -f jar.1 - cp jar.1.sh jar.1 - chmod +x jar.1 -# NOTE: The jar.1.orig file is the original entry -jar.1.orig: jar.1.orig.c jar.1.orig.sh - rm -f jar.1.orig - cp jar.1.sh jar.1.orig - chmod +x jar.1.orig +################### +# build all entries +################### +# +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -jar.2: jar.2.c - ${CC} ${CFLAGS} $? -o $@ +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -# NOTE: fubar.c uses the /bin/sh shell -fubar: fubar.c fubar.sh - rm -f fubar - cp fubar.sh fubar - chmod +x fubar -# NOTE: The fubar.orig.c file is the original entry -fubar.orig: fubar.orig.c fubar.orig.sh - rm -f fubar.orig - cp fubar.orig.sh fubar.orig - chmod +x fubar.orig +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -westley: westley.c - ${CC} ${CFLAGS} -Dtrgpune=putchar $? -o $@ +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -paul: paul.c - ${CC} ${CFLAGS} $? -o $@ +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -robison: robison.c - ${CC} ${CFLAGS} $? -o $@ - -roemer: roemer.c - ${CC} ${CFLAGS} $? -o $@ - -# NOTE: this version requires BSD style signals and setitimer -# this may not work well on low baud rate terminals -# the file tromp.bsd.c is the original version -tromp: tromp.bsd.c - ${CC} ${CFLAGS} $? -o $@ - touch HI - -chmod 0666 HI -# NOTE: sites without BSD style signals and setitimer (e.g. System V.3) -# should use this version -tromp.s5: tromp.s5.c - ${CC} ${CFLAGS} $? -o $@ - touch HI - -chmod 0666 HI - -vanb: vanb.c - ${CC} ${CFLAGS} $? -o $@ +############### +# utility rules +############### +# clean: - rm -f ovdluhe.o jar.2.o fubar.o westley.o paul.o robison.o - rm -f roemer.o tromp.o vanb.o - rm -f x x1 ouroboros.c ouroboros.o fubar.orig.o tromp.bsd.o tromp.s5.o core -clobber: clean - rm -f ${WINNERS} - rm -f jar.1.o HI - rm -f ${ALTERNATE} -nuke: clobber - @true -install: all - cat ${WINNERS} > /dev/null + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1990/Makefile b/1990/Makefile index 52737000f..4030026f1 100644 --- a/1990/Makefile +++ b/1990/Makefile @@ -1,73 +1,318 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1990 makefile +# 1990 Makefile + +################################################################################ # -# Copyright (c) 1990, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +# An Historical Makefile NOTE: # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -WINNERS=cmills pjr westley stig tbr db dds theorem baruch jaw scjones +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ + +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make + + +############### +# IOCCC winners +############### +# +WINNERS= baruch cmills dds dg jaw pjr scjones stig tbr theorem westley + +YEAR= 1990 + +################### +# build all entries +################### +# all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -ansi: - ${MAKE} -f ansi.mk all +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -common: - ${MAKE} -f common.mk all +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -${WINNERS}: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk $@; \ - ${MAKE} -k -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk $@; \ - ${MAKE} -k -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1991/Makefile b/1991/Makefile index 57c7302a6..226b224a7 100644 --- a/1991/Makefile +++ b/1991/Makefile @@ -1,129 +1,318 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1991 makefile +# 1991 Makefile + +################################################################################ # -# Copyright (c) 1991, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. +# An Historical Makefile NOTE: +# +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. +# +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ + +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL=/bin/sh -MAKE=make -MAKEFLAGS=e - -# uncomment the line to select the preferred type of compile +################ +# tool locations +################ # -# You should also check the ansi.mk or common.mk for the -# proper compiler name and flags. -# -# NOTE ==> USE=ansi compile with an ANSI compiler by default -#USE=ansi -# NOTE ==> USE=common compile with a common K&R compiler by default -#USE=common +SHELL= /bin/bash +MAKE= make + +############### +# IOCCC winners +############### +# WINNERS= ant brnstnd buzzard cdupont davidguy dds fine rince westley +YEAR= 1991 + +################### +# build all entries +################### +# all: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -k -f common.mk all; \ - ${MAKE} -k -f common.mk all; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -k -f ansi.mk all; \ - ${MAKE} -k -f ansi.mk all; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1; \ - fi + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -ansi: - ${MAKE} -f ansi.mk all +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -common: - ${MAKE} -f common.mk all +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -${WINNERS} merlyn.c nextmove.c ttt_game.c: - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -ttt: ttt.sh - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -merlyn: merlyn.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@ \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi - -ttt_game: ttt_game.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi - -nextmove: nextmove.c - -@if [ "${USE}" = "common" ]; then \ - echo ${MAKE} -f common.mk $@; \ - ${MAKE} -f common.mk $@; \ - elif [ "${USE}" = "ansi" ]; then \ - echo ${MAKE} -f ansi.mk $@; \ - ${MAKE} -f ansi.mk $@; \ - else \ - echo "set USE= in Makefile to be ansi or common as desired"; \ - echo "or type: make -f ansi.mk for ansi makes"; \ - echo "or type: make -f common.mk for common K&R makes"; \ - exit 1;\ - fi +############### +# utility rules +############### +# clean: - ${MAKE} -f ansi.mk clean - ${MAKE} -f common.mk clean + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + clobber: - ${MAKE} -f ansi.mk clobber - ${MAKE} -f common.mk clobber -nuke: clobber - ${MAKE} -f ansi.mk nuke - ${MAKE} -f common.mk nuke + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + install: - ${MAKE} -f ansi.mk install - ${MAKE} -f common.mk install + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1992/Makefile b/1992/Makefile index 2eb115d13..f576b6dd3 100644 --- a/1992/Makefile +++ b/1992/Makefile @@ -1,244 +1,319 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1992 makefile +# 1992 Makefile + +################################################################################ # -# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln -UNIQ=uniq -CB=cb -GREP=grep -# set this to where your C Processor resides +# An Historical Makefile NOTE: # -# On some systems: -# CPP=/lib/cpp +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -CPP=/usr/ccs/lib/acpp - -# flags for ansi compiles +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# Regarding individual entries: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS=-O -Xa -CFLAGS=-Xa -CC=cc - -# misc shell babble +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +# GitHub pull requests are welcome: # -WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ - lush marangon nathan vern westley -ALT_NAMES= adgrep am babble first ag whereami - -all: $(WINNERS) $(ALT_NAMES) - -adrian: adrian.c - $(CC) $(CFLAGS) adrian.c -o adrian - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c - $(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp - -./adrian ad.temp adwc.c - $(CC) -o adwc adwc.c - $(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp - -./adrian ad.temp adbasename.c - $(CC) -o adbasename adbasename.c - $(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp - -./adrian ad.temp adecho.c - $(CC) -o adecho adecho.c - $(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp - -./adrian ad.temp adhead.c - $(CC) -o adhead adhead.c - $(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp - -./adrian ad.temp adsleep.c - $(CC) -o adsleep adsleep.c - $(RM) -f ad.temp - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. # -adrian.orig: adrian.orig.c - $(CC) $(CFLAGS) adrian.orig.c -o adrian.orig - -albert: albert.c - $(CC) $(CFLAGS) albert.c -o albert - -# NOTE: this is the original source that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -albert.orig: albert.orig.c - $(CC) $(CFLAGS) albert.orig.c -o albert.orig - -ant: ant.c - $(CC) $(CFLAGS) ant.c -o ant - -buzzard.1: buzzard.1.c - $(CC) $(CFLAGS) buzzard.1.c -o buzzard.1 - -babble.cppcb: buzzard.1.c - $(NOINCLUDE) buzzard.1.c | \ - $(CPP) $(CPPFLAGS) | \ - $(CPPCLEAN) | \ - $(CB) $(CBFLAGS) | \ - $(UNIQ) | \ - $(SPACECLEAN) > babble.cppcb 2>&1 - -buzzard.2: buzzard.2.c - $(CC) $(CFLAGS) buzzard.2.c -o buzzard.2 - -# NOTE: this is the original source that won +# https://github.com/ioccc-src/winner # -buzzard.2.orig: buzzard.2.orig.c - $(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig +################################################################################ -gson: gson.c - $(CC) $(CFLAGS) gson.c -o gson - -# NOTE: some systems may only need: +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -kivinen: kivinen.c - $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl +# See: http://creativecommons.org/licenses/by-sa/3.0/ -# NOTE: this is the original program that won + +################ +# tool locations +################ # -# NOTE: some systems may only need: +SHELL= /bin/bash +MAKE= make + + +############### +# IOCCC winners +############### # -# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 +WINNERS= adrian albert ant buzzard1 buzzard2 gson imc kivinen lush marangon \ + nathan vern westley + +YEAR= 1992 + +################### +# build all entries +################### # -kivinen.orig: kivinen.orig.c - $(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ - -lsocket -lresolv -lnsl +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -imc: imc.c - $(CC) $(CFLAGS) imc.c -o imc +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -# NOTE: this is the original program that won +# alternative executable # -imc.orig: imc.orig.c - $(CC) $(CFLAGS) imc.orig.c -o imc.orig +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -lush: lush.c - $(CC) $(CFLAGS) lush.c -o lush - -lush.again: lush.c - $(CC) $(CFLAGS) lush.c -o lush.again - $(RM) -f lush.again - -# NOTE: this is the original program that won +# data files # -lush.orig: lush.orig.c - $(CC) $(CFLAGS) lush.orig.c -o lush.orig +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -# NOTE: some systems may need: +# both all and alt # -# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### # -marangon: marangon.c - $(CC) $(CFLAGS) marangon.c -o marangon -lcurses - -# NOTE: this is the original program that won -# -# NOTE: some systems may need: -# -# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap -# -marangon.orig: marangon.orig.c - $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses - -nathan: nathan.c - $(CC) $(CFLAGS) nathan.c -o nathan - -# NOTE: this is the original program that won -# -nathan.orig: nathan.orig.c - $(CC) $(CFLAGS) nathan.orig.c -o nathan.orig - -vern: vern.tmp.c - $(CC) $(CFLAGS) vern.tmp.c -o vern - -vern.tmp.c: vern.c - $(RM) -f vern.tmp.c - $(SED) vern.tmp.c - -# NOTE: this is the original program that won -# -vern.orig: vern.orig.tmp.c - $(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig - -vern.orig.tmp.c: vern.orig.c - $(RM) -f vern.orig.tmp.c - $(SED) vern.orig.tmp.c - -westley: westley.c - $(CC) $(CFLAGS) westley.c -o westley - -# alternate names for selected entries -# -adgrep: adrian - $(RM) -f adgrep - $(LN) adrian adgrep -am: ant - $(RM) -f am - $(LN) ant am -babble: buzzard.1 - $(RM) -f babble - $(LN) buzzard.1 babble -first: buzzard.2 - $(RM) -f first - $(LN) buzzard.2 first -ag: gson - $(RM) -f ag - $(LN) gson ag -whereami: westley - $(RM) -f whereami - $(LN) westley whereami - clean: - $(RM) -f *.o a.out core - $(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c - $(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -am_clobber: clean am - $(RM) -f am.safe - $(CP) am am.safe - $(RM) -f $(WINNERS) a.out - $(RM) -f $(ALT_NAMES) - $(RM) -f adwc adbasename adecho adhead adsleep - $(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig - $(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig - $(CP) am.safe am - $(RM) -f am.safe +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @true +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - cat $(WINNERS) > /dev/null + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1993/Makefile b/1993/Makefile index daa03a5ec..719472876 100644 --- a/1993/Makefile +++ b/1993/Makefile @@ -1,147 +1,318 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1993 makefile +# 1993 Makefile + +################################################################################ # -# Copyright (c) 1993, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. +# An Historical Makefile NOTE: +# +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. +# +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ + +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -SED=sed -LN=ln +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make -# flags for ANSI compiles -# -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. -# -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. -# -#CFLAGS=-O -Xa -#CFLAGS=-Xa -CFLAGS= -ansi -#CFLAGS= -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -#CC=cc -CC=gcc - -# misc shell babble -# -NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' -SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' -CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' - -# winners that compile under ANSI C +############### +# IOCCC winners +############### # WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb -ALT_NAMES= ag ag.txt chris mind jkb -all: $(WINNERS) $(ALT_NAMES) +YEAR= 1993 -ant: ant.c - ${CC} ${CFLAGS} ant.c -o ant - -cmills: cmills.c - ${CC} ${CFLAGS} cmills.c -o cmills -lX11 - -dgibson: dgibson.c dgibson.sh dgibson.data1 - -@if [ ! -f life.d ] ; then \ - echo "cp dgibson.data1 life.d"; \ - cp dgibson.data1 life.d; \ - echo "rm -f data.name"; \ - rm -f data.name; \ - echo "echo dgibson.data1 > data.name"; \ - echo dgibson.data1 > data.name; \ - fi - ${CC} ${CFLAGS} dgibson.c -o dgibson - -${CHMOD} +x dgibson.sh - -ejb: ejb.c - ${CC} ${CFLAGS} ejb.c -o ejb - -jonth: jonth.c - ${RM} -f jonth.tmp.c - ${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c - ${CC} ${CFLAGS} \ - -DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \ - -DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \ - jonth.tmp.c -o jonth -lX11 - -leo: leo.c - ${CC} ${CFLAGS} leo.c -o leo - -lmfjyh: lmfjyh.c - ${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c - ${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c - ${CC} ${CFLAGS} \ - \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \ - -o lmfjyh - -plummer: plummer.c - ${CC} ${CFLAGS} plummer.c -o plummer - -rince: rince.c - ${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince - -# NOTE: this is the original source that won +################### +# build all entries +################### # -rince.orig: rince.orig.c - $(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -schnitzi: schnitzi.c - ${CC} ${CFLAGS} schnitzi.c -o schnitzi +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -vanb: vanb.c - ${CC} ${CFLAGS} -DO5=main vanb.c -o vanb - - -# alternate names for selected entries +# alternative executable # -ag: ant - $(RM) -f ag - $(LN) ant ag +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -ag.txt: ant.txt - $(RM) -f ag.txt - $(LN) ant.txt ag.txt +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -chris: cmills - $(RM) -f chris - $(LN) cmills chris +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -mind: leo - $(RM) -f mind - $(LN) leo mind - -jkb: rince - $(RM) -f jkb - $(LN) rince jkb - -tidy: - ${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean tidy - $(RM) -f $(WINNERS) - $(RM) -f $(ALT_NAMES) - ${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2 +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @true +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - cat $(WINNERS) > /dev/null +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1994/Makefile b/1994/Makefile index 69f3bea69..575c7b45f 100644 --- a/1994/Makefile +++ b/1994/Makefile @@ -1,158 +1,318 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1994 makefile +# 1994 Makefile + +################################################################################ # -# Copyright (c) 1994, Landon Curt Noll & Larry Bassel. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Larry Bassel. - - -SHELL=/bin/sh -CAT=cat -CHMOD=chmod -CP=cp -ECHO=echo -GUNZIP=gunzip -UUDECODE=uudecode -LN=ln -RM=rm -SED=sed -TRUE=true - -# flags for ANSI compiles +# An Historical Makefile NOTE: # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE: Some compilers cannot optimize, or optimize some entries -# entries incorrectly. You might want need to turn on -O -# to see if your compiler can handle them. +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -#CFLAGS=-O -Xa -#CFLAGS=-Xa -#CFLAGS= -ansi -CFLAGS= -ansi -O -#CFLAGS= - -# ANSI compiler +# Regarding individual entries: # -# Set CC to the name of your ANSI compiler. -#CC=cc -CC=gcc - -# winners that compile under ANSI C +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -WINNERS= dodsond1 dodsond2 horton imc ldb schnitzi shapiro smr tvr weisberg \ - westley -ALT_NAMES= dodsond2.orig shapiro.alt horton.alt gtface weisberg.alt tvr.alt - -all: $(WINNERS) $(ALT_NAMES) - -westley: westley.c - ${CC} ${CFLAGS} westley.c -DO -o westley - -weisberg: weisberg.c - ${CC} ${CFLAGS} -Dc='n*n>x?p:((m=*(b+1)),N))' \ - -De='(2<<6*sizeof(int))' \ - -Do='(8<<5*sizeof(int))' \ - -DN='((b=t+1),x+=2,x>e?exit():o' \ - -Dp='(a-t shapiro_t2.c - -shapiro_t1: shapiro.c - ${CC} ${CFLAGS} shapiro.c -o shapiro_t1 - -shapiro.alt: shapiro.alt.c - ${CC} ${CFLAGS} shapiro.alt.c -o shapiro.alt - -schnitzi: schnitzi.c - ${CC} ${CFLAGS} schnitzi.c -o schnitzi - -horton: horton.c - ${CC} ${CFLAGS} horton.c -o horton - -# Here are some programs related to the horton entry. See horton.hint -# for details. +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. # -horton.alt: horton.alt.c - ${CC} ${CFLAGS} horton.alt.c -o horton.alt -gtface: gtface.c - ${CC} ${CFLAGS} gtface.c -o gtface - -ldb: ldb.c - ${CC} ${CFLAGS} ldb.c -o ldb - -imc: imc.c - ${CC} ${CFLAGS} imc.c -o imc - -dodsond2: dodsond2.c - ${CC} ${CFLAGS} dodsond2.c -o dodsond2 - -# NOTE: this is the original (gziped) file that won +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -dodsond2.orig: dodsond2.gz - @${RM} -f dodsond2.orig.c - -${GUNZIP} < dodsond2.gz > dodsond2.orig.c - -@if [ -s dodsond2.orig.c ]; then \ - ${ECHO} "${CC} ${CFLAGS} dodsond2.orig.c -o dodsond2.orig"; \ - ${CC} ${CFLAGS} dodsond2.orig.c -o dodsond2.orig; \ - else \ - ${RM} -f dodsond2.orig.c; \ - ${ECHO} "sorry, we could not gunzip dodsond2.gz"; \ - fi +# https://github.com/ioccc-src/winner +# +################################################################################ -dodsond2.gz: dodsond2.gz.uu - @${RM} -f dodsond2.gz - ${UUDECODE} dodsond2.gz.uu +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -dodsond1: dodsond1.c - ${CC} ${CFLAGS} dodsond1.c -o dodsond1 +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make + + +############### +# IOCCC winners +############### +# +WINNERS= dodsond1 dodsond2 horton imc ldb schnitzi shapiro smr tvr weisberg westley + +YEAR= 1994 + +################### +# build all entries +################### +# +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - $(RM) -f $(WINNERS) - $(RM) -f $(ALT_NAMES) - ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1995/Makefile b/1995/Makefile index 30064fd22..19e8f29d5 100644 --- a/1995/Makefile +++ b/1995/Makefile @@ -1,119 +1,319 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1995 makefile +# 1995 Makefile + +################################################################################ # -# Copyright (c) 1996, Landon Curt Noll, Larry Bassel & Sriram Srinivasan -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll, Larry Bassel and Sriram Srinivasan. - - -SHELL=/bin/sh -CAT=cat -CHMOD=chmod -CP=cp -ECHO=echo -GUNZIP=gunzip -UUDECODE=uudecode -LN=ln -RM=rm -SED=sed -TRUE=true - -# flags for ANSI compiles +# An Historical Makefile NOTE: # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE: Some compilers cannot optimize, or optimize some entries -# incorrectly. You might want to turn on -O to see if your -# compiler can handle them. +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -#CFLAGS=-O -Xa -#CFLAGS=-Xa -#CFLAGS= -ansi -CFLAGS= -ansi -O -#CFLAGS= - -# ANSI compiler +# Regarding individual entries: # -# Set CC to the name of your ANSI compiler. -CC=cc -#CC=gcc - -# winners that compile under ANSI C +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -WINNERS= cdua dodsond1 dodsond2 esde garry heathbar leo makarios savastio \ - schnitzi spinellis vanschnitz -ALT_NAMES= leo.orig garry.fmt garry.test - -LEVEL=5 - -all: $(WINNERS) - -cdua: cdua.c - ${CC} ${CFLAGS} cdua.c -o cdua - -dodsond1: dodsond1.c - ${CC} ${CFLAGS} -DXXXXXX= -DXXXXXXX= dodsond1.c -o dodsond1 - -dodsond2: dodsond2.c - ${CC} ${CFLAGS} dodsond2.c -o dodsond2 -lcurses -ltermcap - -esde: esde.c esde.data esde.data2 - ${CC} ${CFLAGS} esde.c -o esde - -garry: garry.c - ${CC} ${CFLAGS} garry.c -o garry - -heathbar: heathbar.c - ${CC} ${CFLAGS} heathbar.c -o heathbar - -# The following as a less obfuscated version of garry. +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -garry.fmt: garry.fmt.c - ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt - -# The following are test progs for garry +# GitHub pull requests are welcome: # -garry.test: garry.test.sh garry garry.data - rm -f garry.test - cp garry.test.sh garry.test - chmod +x garry.test - -leo: leo.c - ${CC} ${CFLAGS} -DGa=608 -DAs=792 -DMo=int -DAr='unsigned long' \ - -DS='struct Se' leo.c -o leo - -# NOTE: this is the original program that was non-interactive +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. # -leo.orig: leo.orig.c - ${CC} ${CFLAGS} -DGa=608 -DAs=792 -DMo=int -DAr='unsigned long' \ - -DS='struct S' leo.orig.c -o leo.orig +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -makarios: makarios.c - ${CC} ${CFLAGS} makarios.c -o makarios +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -schnitzi: schnitzi.c - ${CC} ${CFLAGS} schnitzi.c -o schnitzi -spinellis: spinellis.c - ${CC} ${CFLAGS} spinellis.c -o spinellis +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make -vanschnitz: vanschnitz.c - ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz +############### +# IOCCC winners +############### +# +WINNERS= cdua dodsond1 dodsond2 esde garry heathbar leo makarios savastio schnitzi \ + spinellis vanschnitz + +YEAR= 1995 + +################### +# build all entries +################### +# +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### +# clean: - $(RM) -f *.o a.out core ${WINNERS} + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - $(RM) -f $(WINNERS) - $(RM) -f $(ALT_NAMES) +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1996/Makefile b/1996/Makefile index 718bcb78b..abff72158 100644 --- a/1996/Makefile +++ b/1996/Makefile @@ -1,157 +1,319 @@ -# %W% %G% %U% +#!/usr/bin/env make # -# 1996 makefile +# 1996 Makefile + +################################################################################ # -# Copyright (c) 1997, Landon Curt Noll & Sriram Srinivasan -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from Landon Curt Noll and Sriram Srinivasan. - - -SHELL=/bin/sh -CAT=cat -CHMOD=chmod -CP=cp -ECHO=echo -GUNZIP=gunzip -UUDECODE=uudecode -LN=ln -RM=rm -SED=sed -TRUE=true - -# flags for ANSI compiles +# An Historical Makefile NOTE: # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE: Some compilers cannot optimize, or optimize some entries -# incorrectly. You might want to turn on -O to see if your -# compiler can handle them. +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -#CFLAGS=-O -Xa -#CFLAGS=-Xa -#CFLAGS= -ansi -CFLAGS= -ansi -O -#CFLAGS= - -# ANSI compiler +# Regarding individual entries: # -# Set CC to the name of your ANSI compiler. -CC=cc -#CC=gcc - -# winners that compile under ANSI C +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ - schweikh2 schweikh3 westley -ALT_NAMES= august.orig - -LEVEL=5 - -all: $(WINNERS) - -# NOTE: Some compilers will compile this code into infinite loop -# progs. We have found gcc to work on a number of platforms. -# If the following example does not execute in a very -# short time, try a better compiler: +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -# cat august.c test.oc | ./august > test.oo -# -august: august.c fac.oc parse.oc test.oc - ${CC} ${CFLAGS} -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ - -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ - -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ - -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ - august.c -o august - ${CHMOD} +r fac.oc parse.oc test.oc - -# This forms a byte code execution engine written in OC +# GitHub pull requests are welcome: # -august.oc: august.c - ${RM} -f august.oc - ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ - -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ - -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ - -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ - august.c > august.oc - ${CHMOD} +r august.oc - -# NOTE: this is the original source that won +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. # -august.orig: august.orig.c fac.oc parse.oc test.oc - ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ - -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ - -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ - -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ - august.orig.c -o august.orig - ${RM} -f august.oc - ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ - -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ - -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ - -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ - august.orig.c > august.oc - ${CHMOD} +r fac.oc parse.oc test.oc august.oc - -dalbec: dalbec.c - ${CC} ${CFLAGS} dalbec.c -o dalbec - -eldby: eldby.c - ${CC} ${CFLAGS} eldby.c -o eldby - -gandalf: gandalf.c - ${CC} ${CFLAGS} gandalf.c -o gandalf - ${RM} -f hatcat cathat - ${CP} gandalf hatcat - ${CP} gandalf cathat - -huffman: huffman.c - ${CC} ${CFLAGS} huffman.c -o huffman - -# Add -I${X}/include and -L${X}/lib if this doesn't build -# (X is the root of the X Window distribution) -# Solaris users add -lsocket +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -jonth: jonth.c - ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm - -rcm: rcm.c - ${CC} ${CFLAGS} -DJ='if(' -Ds='else J O==' -DU='B(' \ - -DX='for(' -DH='unsigned' -Dn='struct x' -DA='0,0,0,0,' \ - -DT='' -DY='' -DR='malloc(sizeof(n))' \ - -DM='%=K' -DK=32768 -DD='getchar()' -DN=putchar rcm.c -o rcm - -schweikh1: schweikh1.c errno.h - ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 - -schweikh2: schweikh2.c hunni.c hunni.pl - ${CC} ${CFLAGS} -D_POSIX_SOURCE schweikh2.c -o schweikh2 - -# NOTE: On some systems such as SunOS, one may need to compile with: +# https://github.com/ioccc-src/winner # -# ${CC} ${CFLAGS} \ -# -I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \ -# schweikh3.c -o schweikh3 -# -schweikh3: schweikh3.c iso646.h - ${CC} ${CFLAGS} -I. -D_POSIX_SOURCE schweikh3.c -o schweikh3 +################################################################################ -westley: westley.c clock1 clock2 clock3 - ${CC} ${CFLAGS} westley.c -o westley - ${CHMOD} +x clock1 clock2 clock3 +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ + +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make + + +############### +# IOCCC winners +############### +# +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 schweikh2 schweikh3 \ + westley + +YEAR= 1996 + +################### +# build all entries +################### +# +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### +# clean: - ${RM} -f *.o a.out core ${WINNERS} + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - ${RM} -f $(WINNERS) - ${RM} -f $(ALT_NAMES) - ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/1998/Makefile b/1998/Makefile index 4c99b01a9..3f5c7e315 100644 --- a/1998/Makefile +++ b/1998/Makefile @@ -1,175 +1,319 @@ -#!/bin/make -# 1998 makefile +#!/usr/bin/env make # -# Copyright (c) Landon Curt Noll, Jeremy Horn, Peter Seebach -# and Leonid A. Broukhis, 1999. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from the contest judges. +# 1998 Makefile -SHELL=/bin/sh -CAT=cat -CHMOD=chmod -CP=cp -MV=mv -ECHO=echo -LN=ln -RM=rm -SED=sed -TRUE=true - -# flags for ANSI compiles +################################################################################ # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others may want nothing -# at all. Adjust the CFLAGS line as needed. +# An Historical Makefile NOTE: # -# NOTE: Some compilers cannot optimize, or optimize some entries -# incorrectly. You might want to turn on -O to see if your -# compiler can handle them. +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE: On some systems, the library path does not include the location -# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir -# in order to compile with these libs. +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -#CFLAGS=-O -Xa -#CFLAGS=-Xa -CFLAGS= -ansi -#CFLAGS= -ansi -O -#CFLAGS= -#CFLAGS= -ansi -L/usr/X11R6/lib - -# ANSI compiler +# Regarding individual entries: # -# Set CC to the name of your ANSI compiler. +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# GitHub pull requests are welcome: # -CC= cc -MAY_NEED_GCC= gcc - -# winners that compile under ANSI C +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. # -WINNERS= schweikh1 df dloweneil banks dlowe bas2 fanf bas1 tomtorfs dorssel \ - schweikh2 schnitzi chaos schweikh3 -ALT_NAMES= schweikh2.orig banks.orig dlowe.orig df.orig schweikh1.orig \ - chaos_nohalf -DATA_FILES= banks_files chaos_files fanf_files schweikh1_files schweikh3_files - - -all: ${WINNERS} - -schweikh1: schweikh1.c - ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ - -schweikh1.orig: schweikh1.orig.c - ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ - -schweikh1_files: info - -df: df.c - ${CC} ${CFLAGS} $? -o $@ - -df.orig: prog.c - ${CC} ${CFLAGS} $? -o $@ - -prog.c : df.c - ${RM} -f prog.c - ${CP} $? prog.c - -dloweneil: dloweneil.c - ${CC} ${CFLAGS} $? -lcurses -o $@ - -# See note about use of -L/path/to/X11/lib/dir above this rule fails to link +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -banks: banks.c - ${CC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ - -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ - -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ - -# See note about use of -L/path/to/X11/lib/dir above this rule fails to link +# https://github.com/ioccc-src/winner # -banks.orig: banks.orig.c - ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ - -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ - -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ +################################################################################ -banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc - -dlowe: dlowe.c - ${CC} ${CFLAGS} $? -o $@ - -dlowe.orig: dlowe.orig.c - ${CC} ${CFLAGS} $? -o $@ - -bas2: bas2.c - ${CC} ${CFLAGS} $? -o $@ - -fanf: fanf.c - ${RM} -f fanftmp1.c fanftmp2.c - ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c - ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c - ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ - -fanf_files: fanf.lambda - -bas1: bas1.c - ${CC} ${CFLAGS} $? -o $@ - -tomtorfs: tomtorfs.c - ${CC} ${CFLAGS} $? -o $@ - -dorssel: dorssel.c - ${CC} ${CFLAGS} $? -o $@ - -schweikh2: schweikh2.c - ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ - -schweikh2.orig: schweikh2.orig.c - ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ - -schweikh3: schweikh3.c - ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ - -DM3=realloc -DM4=calloc -DM5=free -o $@ - -schweikh3_files: samefile.1 - -schnitzi: schnitzi.c - ${CC} ${CFLAGS} $? -o $@ - -chaos: chaos.c - ${CC} ${CFLAGS} $? -lcurses -o $@ - -# some libcurses do not have halfdelay(). This rule is for those systems +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -chaos_nohalf: chaos_nohalf.c - ${CC} ${CFLAGS} $? -lcurses -o $@ - ${CP} -f $@ chaos +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ -chaos_nohalf.c: chaos.c - ${RM} -f $@ - ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data +################ +# tool locations +################ +# +SHELL= /bin/bash +MAKE= make -everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} +############### +# IOCCC winners +############### +# +WINNERS= banks bas1 bas2 chaos df dlowe dloweneil dorssel fanf schnitzi schweikh1 \ + schweikh2 schweikh3 tomtorfs + +YEAR= 1998 + +################### +# build all entries +################### +# +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +# alternative executable +# +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# data files +# +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# both all and alt +# +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### +# utility rules +############### +# clean: - ${RM} -f *.o a.out core ${WINNERS} - ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - ${RM} -f ${WINNERS} - ${RM} -f ${ALT_NAMES} +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/2000/Makefile b/2000/Makefile index ae5f6991c..6792971b7 100644 --- a/2000/Makefile +++ b/2000/Makefile @@ -1,214 +1,319 @@ -#!/bin/make -# 2000 makefile +#!/usr/bin/env make # -# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach -# and Leonid A. Broukhis, 2000. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from the contest judges. +# 2000 Makefile -SHELL= /bin/sh -CAT= cat -RM= rm -SED= sed -TRUE= true +################################################################################ +# +# An Historical Makefile NOTE: +# +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. +# +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ -# optimization +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -# Most compiles will safely use -O2. Some can use only -O. -# A few compilers have broken optimizers and thus you may -# not want anything. +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -#OPT= -#OPT= -O -OPT= -O2 - -# flags for ANSI compiles -# -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others (Compaq Tru64 Unix) -# want -std1, and others may want nothing at all. -# Adjust the CFLAGS line as needed. -# -# NOTE: Some compilers cannot optimize, or optimize some entries -# incorrectly. You might want to turn on -O to see if your -# compiler can handle them. -# -# -#CFLAGS= -Xa ${OPT} -#CFLAGS= -std1 $(OPT) -CFLAGS= -ansi ${OPT} - -NO_ANSI_CFLAGS= -#NO_ANSI_CFLAGS= - -# NOTE: On some systems, the library path does not include the location -# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir -# in order to compile with these libs. -# -X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 -#X11CCFLAGS= -X11LDFLAGS= -L/usr/X11R6/lib -#X11LDFLAGS= - -# Perl -# -PERL= perl -#PERL= perl5 - -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. -# -CC= cc -MAY_NEED_GCC= gcc - -# winners that compile under ANSI C -# -WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ - dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx -ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig -DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files +# See: http://creativecommons.org/licenses/by-sa/3.0/ -all: ${WINNERS} - -# Best use of flags +################ +# tool locations +################ # -anderson: anderson.c - ${CC} ${CFLAGS} $? -o $@ +SHELL= /bin/bash +MAKE= make -# Most Timely Output -# -schneiderwent: schneiderwent.c - ${CC} ${CFLAGS} $? -o $@ -schneiderwent_files: schneiderwent.data +############### +# IOCCC winners +############### +# +WINNERS= anderson bellard bmeyer briddlebane dhyang dlowe jarijyrki natori primenum \ + rince robison schneiderwent thadgavin tomx -schneiderwent.orig: schneiderwent.orig.c - ${CC} ${CFLAGS} $? -o $@ +YEAR= 2000 -# Best Abuse of CPP +################### +# build all entries +################### # -primenum: primenum.c - ${CC} ${CFLAGS} $? -o $@ +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -# Most Specific Output -# -bellard: bellard.c - ${CC} ${CFLAGS} $? -o $@ +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -# Best Utility +# alternative executable # -# machines operating in 64 bit mode: -# -bmeyer: bmeyer.c - ${CC} -DY= -O6 $? -o $@ -lm -# -# linux/x86, glibc 2.0, libc4/5: -# -# bmeyer: bmeyer.c -# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm -# -# linux/x86, glibc 2.1: -# -# bmeyer: bmeyer.c -# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ -# -O6 $? -o $@ -lm +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -bmeyer_files: lavabus.pgm lenna.glic michael.pgm - -# Best Abuse of User +# data files # -briddlebane: briddlebane.c - ${CC} ${CFLAGS} $? -o $@ -lm +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -briddlebane.orig: briddlebane.orig.c - ${CC} ${CFLAGS} $? -o $@ -lm - -# Best Layout +# both all and alt # -dhyang: dhyang.c - ${CC} ${CFLAGS} $? -o $@ +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -dmy2jd: dmy2jd.c - ${CC} ${CFLAGS} $? -o $@ -# Best of Show +############### +# utility rules +############### # -jarijyrki: jarijyrki.c - ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ - -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ - -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ - -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ - $? -o $@ ${X11LDFLAGS} -lX11 - -jarijyrki_files: sheet1.info - -# Worst Abuse of the Rules -# -# NOTE: You will need to adjust this path to the place where Perl has been -# installed on your system. Running "perl -V" may help you locate -# this place. -# -# The following bit of perl may help determining the values you need: -# -# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' -# -# -dlowe: dlowe.c - ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ - `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ - `${PERL} -MExtUtils::Embed -e ldopts` - -# Best Small Program -# -natori: natori.c - ${CC} ${CFLAGS} $? -o $@ -lm - -# Astronomically Obfuscated -# -rince: rince.c - ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ - $? -o $@ -lm ${X11LDFLAGS} -lX11 - -# Best game -# -robison: robison.c - ${CC} ${CFLAGS} $? -o $@ - -# Most Portable Output -# -thadgavin: thadgavin.c - ${CC} ${CFLAGS} $? -o $@ -lcurses -lm - -thadgavin.orig: thadgavin.orig.c - ${CC} ${CFLAGS} $? -o $@ -lncurses -lm - -# Most Complete Program -# -tomx: tomx.c - ${CC} ${CFLAGS} $? -o $@ - -everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} - clean: - ${RM} -f *.o a.out core ${WINNERS} + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - ${RM} -f ${WINNERS} - ${RM} -f ${ALT_NAMES} +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# +love: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +haste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +waste: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/2001/Makefile b/2001/Makefile index 199c83c41..d72b50a76 100644 --- a/2001/Makefile +++ b/2001/Makefile @@ -1,197 +1,319 @@ -#!/bin/make -# 2001 makefile +#!/usr/bin/env make # -# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach, 2001. -# All Rights Reserved. Permission for personal, educational or non-profit -# use is granted provided this this copyright and notice are included in its -# entirety and remains unaltered. All other uses must receive prior permission -# from the contest judges. +# 2001 Makefile -SHELL= /bin/sh -CAT= cat -RM= rm -SED= sed -TRUE= true - -# optimization +################################################################################ # -# Most compiles will safely use -O2. Some can use only -O. -# A few compilers have broken optimizers and thus you may -# not want anything. +# An Historical Makefile NOTE: # -#OPT= -#OPT= -O -OPT= -O2 - -# flags for ANSI compiles +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. # -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others (Compaq Tru64 Unix) -# want -std1, and others may want nothing at all. -# Adjust the CFLAGS line as needed. +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. # -# NOTE: Some compilers cannot optimize, or optimize some entries -# incorrectly. You might want to turn on -O to see if your -# compiler can handle them. +# Regarding individual entries: # +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. # -#CFLAGS= -Xa ${OPT} -#CFLAGS= -std1 $(OPT) -CFLAGS= -ansi ${OPT} - -# NOTE: On some systems, the library path does not include the location -# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir -# in order to compile with these libs. +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. # -X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 -#X11CCFLAGS= -X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib -#X11LDFLAGS= - -# ANSI compiler +# GitHub pull requests are welcome: # -# Set CC to the name of your ANSI compiler. +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. # -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: # -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. +# https://github.com/ioccc-src/winner # -CC= cc -MAY_NEED_GCC= gcc +################################################################################ -# winners that compile under ANSI C +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: # -WINNERS= anonymous bellard bellard.otccex cheong coupard \ - ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ - schweikh westley williams -ALT_NAMES= westley.orig -DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files - - -all: ${WINNERS} - -# Most likely to amaze +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # -anonymous: anonymous.c - magic='${MAY_NEED_GCC} -O1'; \ - X='-DA(X)=#X'; \ - warning='-pedantic -Dprocessor'; \ - $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ - -o anonymous anonymous.c +# See: http://creativecommons.org/licenses/by-sa/3.0/ -anonymous_files: anonymous.ten.c -# Best abuse of the rules +################ +# tool locations +################ # -bellard: bellard.c - ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl +SHELL= /bin/bash +MAKE= make -bellard_files: bellard.otccex.c -# Best short program +############### +# IOCCC winners +############### # -cheong: cheong.c - ${CC} ${CFLAGS} cheong.c -o cheong +WINNERS= anonymous bellard cheong coupard ctk dgbeards herrmann1 herrmann2 jason \ + kev ollinger rosten schweikh westley williams -# Most obfuscated sound +YEAR= 2001 + +################### +# build all entries +################### # -coupard: coupard.c - ${CC} ${CFLAGS} -o coupard coupard.c +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -# Worst Driver +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto + +# alternative executable # -ctk: ctk.c - ${CC} ${CFLAGS} -o ctk ctk.c +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -# Worst AI +# data files # -dgbeards: dgbeards.c - ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ - -DI=0xFFFF dgbeards.c -o dgbeards +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -# Best abuse of the C preprocessor +# both all and alt # -herrmann1: herrmann1.c herrmann1.sh - @echo "NOTE: $@ must be built/run using the script $@.sh" - ${SHELL} ./herrmann1.sh +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -# Most eye-crossing +############### +# utility rules +############### # -# This entry requires the GCC -include feature. +clean: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## # -herrmann2: herrmann2.c - ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ - -include /usr/include/stdlib.h -include /usr/include/stdio.h \ - -include /usr/include/time.h -include /usr/include/unistd.h - -herrmann2_files: herrmann2.cup herrmann2.ioccc - -# Best Of Show -# -jason: jason.c - ${CC} ${CFLAGS} -o jason jason.c - -# Best Curses Game -# -kev: kev.c - ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ - -lcurses -ltermcap \ - -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" - -# Best primal ASCII graphics -# -ollinger: ollinger.c - ${CC} ${CFLAGS} ollinger.c -o ollinger - -# Best abuse of the user -# -rosten: rosten.c - ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ - -o rosten - -# Best one-liner -# -schweikh: schweikh.c - ${CC} ${CFLAGS} schweikh.c -o schweikh - -# Best position-independant code -# -westley: westley.c - ${CC} ${CFLAGS} westley.c -o westley - -westley.orig: westley.orig.c - ${CC} ${CFLAGS} westley.orig.c -o westley.orig - -# Best position-independant code -# -williams: williams.c - ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams - -everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} - love: - @echo 'not war?' + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' haste: - ${MAKE} waste + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' waste: - @echo 'waste' + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clean: - ${RM} -f *.o a.out core ${WINNERS} +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: clean - ${RM} -f ${WINNERS} - ${RM} -f ${ALT_NAMES} +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' diff --git a/2004/Makefile b/2004/Makefile index 09c9f9531..ceab5b9fb 100644 --- a/2004/Makefile +++ b/2004/Makefile @@ -1,361 +1,319 @@ -#!/bin/make +#!/usr/bin/env make # -# 2004 makefile +# 2004 Makefile + +################################################################################ # -# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach -# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, -# educational or non-profit use is granted provided this copyright and -# notice are included in its entirety and remains unaltered. All other -# uses must receive prior permission from the contest judges. +# An Historical Makefile NOTE: +# +# The orig.Makefile, if it exits, is the original Makefile before this IOCCC +# year directory was reworked so that entries are in separate directories. +# This also applies to any orig.ansi.mk and orig.common.mk files. +# +# Several Makefiles were modified / formed in 2022, and as such it may have +# elements that are not historically compatible with way entries were built. +# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. +# +# Regarding individual entries: +# +# IOCCC winning entry code may not work on your system. Even with standards, +# conditions and build environments change, especially when it comes to more +# extreme code such you might find in an IOCCC winner. Moreover, what was +# allowed and liked in one IOCCC contest may no longer be liked/allowed in +# later IOCCC years. +# +# Corrections on winning author and fixing typos in remarks are VERY WELCOME. +# +# GitHub pull requests are welcome: +# +# If you have a patch that might make running an entry work in modern Unix-like +# environments, please create a GitHub pull request for the IOCCC judgess to +# consider. +# +# Suggestions and corrections regarding Makefiles, winning author information, +# fixing typos in remarks, and code patches are welcome via opening a GitHub +# issue or better yet, by creating a GitHub pull request for the IOCCC judges +# to consider. To form a GitHub issue or GitHub pull, please visit: +# +# https://github.com/ioccc-src/winner +# +################################################################################ + +# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# +# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# +# See: http://creativecommons.org/licenses/by-sa/3.0/ +################ # tool locations +################ # -SHELL= /bin/sh -CP= cp -CPP= cpp -GUNZIP= gunzip -LD= ld +SHELL= /bin/bash MAKE= make -RM= rm -SED= sed -TAR= tar -TRUE= true -# Special flags for the gavin entry +############### +# IOCCC winners +############### # -# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec kopczynski \ + newbern omoikane schnitzi sds vik1 vik2 + +YEAR= 2004 + +################### +# build all entries +################### # -GAVIN_OPT= -O1 -GAVIN_FLAGS=\ - '-DY(m)=*((int*)(m))'\ - '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ - '-DM=for(D=0;D<786432;D++)'\ - '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ - '-DV=0x90200'\ - '-DK=0'\ - '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ - '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' +all: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ + supernova deep_magic magic charon pluto -# Set X11_LIBDIR to the directory where the X11 library resides +# alternative executable # -X11_LIBDIR= /usr/X11R6/lib +alt: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' - -# optimization +# data files # -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers and thus you may -# not want anything. +data: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +# both all and alt # -#OPT= -#OPT= -O -#OPT= -O1 -OPT= -O2 - - -# flags for ANSI compiles -# -# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, -# others such as gcc may want -ansi, others (Compaq Tru64 Unix) -# want -std1, and others may want nothing at all. -# Adjust the CFLAGS line as needed. -# -# NOTE: Some compilers cannot optimize, or optimize some entries -# incorrectly. You might want to turn on -O to see if your -# compiler can handle them. -# -# -#CFLAGS= -Xa ${OPT} -#CFLAGS= -std1 $(OPT) -CFLAGS= -ansi ${OPT} - - -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. -# -CC= cc -MAY_NEED_GCC= gcc - - -# 2004 winners -# -WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ - kopczynski newbern omoikane schnitzi sds vik1 vik2 -CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ - hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ - newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ - vik2_clean -CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ - gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ - kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ - sds_clobber vik1_clobber vik2_clobber -ALT_NAMES= hoyle.orig kopczynski.orig -DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ - newbern_files omoikane_files schnitzi_files - - -# default build -# -all: ${WINNERS} - - -# Best use of "Precious" Lines -# -anonymous: anonymous.c - ${CC} anonymous.c -o anonymous - -anonymous_clean: - ${RM} -f anonymous.o - -anonymous_clobber: anonymous_clean - ${RM} -f anonymous - - -# Best use of Vision -# -arachnid: arachnid.c - ${CC} -o arachnid -DL=LINES -DS=COLS \ - -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses - -arachnid_clean: - ${RM} -f arachnid.o - -arachnid_clobber: arachnid_clean - ${RM} -f arachnid - -arachnid_files: arachnid.info - - -# Best Calculated Risk -# -burley: burley.c - ${CC} -ansi burley.c -o burley - -burley_clean: - ${RM} -f burley.o - -burley_clobber: burley_clean - ${RM} -f burley - - -# Best Use of Light and Spheres -# -gavare: gavare.c - ${CC} -O3 gavare.c -o gavare - -gavare_clean: - ${RM} -f gavare.o - -gavare_clobber: gavare_clean - ${RM} -f gavare - - -# Best of Show -# -gavin: gavin.c - ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c - ${RM} -f kernel - ./gavin > kernel - ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c - ${RM} -f sh - ${LD} -s -o sh gavin.o - ${RM} -f vi - ${CP} sh vi - ${RM} -f fs.tar - ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim - -gavin_clean: - ${RM} -f sh vi kernel gavin.o - -gavin_clobber: gavin_clean - ${RM} -f gavin fs.tar - -gavin_files: boot.b lilo.conf prim gavin_install.txt - - -# Best Abuse of the Guidelines -# -hibachi: hibachi.tar.gz - ${RM} -f hibachi.tar - ${GUNZIP} < hibachi.tar.gz > hibachi.tar - ${TAR} -xvf hibachi.tar - ${RM} -f hibachi.tar - (cd hibachi && ${SHELL} ./configure) - ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) - -hibachi_clean: - ${RM} -f hibachi/hibachi.o hibachi.tar - -hibachi_clobber: hibachi_clean - ${RM} -rf hibachi - -hibachi_files: hibachi.tar.gz - - -# Most Functional Output -# -hoyle: hoyle.c - ${CC} hoyle.c -o hoyle -lm - -hoyle.orig: hoyle.orig.c - ${CC} hoyle.orig.c -o hoyle.orig -lm - -hoyle_clean: - ${RM} -f hoyle.o hoyle.orig.o - -hoyle_clobber: hoyle_clean - ${RM} -f hoyle hoyle.orig - - -# Best Abuse of the Periodic Table -# -jdalbec: jdalbec.c - @${RM} -f jdalbec2.c - -${CC} -E jdalbec.c > jdalbec2.c - @${RM} -f jdalbec3.c - ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c - ${CC} -ansi jdalbec3.c -o jdalbec - -jdalbec_clean: - ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o - -jdalbec_clobber: jdalbec_clean - ${RM} -f jdalbec - - -# Best one-liner -# -kopczynski: kopczynski.c - ${CC} -Dif=while kopczynski.c -o kopczynski - -kopczynski.orig: kopczynski.orig.c - ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig - -kopczynski_clean: - ${RM} -f kopczynski.o kopczynski.orig.o - -kopczynski_clobber: kopczynski_clean - ${RM} -f kopczynski kopczynski.orig - -kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ - kopczynski-8c kopczynski-9 - - -# Best Font Engine -# -newbern: newbern.c - ${CC} newbern.c -o newbern - -newbern_clean: - ${RM} -f newbern.o - -newbern_clobber: newbern_clean - ${RM} -f newbern - -newbern_files: newbern.dat - - -# Best Utility -# -omoikane: omoikane.c - ${CC} -O omoikane.c -o omoikane - -omoikane_clean: - ${RM} -f omoikane.o - -omoikane_clobber: omoikane_clean - ${RM} -f omoikane - -omoikane_files: omoikane.info - - -# Best Non-Use of Curses -# -schnitzi: schnitzi.c - ${CC} schnitzi.c -o schnitzi - -schnitzi_clean: - ${RM} -f schnitzi.o - -schnitzi_clobber: schnitzi_clean - ${RM} -f schnitzi - -schnitzi_files: schnitzi.inp0 schnitzi.inp1 - - -# Best Abuse of Indentation -# -sds: sds.c - ${CC} -o sds sds.c - -sds_clean: - ${RM} -f sds_encoder.c sds_encoder.o sds.o - -sds_clobber: sds_clean - ${RM} -f sds sds_encoder - - -# Best X11 Game -# -vik1: vik1.c - ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 - -vik1_clean: - ${RM} -f vik1.o - -vik1_clobber: vik1_clean - ${RM} -f vik1 - - -# Best Abuse of CPP -# -vik2: vik2.c - @${RM} -f vik2_1.c - ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c - @${RM} -f vik2_2.c - ${CC} -E vik2_1.c > vik2_2.c - ${CC} -O vik2_2.c -o vik2 - -vik2_clean: - ${RM} -f vik2_1.c vik2_2.c vik2.o - -vik2_clobber: vik2_clean - ${RM} -f vik2 - - +everything: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +############### # utility rules +############### # -everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} +clean: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' +clobber: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +install: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +indent.c: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + + +################## +# 133t hacker rulz +################## +# love: - @echo 'not war?' + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' haste: - $(MAKE) waste + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' waste: - @echo 'waste' + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clean: ${CLEAN} - ${RM} -f a.out core +maker: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -clobber: ${CLOBBER} - ${RM} -f ${WINNERS} - ${RM} -f ${ALT_NAMES} +easter_egg: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -nuke: clobber - @${TRUE} +sandwich: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' -install: all - ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null + +# The IOCCC resident astronomer states +# +supernova: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +deep_magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +magic: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +charon: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-=' + +pluto: + @echo '=-=-= ${YEAR} begin make $@ =-=-=' + @echo + @for i in ${WINNERS} ; do \ + echo "=-= start ${YEAR}/$$i =-="; \ + echo "(cd $$i && $(MAKE) $@)"; \ + (cd $$i && $(MAKE) $@); \ + echo "=-= end ${YEAR}/$$i =-="; \ + echo; \ + done + @echo '=-=-= ${YEAR} complete make $@ =-=-='