From ab9b77b1c97bcb3f8eb1a3f8574a66f583f4922c Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 26 Feb 2023 17:21:30 -0800 Subject: [PATCH] reverse bad commit 223b1a3f9443c2a950357d17821b1fff74366c0f The commit 223b1a3f9443c2a950357d17821b1fff74366c0f was a mistake, so we reverse both commit 5f7cf0b60d1666aa0a5851811706a4ab1e4f8f11 and commit 223b1a3f9443c2a950357d17821b1fff74366c0f for now. --- 1992/adrian/Makefile | 4 +- 1992/albert/Makefile | 4 +- 1992/ant/Makefile | 4 +- 1992/buzzard.1/Makefile | 4 +- 1992/buzzard.2/Makefile | 4 +- 1992/gson/Makefile | 4 +- 1992/imc/Makefile | 4 +- 1992/kivinen/Makefile | 4 +- 1992/lush/Makefile | 4 +- 1992/marangon/Makefile | 4 +- 1992/nathan/Makefile | 4 +- 1992/vern/Makefile | 4 +- 1992/westley/Makefile | 4 +- 1993/ant/Makefile | 6 +- 1993/cmills/Makefile | 6 +- 1993/dgibson/Makefile | 6 +- 1993/ejb/Makefile | 6 +- 1993/jonth/Makefile | 6 +- 1993/leo/Makefile | 6 +- 1993/lmfjyh/Makefile | 6 +- 1993/plummer/Makefile | 6 +- 1993/rince/Makefile | 6 +- 1993/schnitzi/Makefile | 6 +- 1993/vanb/Makefile | 6 +- 1994/Makefile | 2 +- 1994/dodsond1/Makefile | 685 ++++++--------------------------- 1994/dodsond1/README.md | 18 +- 1994/dodsond2/Makefile | 684 ++++++--------------------------- 1994/dodsond2/README.md | 16 +- 1994/horton/Makefile | 687 ++++++--------------------------- 1994/horton/README.md | 16 +- 1994/imc/Makefile | 684 ++++++--------------------------- 1994/imc/README.md | 13 +- 1994/ldb/Makefile | 682 ++++++--------------------------- 1994/ldb/README.md | 14 +- 1994/schnitzi/Makefile | 716 +++++++---------------------------- 1994/shapiro/Makefile | 716 +++++++---------------------------- 1994/smr/Makefile | 716 +++++++---------------------------- 1994/tvr/Makefile | 716 +++++++---------------------------- 1994/weisberg/Makefile | 716 +++++++---------------------------- 1994/westley/Makefile | 716 +++++++---------------------------- 1995/Makefile | 2 +- 1995/cdua/Makefile | 675 +++++---------------------------- 1995/dodsond1/Makefile | 675 +++++---------------------------- 1995/dodsond2/Makefile | 675 +++++---------------------------- 1995/esde/Makefile | 675 +++++---------------------------- 1995/garry/Makefile | 675 +++++---------------------------- 1995/heathbar/Makefile | 675 +++++---------------------------- 1995/leo/Makefile | 675 +++++---------------------------- 1995/makarios/Makefile | 675 +++++---------------------------- 1995/savastio/Makefile | 675 +++++---------------------------- 1995/schnitzi/Makefile | 675 +++++---------------------------- 1995/spinellis/Makefile | 675 +++++---------------------------- 1995/vanschnitz/Makefile | 675 +++++---------------------------- 1996/Makefile | 2 +- 1996/august/Makefile | 709 ++++++---------------------------- 1996/dalbec/Makefile | 709 ++++++---------------------------- 1996/eldby/Makefile | 709 ++++++---------------------------- 1996/gandalf/Makefile | 709 ++++++---------------------------- 1996/huffman/Makefile | 709 ++++++---------------------------- 1996/jonth/Makefile | 709 ++++++---------------------------- 1996/rcm/Makefile | 709 ++++++---------------------------- 1996/schweikh1/Makefile | 709 ++++++---------------------------- 1996/schweikh2/Makefile | 709 ++++++---------------------------- 1996/schweikh3/Makefile | 709 ++++++---------------------------- 1996/westley/Makefile | 709 ++++++---------------------------- 1998/Makefile | 2 +- 1998/banks/Makefile | 715 +++++++--------------------------- 1998/bas1/Makefile | 715 +++++++--------------------------- 1998/bas2/Makefile | 715 +++++++--------------------------- 1998/chaos/Makefile | 715 +++++++--------------------------- 1998/df/Makefile | 715 +++++++--------------------------- 1998/dlowe/Makefile | 715 +++++++--------------------------- 1998/dloweneil/Makefile | 715 +++++++--------------------------- 1998/dorssel/Makefile | 715 +++++++--------------------------- 1998/fanf/Makefile | 715 +++++++--------------------------- 1998/schnitzi/Makefile | 715 +++++++--------------------------- 1998/schweikh1/Makefile | 715 +++++++--------------------------- 1998/schweikh2/Makefile | 715 +++++++--------------------------- 1998/schweikh3/Makefile | 715 +++++++--------------------------- 1998/tomtorfs/Makefile | 715 +++++++--------------------------- 2000/Makefile | 2 +- 2000/anderson/Makefile | 4 +- 2000/bellard/Makefile | 4 +- 2000/bmeyer/Makefile | 4 +- 2000/briddlebane/Makefile | 4 +- 2000/dhyang/Makefile | 4 +- 2000/dlowe/Makefile | 4 +- 2000/jarijyrki/Makefile | 4 +- 2000/natori/Makefile | 4 +- 2000/primenum/Makefile | 4 +- 2000/rince/Makefile | 4 +- 2000/robison/Makefile | 4 +- 2000/schneiderwent/Makefile | 4 +- 2000/thadgavin/Makefile | 4 +- 2000/tomx/Makefile | 4 +- 2001/Makefile | 2 +- 2001/anonymous/Makefile | 4 +- 2001/bellard/Makefile | 4 +- 2001/cheong/Makefile | 4 +- 2001/coupard/Makefile | 4 +- 2001/ctk/Makefile | 4 +- 2001/dgbeards/Makefile | 4 +- 2001/herrmann1/Makefile | 4 +- 2001/herrmann2/Makefile | 4 +- 2001/jason/Makefile | 4 +- 2001/kev/Makefile | 4 +- 2001/ollinger/Makefile | 4 +- 2001/rosten/Makefile | 4 +- 2001/schweikh/Makefile | 4 +- 2001/westley/Makefile | 4 +- 2001/williams/Makefile | 4 +- 2004/Makefile | 2 +- 2004/anonymous/Makefile | 4 +- 2004/arachnid/Makefile | 4 +- 2004/burley/Makefile | 4 +- 2004/gavare/Makefile | 4 +- 2004/gavin/Makefile | 4 +- 2004/hibachi/Makefile | 4 +- 2004/hoyle/Makefile | 4 +- 2004/jdalbec/Makefile | 4 +- 2004/kopczynski/Makefile | 4 +- 2004/newbern/Makefile | 4 +- 2004/omoikane/Makefile | 4 +- 2004/schnitzi/Makefile | 4 +- 2004/sds/Makefile | 4 +- 2004/vik1/Makefile | 4 +- 2004/vik2/Makefile | 4 +- 2005/Makefile | 4 +- 2006/Makefile | 4 +- 2011/Makefile | 2 +- 2011/akari/Makefile | 6 +- 2011/blakely/Makefile | 2 +- 2011/borsanyi/Makefile | 2 +- 2011/dlowe/Makefile | 6 +- 2011/eastman/Makefile | 2 +- 2011/fredriksson/Makefile | 2 +- 2011/goren/Makefile | 6 +- 2011/hamaji/Makefile | 6 +- 2011/hou/Makefile | 2 +- 2011/konno/Makefile | 6 +- 2011/richards/Makefile | 2 +- 2011/toledo/Makefile | 2 +- 2011/vik/Makefile | 2 +- 2011/zucker/Makefile | 2 +- 2012/Makefile | 2 +- 2012/blakely/Makefile | 6 +- 2012/deckmyn/Makefile | 6 +- 2012/dlowe/Makefile | 6 +- 2012/endoh1/Makefile | 6 +- 2012/endoh2/Makefile | 6 +- 2012/grothe/Makefile | 6 +- 2012/hamano/Makefile | 6 +- 2012/hou/Makefile | 6 +- 2012/kang/Makefile | 6 +- 2012/konno/Makefile | 6 +- 2012/omoikane/Makefile | 6 +- 2012/tromp/Makefile | 6 +- 2012/vik/Makefile | 6 +- 2012/zeitak/Makefile | 6 +- 2013/Makefile | 2 +- 2013/birken/Makefile | 6 +- 2013/cable1/Makefile | 6 +- 2013/cable2/Makefile | 6 +- 2013/cable3/Makefile | 6 +- 2013/dlowe/Makefile | 6 +- 2013/endoh1/Makefile | 6 +- 2013/endoh2/Makefile | 6 +- 2013/endoh3/Makefile | 6 +- 2013/endoh4/Makefile | 6 +- 2013/hou/Makefile | 6 +- 2013/mills/Makefile | 6 +- 2013/misaka/Makefile | 6 +- 2013/morgan1/Makefile | 6 +- 2013/morgan2/Makefile | 6 +- 2013/robison/Makefile | 6 +- 2014/Makefile | 2 +- 2014/birken/Makefile | 6 +- 2014/deak/Makefile | 6 +- 2014/endoh1/Makefile | 6 +- 2014/endoh2/Makefile | 6 +- 2014/maffiodo1/Makefile | 6 +- 2014/maffiodo2/Makefile | 6 +- 2014/morgan/Makefile | 6 +- 2014/sinon/Makefile | 6 +- 2014/skeggs/Makefile | 6 +- 2014/vik/Makefile | 6 +- 2014/wiedijk/Makefile | 6 +- 2015/Makefile | 2 +- 2015/burton/Makefile | 10 +- 2015/dogon/Makefile | 10 +- 2015/duble/Makefile | 10 +- 2015/endoh1/Makefile | 10 +- 2015/endoh2/Makefile | 10 +- 2015/endoh3/Makefile | 10 +- 2015/endoh4/Makefile | 10 +- 2015/hou/Makefile | 10 +- 2015/howe/Makefile | 12 +- 2015/mills1/Makefile | 10 +- 2015/mills2/Makefile | 10 +- 2015/muth/Makefile | 10 +- 2015/schweikhardt/Makefile | 10 +- 2015/yang/Makefile | 10 +- 2018/Makefile | 2 +- 2018/algmyr/Makefile | 10 +- 2018/anderson/Makefile | 10 +- 2018/bellard/Makefile | 10 +- 2018/burton1/Makefile | 10 +- 2018/burton2/Makefile | 10 +- 2018/ciura/Makefile | 10 +- 2018/endoh1/Makefile | 10 +- 2018/endoh2/Makefile | 10 +- 2018/ferguson/Makefile | 10 +- 2018/giles/Makefile | 10 +- 2018/hou/Makefile | 10 +- 2018/mills/Makefile | 10 +- 2018/poikola/Makefile | 10 +- 2018/vokes/Makefile | 10 +- 2018/yang/Makefile | 10 +- 2019/Makefile | 2 +- 2019/adamovsky/Makefile | 10 +- 2019/burton/Makefile | 10 +- 2019/ciura/Makefile | 10 +- 2019/diels-grabsch1/Makefile | 10 +- 2019/diels-grabsch2/Makefile | 10 +- 2019/dogon/Makefile | 10 +- 2019/duble/Makefile | 10 +- 2019/endoh/Makefile | 10 +- 2019/giles/Makefile | 10 +- 2019/karns/Makefile | 10 +- 2019/lynn/Makefile | 10 +- 2019/mills/Makefile | 10 +- 2019/poikola/Makefile | 10 +- 2019/yang/Makefile | 10 +- 2020/Makefile | 2 +- 2020/burton/Makefile | 10 +- 2020/carlini/Makefile | 10 +- 2020/endoh1/Makefile | 10 +- 2020/endoh2/Makefile | 10 +- 2020/endoh3/Makefile | 10 +- 2020/ferguson1/Makefile | 10 +- 2020/ferguson2/Makefile | 10 +- 2020/giles/Makefile | 10 +- 2020/kurdyukov1/Makefile | 10 +- 2020/kurdyukov2/Makefile | 10 +- 2020/kurdyukov3/Makefile | 10 +- 2020/kurdyukov4/Makefile | 10 +- 2020/otterness/Makefile | 10 +- 2020/tsoj/Makefile | 10 +- 2020/yang/Makefile | 10 +- 250 files changed, 6338 insertions(+), 28568 deletions(-) diff --git a/1992/adrian/Makefile b/1992/adrian/Makefile index 3bc8644bc..32e4c820f 100644 --- a/1992/adrian/Makefile +++ b/1992/adrian/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/albert/Makefile b/1992/albert/Makefile index be325fda5..391713ff9 100644 --- a/1992/albert/Makefile +++ b/1992/albert/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/ant/Makefile b/1992/ant/Makefile index af02878a9..395157b4e 100644 --- a/1992/ant/Makefile +++ b/1992/ant/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/buzzard.1/Makefile b/1992/buzzard.1/Makefile index 64285246a..3a0072612 100644 --- a/1992/buzzard.1/Makefile +++ b/1992/buzzard.1/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/buzzard.2/Makefile b/1992/buzzard.2/Makefile index 3540319ef..a56f27b6b 100644 --- a/1992/buzzard.2/Makefile +++ b/1992/buzzard.2/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/gson/Makefile b/1992/gson/Makefile index 2fbd53ffd..794e49dbc 100644 --- a/1992/gson/Makefile +++ b/1992/gson/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/imc/Makefile b/1992/imc/Makefile index 61f8ed65f..050e42f06 100644 --- a/1992/imc/Makefile +++ b/1992/imc/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/kivinen/Makefile b/1992/kivinen/Makefile index 0c0a2926a..d625c0708 100644 --- a/1992/kivinen/Makefile +++ b/1992/kivinen/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/lush/Makefile b/1992/lush/Makefile index ea1515f5d..500572ff5 100644 --- a/1992/lush/Makefile +++ b/1992/lush/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/marangon/Makefile b/1992/marangon/Makefile index 06b5b027b..3b66bba1e 100644 --- a/1992/marangon/Makefile +++ b/1992/marangon/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/nathan/Makefile b/1992/nathan/Makefile index 0373fd77e..cca692254 100644 --- a/1992/nathan/Makefile +++ b/1992/nathan/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/vern/Makefile b/1992/vern/Makefile index a463041a4..e13c36320 100644 --- a/1992/vern/Makefile +++ b/1992/vern/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1992/westley/Makefile b/1992/westley/Makefile index 7c58392cf..2bfbfbb2b 100644 --- a/1992/westley/Makefile +++ b/1992/westley/Makefile @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/ant/Makefile b/1993/ant/Makefile index ea7eef3fb..aac657c22 100644 --- a/1993/ant/Makefile +++ b/1993/ant/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/cmills/Makefile b/1993/cmills/Makefile index d1a018897..3dc3bc101 100644 --- a/1993/cmills/Makefile +++ b/1993/cmills/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/dgibson/Makefile b/1993/dgibson/Makefile index 7a99975f8..261383026 100644 --- a/1993/dgibson/Makefile +++ b/1993/dgibson/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/ejb/Makefile b/1993/ejb/Makefile index 0079f1b40..ba976220c 100644 --- a/1993/ejb/Makefile +++ b/1993/ejb/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/jonth/Makefile b/1993/jonth/Makefile index a2f52c959..623cbd5a9 100644 --- a/1993/jonth/Makefile +++ b/1993/jonth/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/leo/Makefile b/1993/leo/Makefile index e594859c8..9b8db8b92 100644 --- a/1993/leo/Makefile +++ b/1993/leo/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/lmfjyh/Makefile b/1993/lmfjyh/Makefile index 160a34825..0af9f7bc9 100644 --- a/1993/lmfjyh/Makefile +++ b/1993/lmfjyh/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/plummer/Makefile b/1993/plummer/Makefile index 3826c8ce0..6a7a8f6c3 100644 --- a/1993/plummer/Makefile +++ b/1993/plummer/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/rince/Makefile b/1993/rince/Makefile index d03f28bbf..e290cfae8 100644 --- a/1993/rince/Makefile +++ b/1993/rince/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/schnitzi/Makefile b/1993/schnitzi/Makefile index dd0a06b3f..518955e61 100644 --- a/1993/schnitzi/Makefile +++ b/1993/schnitzi/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1993/vanb/Makefile b/1993/vanb/Makefile index 3a44f8b5a..e7e0af29d 100644 --- a/1993/vanb/Makefile +++ b/1993/vanb/Makefile @@ -290,7 +290,7 @@ WHICH= which WHO= who WHOAMI= whoami WHOIS= whois -WRTIE= write +1WRTIE= write XAR= xar XARGS= xargs XATTR= xattr @@ -306,8 +306,8 @@ ZFORCE= zforce ZGREP= zgrep ZIP= zip ZIPCLOAK= zipcloak -ZIPGREP= zipgrep -ZIPINFO= zipinfo +ZIPGREp= zipgrep +ZIPINFo= zipinfo ZIPNOTE= zipnote ZIPSPLIT= zipsplit ZLESS= zless diff --git a/1994/Makefile b/1994/Makefile index 8ec81b66b..9b61f398f 100644 --- a/1994/Makefile +++ b/1994/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/1994/dodsond1/Makefile b/1994/dodsond1/Makefile index 62954b310..964287422 100644 --- a/1994/dodsond1/Makefile +++ b/1994/dodsond1/Makefile @@ -1,596 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - dodsond1 - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -1WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh +# 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 -O +#CFLAGS= -# Set X11_LIBDIR to the directory where the X11 library resides +# ANSI compiler # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +# Set CC to the name of your ANSI compiler. +#CC=cc +CC=gcc -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# winners that compile under ANSI C # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +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 -# Common C compiler warnings to silence -# -#CSILENCE= -CSILENCE= -Wno-empty-body -Wno-error -Wno-implicit-function-declaration \ - -Wno-missing-braces -Wno-return-type +all: $(WINNERS) $(ALT_NAMES) -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +westley: westley.c + ${CC} ${CFLAGS} westley.c -DO -o westley -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +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 -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc +shapiro_t1: shapiro.c + ${CC} ${CFLAGS} shapiro.c -o shapiro_t1 -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -CSILENCE+= -Wno-conditional-uninitialized -Wno-missing-prototypes \ - -Wno-missing-variable-declarations -Wno-poison-system-directories \ - -Wno-strict-prototypes -# -CWARN+= -Weverything -# -endif +shapiro.alt: shapiro.alt.c + ${CC} ${CFLAGS} shapiro.alt.c -o shapiro.alt -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi +horton: horton.c + ${CC} ${CFLAGS} horton.c -o horton -############################## -# Special flags for this entry -############################## +# Here are some programs related to the horton entry. See horton.hint +# for details. # -ENTRY= dodsond1 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= - - -################# -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} - -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/dodsond1/README.md b/1994/dodsond1/README.md index 386e6b965..3eccb306e 100644 --- a/1994/dodsond1/README.md +++ b/1994/dodsond1/README.md @@ -1,4 +1,4 @@ -# Best Game: +Best Game: Don Dodson AG Communication Systems @@ -6,23 +6,21 @@ Phoenix, AZ 85023 USA -## To build: - make all +Judges' comments: -### To run - - ./dodsond1 + To use: + make dodsond1 + dodsond1 - NOTE: At the prompt, try entering E3. - -## Judges' comments + At the prompt, try entering E3. The program plays the game that the layout of the source implies. The source, on the other hand, implies a language along the lines of Lisp. :-) -## Author's comments + +Selected notes from the author: For each turn, the board is displayed and the player is prompted for a move. Enter your move as an upper-case character followed by a number. diff --git a/1994/dodsond2/Makefile b/1994/dodsond2/Makefile index a93a79fc8..964287422 100644 --- a/1994/dodsond2/Makefile +++ b/1994/dodsond2/Makefile @@ -1,595 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - dodsond2 - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -1WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh +# 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 -O +#CFLAGS= -# Set X11_LIBDIR to the directory where the X11 library resides +# ANSI compiler # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +# Set CC to the name of your ANSI compiler. +#CC=cc +CC=gcc -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# winners that compile under ANSI C # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +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 -# Common C compiler warnings to silence -# -#CSILENCE= -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-return-type +all: $(WINNERS) $(ALT_NAMES) -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +westley: westley.c + ${CC} ${CFLAGS} westley.c -DO -o westley -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +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 -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc +shapiro_t1: shapiro.c + ${CC} ${CFLAGS} shapiro.c -o shapiro_t1 -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-prototypes \ - -Wno-missing-variable-declarations -Wno-poison-system-directories \ - -Wno-shadow -Wno-strict-prototypes -# -CWARN+= -Weverything -# -endif +shapiro.alt: shapiro.alt.c + ${CC} ${CFLAGS} shapiro.alt.c -o shapiro.alt -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi +horton: horton.c + ${CC} ${CFLAGS} horton.c -o horton -############################## -# Special flags for this entry -############################## +# Here are some programs related to the horton entry. See horton.hint +# for details. # -ENTRY= dodsond2 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= - - -################# -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} - -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/dodsond2/README.md b/1994/dodsond2/README.md index 789d7cf85..6d28dd4a2 100644 --- a/1994/dodsond2/README.md +++ b/1994/dodsond2/README.md @@ -1,4 +1,4 @@ -# Most Obfuscated Packaging: +Most Obfuscated Packaging: Don Dodson AG Communication Systems @@ -6,15 +6,12 @@ Phoenix, AZ 85023 USA -## To build: - make all +Judges' comments: -### To run - - ./dodsond2 - -## Judges' comments + To use: + make dodsond2 + dodsond2 The original source file may be found in dodsond2.gz. For people who don't have gunzip, an un-zipped version is provided as dodsond2.c. @@ -24,7 +21,8 @@ to get around the size limit will find themselves squeezed out of the contest! -## Author's comments + +Selected notes from the author: Go searching for the Wumpus in the Caverns of Doom! But be careful... There are pits and bats waiting to seal your fate, as well as a diff --git a/1994/horton/Makefile b/1994/horton/Makefile index 26187567b..964287422 100644 --- a/1994/horton/Makefile +++ b/1994/horton/Makefile @@ -1,604 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - horton - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -1WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh +# 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 -O +#CFLAGS= -# Set X11_LIBDIR to the directory where the X11 library resides +# ANSI compiler # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +# Set CC to the name of your ANSI compiler. +#CC=cc +CC=gcc -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# winners that compile under ANSI C # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +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 -# Common C compiler warnings to silence -# -#CSILENCE= -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-unused-parameter \ - -Wno-missing-braces -Wno-return-type -Wno-unused-but-set-variable \ - -Wno-unused-variable +all: $(WINNERS) $(ALT_NAMES) -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} +westley: westley.c + ${CC} ${CFLAGS} westley.c -DO -o westley -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +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 -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc +shapiro_t1: shapiro.c + ${CC} ${CFLAGS} shapiro.c -o shapiro_t1 -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -CSILENCE+= -Wno-float-conversion -Wno-missing-prototypes \ - -Wno-missing-variable-declarations -Wno-pedantic \ - -Wno-poison-system-directories -Wno-sign-conversion -Wno-strict-prototypes \ - -Wno-unused-macros -# -CWARN+= -Weverything -# -endif +shapiro.alt: shapiro.alt.c + ${CC} ${CFLAGS} shapiro.alt.c -o shapiro.alt -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi +horton: horton.c + ${CC} ${CFLAGS} horton.c -o horton -############################## -# Special flags for this entry -############################## +# Here are some programs related to the horton entry. See horton.hint +# for details. # -ENTRY= horton -PROG= ${ENTRY} -# -OBJ= ${PROG}.o -DATA= gtface.data -TARGET= ${PROG} gtface ${PROG}.alt -# -ALT_OBJ= ${PROG}.alt.o -ALT_TARGET= ${PROG}.alt - - -################# -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} - -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt gtface: gtface.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} + ${CC} ${CFLAGS} gtface.c -o gtface -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/horton/README.md b/1994/horton/README.md index 49c349287..0e6f9e7ca 100644 --- a/1994/horton/README.md +++ b/1994/horton/README.md @@ -1,4 +1,4 @@ -# Best Utility: +Best Utility: Mark Horton AT&T Bell Labs @@ -7,31 +7,29 @@ Columbus OH 43213 USA -## To build: - make all - -### To run +Judges' comments: + To use: + make horton ./horton A B C D A, B, C, D are numeric arguments (try 3 2 1 0). -## Judges' comments - Try to figure out how this program prints, for a given slope, the right character. And for extra credit, try to figure out which character is at the bottom on this hint file. :-) This confuses cb greatly. See gtplot.c for an unobfuscated/enhanced - version. To run this alternate version: + version. To compile it: make horton.alt ./horton.alt A B C D A, B, C, D are numeric arguments (try 3 2 1 0). -## Author's comments + +Selected notes from the author: Run it with any 4 numeric arguments, e.g. prog 3 2 1 0. Play with the numbers to get a pleasing result, or use it for your high school algebra diff --git a/1994/imc/Makefile b/1994/imc/Makefile index 5fedaf5bb..964287422 100644 --- a/1994/imc/Makefile +++ b/1994/imc/Makefile @@ -1,595 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - imc - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -1WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh +# 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 -O +#CFLAGS= -# Set X11_LIBDIR to the directory where the X11 library resides +# ANSI compiler # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +# Set CC to the name of your ANSI compiler. +#CC=cc +CC=gcc -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# winners that compile under ANSI C # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +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 -# Common C compiler warnings to silence -# -#CSILENCE= -CSILENCE= -Wno-error -Wno-implicit-function-declaration +all: $(WINNERS) $(ALT_NAMES) -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +westley: westley.c + ${CC} ${CFLAGS} westley.c -DO -o westley -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +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 -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc +shapiro_t1: shapiro.c + ${CC} ${CFLAGS} shapiro.c -o shapiro_t1 -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -CSILENCE+= -Wno-comma -Wno-conditional-uninitialized -Wno-missing-prototypes \ - -Wno-missing-variable-declarations -Wno-poison-system-directories \ - -Wno-shadow -Wno-sign-conversion -Wno-strict-prototypes -# -CWARN+= -Weverything -# -endif +shapiro.alt: shapiro.alt.c + ${CC} ${CFLAGS} shapiro.alt.c -o shapiro.alt -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi +horton: horton.c + ${CC} ${CFLAGS} horton.c -o horton -############################## -# Special flags for this entry -############################## +# Here are some programs related to the horton entry. See horton.hint +# for details. # -ENTRY= imc -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= - - -################# -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} - -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/imc/README.md b/1994/imc/README.md index 68f022b70..4679ff4d1 100644 --- a/1994/imc/README.md +++ b/1994/imc/README.md @@ -1,4 +1,4 @@ -# Most Obfuscated Algorithm: +Most Obfuscated Algorithm: Ian Collier Oxford University @@ -7,17 +7,13 @@ BL3 4LG England -## To build: - make all - -### To run +Judges' comments: To use: + make imc ./imc INTEGER -## Judges' comments - Try: ./imc 3 ./imc 3 @@ -27,7 +23,8 @@ This entry's algorithm is as magic as its output! -## Author's comments + +Selected notes from the author: This program may be compiled with an ANSI or K&R compiler. A few harmless warnings are displayed only if "gcc -Wall" is used. diff --git a/1994/ldb/Makefile b/1994/ldb/Makefile index 775f09661..964287422 100644 --- a/1994/ldb/Makefile +++ b/1994/ldb/Makefile @@ -1,593 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - ldb - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -1WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh +# 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 -O +#CFLAGS= -# Set X11_LIBDIR to the directory where the X11 library resides +# ANSI compiler # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +# Set CC to the name of your ANSI compiler. +#CC=cc +CC=gcc -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# winners that compile under ANSI C # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +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 -# Common C compiler warnings to silence -# -#CSILENCE= -CSILENCE= -Wno-trigraphs +all: $(WINNERS) $(ALT_NAMES) -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +westley: westley.c + ${CC} ${CFLAGS} westley.c -DO -o westley -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +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 -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc +shapiro_t1: shapiro.c + ${CC} ${CFLAGS} shapiro.c -o shapiro_t1 -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -CSILENCE+= -Wno-missing-variable-declarations -Wno-poison-system-directories -# -CWARN+= -Weverything -# -endif +shapiro.alt: shapiro.alt.c + ${CC} ${CFLAGS} shapiro.alt.c -o shapiro.alt -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi +horton: horton.c + ${CC} ${CFLAGS} horton.c -o horton -############################## -# Special flags for this entry -############################## +# Here are some programs related to the horton entry. See horton.hint +# for details. # -ENTRY= ldb -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= - - -################# -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} - -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/ldb/README.md b/1994/ldb/README.md index 5df2ce072..ced51b55b 100644 --- a/1994/ldb/README.md +++ b/1994/ldb/README.md @@ -1,4 +1,4 @@ -# Best One-liner: +Best One-liner: Laurion Burchall Brown University @@ -6,25 +6,23 @@ Providence RI 02912-4641 USA -## To build: - make all - -### To run +Judges' comments: + To use: + make ldb ./ldb < file Try: ./ldb < /etc/passwd -## Judges' comments - Tri-graphs are natural obfuscators. Most C-beautifiers become C-uglifiers because they don't handle them correctly. Can you figure out how it prints a given random line from stdin? -## Author's comments + +Selected notes from the author: All input lines must be under 232 characters long. The compiling platform should be ASCII based. diff --git a/1994/schnitzi/Makefile b/1994/schnitzi/Makefile index 103bf0caa..964287422 100644 --- a/1994/schnitzi/Makefile +++ b/1994/schnitzi/Makefile @@ -1,617 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - schnitzi - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +#CC=cc +CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schnitzi -PROG= ${ENTRY} +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. # -all: data ${TARGET} - @${TRUE} +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt +gtface: gtface.c + ${CC} ${CFLAGS} gtface.c -o gtface -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +imc: imc.c + ${CC} ${CFLAGS} imc.c -o imc -# alternative executable +dodsond2: dodsond2.c + ${CC} ${CFLAGS} dodsond2.c -o dodsond2 + +# NOTE: this is the original (gziped) file that won # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/shapiro/Makefile b/1994/shapiro/Makefile index 949c064e6..964287422 100644 --- a/1994/shapiro/Makefile +++ b/1994/shapiro/Makefile @@ -1,617 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - shapiro - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +#CC=cc +CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= shapiro -PROG= ${ENTRY} +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. # -all: data ${TARGET} - @${TRUE} +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt +gtface: gtface.c + ${CC} ${CFLAGS} gtface.c -o gtface -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +imc: imc.c + ${CC} ${CFLAGS} imc.c -o imc -# alternative executable +dodsond2: dodsond2.c + ${CC} ${CFLAGS} dodsond2.c -o dodsond2 + +# NOTE: this is the original (gziped) file that won # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/smr/Makefile b/1994/smr/Makefile index 0fa7ca16f..964287422 100644 --- a/1994/smr/Makefile +++ b/1994/smr/Makefile @@ -1,617 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - smr - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +#CC=cc +CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= smr -PROG= ${ENTRY} +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. # -all: data ${TARGET} - @${TRUE} +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt +gtface: gtface.c + ${CC} ${CFLAGS} gtface.c -o gtface -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +imc: imc.c + ${CC} ${CFLAGS} imc.c -o imc -# alternative executable +dodsond2: dodsond2.c + ${CC} ${CFLAGS} dodsond2.c -o dodsond2 + +# NOTE: this is the original (gziped) file that won # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/tvr/Makefile b/1994/tvr/Makefile index 49a191b71..964287422 100644 --- a/1994/tvr/Makefile +++ b/1994/tvr/Makefile @@ -1,617 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - tvr - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +#CC=cc +CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= tvr -PROG= ${ENTRY} +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. # -all: data ${TARGET} - @${TRUE} +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt +gtface: gtface.c + ${CC} ${CFLAGS} gtface.c -o gtface -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +imc: imc.c + ${CC} ${CFLAGS} imc.c -o imc -# alternative executable +dodsond2: dodsond2.c + ${CC} ${CFLAGS} dodsond2.c -o dodsond2 + +# NOTE: this is the original (gziped) file that won # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/weisberg/Makefile b/1994/weisberg/Makefile index 9a1f2b79a..964287422 100644 --- a/1994/weisberg/Makefile +++ b/1994/weisberg/Makefile @@ -1,617 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - weisberg - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +#CC=cc +CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= weisberg -PROG= ${ENTRY} +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. # -all: data ${TARGET} - @${TRUE} +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt +gtface: gtface.c + ${CC} ${CFLAGS} gtface.c -o gtface -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +imc: imc.c + ${CC} ${CFLAGS} imc.c -o imc -# alternative executable +dodsond2: dodsond2.c + ${CC} ${CFLAGS} dodsond2.c -o dodsond2 + +# NOTE: this is the original (gziped) file that won # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1994/westley/Makefile b/1994/westley/Makefile index 8b092f295..964287422 100644 --- a/1994/westley/Makefile +++ b/1994/westley/Makefile @@ -1,617 +1,157 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1994 winning entry - westley - -################################################################################ +# 1994 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +#CC=cc +CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= westley -PROG= ${ENTRY} +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. # -all: data ${TARGET} - @${TRUE} +horton.alt: horton.alt.c + ${CC} ${CFLAGS} horton.alt.c -o horton.alt +gtface: gtface.c + ${CC} ${CFLAGS} gtface.c -o gtface -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +ldb: ldb.c + ${CC} ${CFLAGS} ldb.c -o ldb -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +imc: imc.c + ${CC} ${CFLAGS} imc.c -o imc -# alternative executable +dodsond2: dodsond2.c + ${CC} ${CFLAGS} dodsond2.c -o dodsond2 + +# NOTE: this is the original (gziped) file that won # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ +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 +dodsond2.gz: dodsond2.gz.uu + @${RM} -f dodsond2.gz + ${UUDECODE} dodsond2.gz.uu + +dodsond1: dodsond1.c + ${CC} ${CFLAGS} dodsond1.c -o dodsond1 + +clean: + $(RM) -f *.o a.out core + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) + ${RM} -f dodsond2.orig.c dodsond2.gz shapiro_t2.c shapiro_t1 -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/Makefile b/1995/Makefile index 3948878a4..e58a0360f 100644 --- a/1995/Makefile +++ b/1995/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/1995/cdua/Makefile b/1995/cdua/Makefile index 69565834b..95246c58b 100644 --- a/1995/cdua/Makefile +++ b/1995/cdua/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - cdua - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= cdua -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/dodsond1/Makefile b/1995/dodsond1/Makefile index a27933f88..95246c58b 100644 --- a/1995/dodsond1/Makefile +++ b/1995/dodsond1/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - dodsond1 - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= dodsond1 -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/dodsond2/Makefile b/1995/dodsond2/Makefile index 24da0a920..95246c58b 100644 --- a/1995/dodsond2/Makefile +++ b/1995/dodsond2/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - dodsond2 - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= dodsond2 -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/esde/Makefile b/1995/esde/Makefile index dc01b137f..95246c58b 100644 --- a/1995/esde/Makefile +++ b/1995/esde/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - esde - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= esde -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/garry/Makefile b/1995/garry/Makefile index bd9ee3997..95246c58b 100644 --- a/1995/garry/Makefile +++ b/1995/garry/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - garry - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= garry -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/heathbar/Makefile b/1995/heathbar/Makefile index 909a2cf46..95246c58b 100644 --- a/1995/heathbar/Makefile +++ b/1995/heathbar/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - heathbar - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= heathbar -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/leo/Makefile b/1995/leo/Makefile index 93cd10385..95246c58b 100644 --- a/1995/leo/Makefile +++ b/1995/leo/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - leo - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= leo -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/makarios/Makefile b/1995/makarios/Makefile index 880c445ea..95246c58b 100644 --- a/1995/makarios/Makefile +++ b/1995/makarios/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - makarios - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= makarios -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/savastio/Makefile b/1995/savastio/Makefile index 1c8ba6a8b..95246c58b 100644 --- a/1995/savastio/Makefile +++ b/1995/savastio/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - savastio - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= savastio -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/schnitzi/Makefile b/1995/schnitzi/Makefile index 0bceb6a02..95246c58b 100644 --- a/1995/schnitzi/Makefile +++ b/1995/schnitzi/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - schnitzi - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schnitzi -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/spinellis/Makefile b/1995/spinellis/Makefile index 030324407..95246c58b 100644 --- a/1995/spinellis/Makefile +++ b/1995/spinellis/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - spinellis - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= spinellis -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1995/vanschnitz/Makefile b/1995/vanschnitz/Makefile index 74c43c831..95246c58b 100644 --- a/1995/vanschnitz/Makefile +++ b/1995/vanschnitz/Makefile @@ -1,617 +1,118 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1995 winning entry - vanschnitz - -################################################################################ +# 1995 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= vanschnitz -PROG= ${ENTRY} +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. # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +garry.fmt: garry.fmt.c + ${CC} ${CFLAGS} garry.fmt.c -o garry.fmt + +# The following are test progs for garry # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +# NOTE: this is the original program that was non-interactive # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +makarios: makarios.c + ${CC} ${CFLAGS} makarios.c -o makarios -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi: schnitzi.c + ${CC} ${CFLAGS} schnitzi.c -o schnitzi -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +spinellis: spinellis.c + ${CC} ${CFLAGS} spinellis.c -o spinellis -# data files -# -data: ${DATA} - @${TRUE} +vanschnitz: vanschnitz.c + ${CC} ${CFLAGS} -Dn=${LEVEL} vanschnitz.c -o vanschnitz -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + $(RM) -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + $(RM) -f $(WINNERS) + $(RM) -f $(ALT_NAMES) -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/Makefile b/1996/Makefile index 20bd8e4db..ba2c62aec 100644 --- a/1996/Makefile +++ b/1996/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/1996/august/Makefile b/1996/august/Makefile index ef47612bc..d06ef33b5 100644 --- a/1996/august/Makefile +++ b/1996/august/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - august - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= august -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/dalbec/Makefile b/1996/dalbec/Makefile index 46566774f..d06ef33b5 100644 --- a/1996/dalbec/Makefile +++ b/1996/dalbec/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - dalbec - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= dalbec -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/eldby/Makefile b/1996/eldby/Makefile index 72d0b6260..d06ef33b5 100644 --- a/1996/eldby/Makefile +++ b/1996/eldby/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - eldby - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= eldby -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/gandalf/Makefile b/1996/gandalf/Makefile index ddb1d75c7..d06ef33b5 100644 --- a/1996/gandalf/Makefile +++ b/1996/gandalf/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - gandalf - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= gandalf -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/huffman/Makefile b/1996/huffman/Makefile index 694c62860..d06ef33b5 100644 --- a/1996/huffman/Makefile +++ b/1996/huffman/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - huffman - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= huffman -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/jonth/Makefile b/1996/jonth/Makefile index 599b968b2..d06ef33b5 100644 --- a/1996/jonth/Makefile +++ b/1996/jonth/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - jonth - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= jonth -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/rcm/Makefile b/1996/rcm/Makefile index 634514a0d..d06ef33b5 100644 --- a/1996/rcm/Makefile +++ b/1996/rcm/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - rcm - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= rcm -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/schweikh1/Makefile b/1996/schweikh1/Makefile index 698c5c70d..d06ef33b5 100644 --- a/1996/schweikh1/Makefile +++ b/1996/schweikh1/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - schweikh1 - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schweikh1 -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/schweikh2/Makefile b/1996/schweikh2/Makefile index 818b5e1a3..d06ef33b5 100644 --- a/1996/schweikh2/Makefile +++ b/1996/schweikh2/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - schweikh2 - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schweikh2 -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/schweikh3/Makefile b/1996/schweikh3/Makefile index 98fb60589..d06ef33b5 100644 --- a/1996/schweikh3/Makefile +++ b/1996/schweikh3/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - schweikh3 - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schweikh3 -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1996/westley/Makefile b/1996/westley/Makefile index b57b42532..d06ef33b5 100644 --- a/1996/westley/Makefile +++ b/1996/westley/Makefile @@ -1,617 +1,156 @@ -#!/usr/bin/env make +# %W% %G% %U% # -# IOCCC 1996 winning entry - westley - -################################################################################ +# 1996 makefile # -# 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 judges 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/ +# 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 used by this Makefile -############################# -# -SHELL= bash +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +GUNZIP=gunzip +UUDECODE=uudecode +LN=ln +RM=rm +SED=sed +TRUE=true -####################### -# common tool locations -####################### +# flags for ANSI compiles # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides +# 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. # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# 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. # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +#CFLAGS= -ansi +CFLAGS= -ansi -O +#CFLAGS= # 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 -#CC=clang -MAY_NEED_GCC= gcc +CC=cc +#CC=gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= westley -PROG= ${ENTRY} +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: # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +# 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 # -ALT_OBJ= -ALT_TARGET= +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 - -################# -# build the entry -################# +# NOTE: this is the original source that won # -all: data ${TARGET} - @${TRUE} +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 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby -# alternative executable +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 # -alt: data ${ALT_TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -# data files +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: # -data: ${DATA} - @${TRUE} +# ${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 -# both all and alt -# -everything: all alt +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f $(WINNERS) + ${RM} -f $(ALT_NAMES) + ${RM} -f fac.oo parse.oo test.oo hatcat cathat august.oc -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} $(WINNERS) $(ALT_NAMES) > /dev/null diff --git a/1998/Makefile b/1998/Makefile index 1bec79809..ec4f803bc 100644 --- a/1998/Makefile +++ b/1998/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/1998/banks/Makefile b/1998/banks/Makefile index 462d71b54..c939c82aa 100644 --- a/1998/banks/Makefile +++ b/1998/banks/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - banks +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= banks -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/bas1/Makefile b/1998/bas1/Makefile index f104ea3ae..c939c82aa 100644 --- a/1998/bas1/Makefile +++ b/1998/bas1/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - bas1 +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= bas1 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/bas2/Makefile b/1998/bas2/Makefile index 13452cfbe..c939c82aa 100644 --- a/1998/bas2/Makefile +++ b/1998/bas2/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - bas2 +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= bas2 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/chaos/Makefile b/1998/chaos/Makefile index f34bcc638..c939c82aa 100644 --- a/1998/chaos/Makefile +++ b/1998/chaos/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - chaos +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= chaos -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/df/Makefile b/1998/df/Makefile index 19b3d51e4..c939c82aa 100644 --- a/1998/df/Makefile +++ b/1998/df/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - df +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= df -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/dlowe/Makefile b/1998/dlowe/Makefile index 715692373..c939c82aa 100644 --- a/1998/dlowe/Makefile +++ b/1998/dlowe/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - dlowe +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= dlowe -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/dloweneil/Makefile b/1998/dloweneil/Makefile index 426330829..c939c82aa 100644 --- a/1998/dloweneil/Makefile +++ b/1998/dloweneil/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - dloweneil +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= dloweneil -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/dorssel/Makefile b/1998/dorssel/Makefile index 0c0534b3e..c939c82aa 100644 --- a/1998/dorssel/Makefile +++ b/1998/dorssel/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - dorssel +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= dorssel -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/fanf/Makefile b/1998/fanf/Makefile index f37175b11..c939c82aa 100644 --- a/1998/fanf/Makefile +++ b/1998/fanf/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - fanf +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= fanf -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/schnitzi/Makefile b/1998/schnitzi/Makefile index 3c8365234..c939c82aa 100644 --- a/1998/schnitzi/Makefile +++ b/1998/schnitzi/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - schnitzi +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schnitzi -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/schweikh1/Makefile b/1998/schweikh1/Makefile index ead90ebbb..c939c82aa 100644 --- a/1998/schweikh1/Makefile +++ b/1998/schweikh1/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - schweikh1 +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schweikh1 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/schweikh2/Makefile b/1998/schweikh2/Makefile index 91cb74787..c939c82aa 100644 --- a/1998/schweikh2/Makefile +++ b/1998/schweikh2/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - schweikh2 +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schweikh2 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/schweikh3/Makefile b/1998/schweikh3/Makefile index 497eceeaf..c939c82aa 100644 --- a/1998/schweikh3/Makefile +++ b/1998/schweikh3/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - schweikh3 +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= schweikh3 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/1998/tomtorfs/Makefile b/1998/tomtorfs/Makefile index ffb05b911..c939c82aa 100644 --- a/1998/tomtorfs/Makefile +++ b/1998/tomtorfs/Makefile @@ -1,435 +1,43 @@ -#!/usr/bin/env make +#!/bin/make +# 1998 makefile # -# IOCCC 1998 winning entry - tomtorfs +# 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. -################################################################################ -# -# 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 judges 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 -# -################################################################################ +SHELL=/bin/sh +CAT=cat +CHMOD=chmod +CP=cp +MV=mv +LN=ln +RM=rm +SED=sed +TRUE=true -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# flags for ANSI compiles # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. +# 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. # -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this 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. # -SHELL= bash - -####################### -# common tool locations -####################### +# 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. # -A2P= a2p -AR= ar -ASA= asa -AT= at -ATQ= atq -ATRM= atrm -AWK= awk -BANNER= banner -BASE64= base64 -BASENAME= basename -BATCH= batch -BC= bc -BINHEX= binhex -BISON= bison -BUNZIP2= bunzip2 -BZCAT= bzcat -BZCMP= bzcmp -BZDIFF= bzdiff -BZEGREP= bzegrep -BZFGREP= bzfgrep -BZGREP= bzgrep -BZIP2= bzip2 -BZLESS= bzless -BZMORE= bzmore -C2PH= c2ph -C89= c89 -C99= c99 -CAL= cal -CALC= calc -CAT= cat -CD= cd -CHFLAGS= chflags -CHGRP= chgrp -CHMOD= chmod -CKSUM= cksum -CLANG= clang -CLANG_PLUSPLUS= clang++ -CLEAR= clear -CMP= cmp -COL= col -COLLDEF= colldef -COLRM= colrm -COLUMN= column -COMPRESS= compress -CP= cp -CPIO= cpio -CPP= cpp -CRC32= crc32 -CSH= csh -CSPLIT= csplit -CURL= curl -CUT= cut -C_PLUSPLUS= c++ -C_PLUSPLUS_FILT= c++filt -DATE= date -DC= dc -DD= dd -DF= df -DIFF3= diff3 -DIFF= diff -DIG= dig -DIRNAME= dirname -ED= ed -EGREP= egrep -ENV= env -EQN= eqn -ETAGS= etags -EXPECT= expect -EXPR= expr -FALSE= false -FGREP= fgrep -FILE= file -FIND2PERL= find2perl -FIND= find -FLEX= flex -FLEX_PLUSPLUS= flex++ -FMT= fmt -FOLD= fold -FS_USAGE= fs_usage -FUNZIP= funzip -FUSER= fuser -GCC= gcc -GDIFFMK= gdiffmk -GENCAT= gencat -GENSTRINGS= genstrings -GETOPT= getopt -GETOPTS= getopts -GINDENT= gindent -GNUMAKE= gnumake -GREP= grep -GROFF= groff -GROFFER= groffer -GROG= grog -GROPS= grops -GROTTY= grotty -GUNZIP= gunzip -GVIM= gvim -GZCAT= gzcat -GZEXE= gzexe -GZIP_PROG= gzip -G_PLUSPLUS= g++ -H2PH= h2ph -H2XS= h2xs -HASH= hash -HEAD= head -HOSTNAME_PROG= hostname -ICONV= iconv -ID= id -INDENT= indent -INFO= info -JOT= jot -KILL= kill -KSH= ksh -LAST= last -LD= ld -LESSECHO= lessecho -LEX= len -LINK= link -LN= ln -LS= ls -M4= m4 -MAKE= make -MAN= man -MKDIR= mkdir -MKFIFO= mkfifo -MKTEMP= mktemp -MV= mv -NANO= nano -NASM= nasm -NEQN= neqn -NICE= nice -NL= nl -NM= nm -NOHUP= nohup -NROFF= nroff -NSLOOKUP= nslookup -OD= od -OPENSSL= openssl -PASTE= paste -PATCH= patch -PATHCHK= pathchk -PAX= pax -PERL= perl -PICO= pico -PR= pr -PRINTENV= printenv -PS= ps -PTAR= ptar -PTARDIFF= ptardiff -PTARGREP= ptargrep -PWD= pwd -PYDOC= pydoc -PYTHON= python -PYTHONW= pythonw -READLINK= readlink -RENICE= renice -RESET= reset -REV= rev -RI= ri -RM= rm -RMDIR= rmdir -RSYNC= rsync -RUBY= ruby -RVIM= rvim -SAY= say -SCP= scp -SCREEN= screen -SCRIPT= script -SDIFF= sdiff -SED= sed -SEQ= seq -SFTP= sftp -SH= sh -SHA1= sha1 -SHA= sha -SHAR= shar -SHASUM5_18= shasum5.18 -SHASUM= shasum -SIZE= size -SLEEP= sleep -SORT= sort -SSH= ssh -STAT= stat -STRIP= strip -STTY= stty -SUM= sum -SYNC= sync -TABS= tabs -TAIL= tail -TAR= tar -TEE= tee -TEST= test -TFTP= tftp -TIDY= tidy -TIME= time -TOP= top -TOUCH= touch -TPUT= tout -TPUT= tput -TR= tr -TROFF= troff -TRUE= true -TSET= tset -TSORT= tsort -UL= ul -UNAME= uname -UNCOMPRESS= uncompress -UNEXPAND= unexpand -UNIFDEF= unifdef -UNIFDEFALL= unifdefall -UNIQ= uniq -UNITS= units -UNLINK= unlink -UNZIP= unzip -UNZIPSFX= unzipsfx -UPTIME= uptime -UUDECODE= uudecode -UUENCODE= uuencode -UUIDGEN= uuidgen -VI= vi -VIEW= view -VIM= vim -VIMDIFF= vimdiff -W= w -WAIT4PATH= wait4path -WAIT= wait -WC= wc -WGET= wget -WHAT= what -WHATIS= whatis -WHICH= which -WHO= who -WHOAMI= whoami -WHOIS= whois -WRTIE= write -XAR= xar -XARGS= xargs -XATTR= xattr -XXD= xxd -YACC= yacc -YES= yes -ZCAT= zcat -ZCMP= zcmp -ZDIFF= zdiff -ZEGREP= zegrep -ZFGREP= zfgrep -ZFORCE= zforce -ZGREP= zgrep -ZIP= zip -ZIPCLOAK= zipcloak -ZIPGREp= zipgrep -ZIPINFo= zipinfo -ZIPNOTE= zipnote -ZIPSPLIT= zipsplit -ZLESS= zless -ZMORE= zmore -ZNEW= znew -ZPRINT= zprint -ZSH= zsh - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - -# CWARN - Silence warnings that ${CWARN} would normally complain about -# CSILENCE -Compiler warnings -# -ifeq ($(CC),clang) - -# clang CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -else -ifeq ($(CC),gcc) - -# gcc CSILENCE and CWARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -else - -# default CSILENCE and WARN -# -CSILENCE= -#CSILENCE= -Wno-implicit-int -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -endif -endif - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib # ANSI compiler # @@ -443,175 +51,124 @@ LIBS= # to disable such programs. # CC= cc -#CC=clang MAY_NEED_GCC= gcc - -############################## -# Special flags for this entry -############################## +# winners that compile under ANSI C # -ENTRY= tomtorfs -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +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 # -ALT_OBJ= -ALT_TARGET= +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 -################# -# build the entry -################# +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 # -all: data ${TARGET} - @${TRUE} +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - - -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f *.o a.out core ${WINNERS} + ${RM} -f prog.c fanftmp1.c fanftmp2.c chaos_nohalf.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} -install: - @echo "Dr. Spock says that is not logical!" +nuke: clobber @${TRUE} -# you may be able to misunderstand the source by reading indent.c -# -indent.c: ${PROG}.c - @if which "${GINDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${GINDENT} < $< > $@"; \ - ${GINDENT} < $< > $@; \ - elif which "${INDENT}" >/dev/null 2>&1; then \ - echo ${RM} -f $@; \ - ${RM} -f $@; \ - echo "${INDENT} < $< > $@"; \ - ${INDENT} < $< > $@; \ - else \ - echo "no intent tool found, ident $< yourself, sorry"; \ - echo "exit 1"; \ - exit 1; \ - fi - - -################## -# 133t hacker rulz -################## -# -love: - @echo 'not war?' - @${TRUE} - -haste: - $(MAKE) waste - @${TRUE} - -waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} - -easter_egg: - @echo "you expected to often misunderstand this $${RANDOM} magic" - @echo "chongo '' /\\oo/\\" - @echo "Eggy" - -sandwich: easter_egg - @if [ `id -u` -eq 0 ]; then \ - echo 'Okay.'; \ - echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \ - else \ - echo 'What? Make it yourself.'; \ - exit 1; \ - fi - -# Understand the history of the Homebrew Computer Club -# as well as the West Coast Computer Faire and -# you might be confused different. :-) -# -supernova: sandwich - @-if [ -r .code_anal ]; then \ - ${RM} -f .code_anal_v6; \ - else \ - echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \ - fi - @echo "A $@ helps ${MAKE} the elements that help form planets" - @${TRUE} - -deep_magic: supernova - @-if [ -r .code_anal ]; then \ - ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \ - --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - sleep 2; \ - echo "Wrong! Do it again!"; \ - fi - @${TRUE} - -magic: deep_magic - @-if [ -r .code_anal ]; then \ - ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \ - else \ - echo "If you don't eat yer meat, you can't have any pudding!"; \ - echo "How can you have any pudding if you don't eat yer meat?!"; \ - fi - @${TRUE} - -# The IOCCC resident astronomer states -# -charon: magic - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore IAU, $@ is a planet" - -pluto: charon - ${MAKE} charon - @echo "$@ is a dwarf planet" - @echo "dwarf is a type of planet" - @echo "therefore, $@ is a planet" - @echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them" +install: all + ${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null diff --git a/2000/Makefile b/2000/Makefile index f4b9ca767..2f6d462f7 100644 --- a/2000/Makefile +++ b/2000/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/2000/anderson/Makefile b/2000/anderson/Makefile index 6ff709d00..25524921d 100644 --- a/2000/anderson/Makefile +++ b/2000/anderson/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/bellard/Makefile b/2000/bellard/Makefile index 6ff709d00..25524921d 100644 --- a/2000/bellard/Makefile +++ b/2000/bellard/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/bmeyer/Makefile b/2000/bmeyer/Makefile index 6ff709d00..25524921d 100644 --- a/2000/bmeyer/Makefile +++ b/2000/bmeyer/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/briddlebane/Makefile b/2000/briddlebane/Makefile index 6ff709d00..25524921d 100644 --- a/2000/briddlebane/Makefile +++ b/2000/briddlebane/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/dhyang/Makefile b/2000/dhyang/Makefile index 6ff709d00..25524921d 100644 --- a/2000/dhyang/Makefile +++ b/2000/dhyang/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/dlowe/Makefile b/2000/dlowe/Makefile index 6ff709d00..25524921d 100644 --- a/2000/dlowe/Makefile +++ b/2000/dlowe/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/jarijyrki/Makefile b/2000/jarijyrki/Makefile index 6ff709d00..25524921d 100644 --- a/2000/jarijyrki/Makefile +++ b/2000/jarijyrki/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/natori/Makefile b/2000/natori/Makefile index 6ff709d00..25524921d 100644 --- a/2000/natori/Makefile +++ b/2000/natori/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/primenum/Makefile b/2000/primenum/Makefile index 6ff709d00..25524921d 100644 --- a/2000/primenum/Makefile +++ b/2000/primenum/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/rince/Makefile b/2000/rince/Makefile index 6ff709d00..25524921d 100644 --- a/2000/rince/Makefile +++ b/2000/rince/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/robison/Makefile b/2000/robison/Makefile index 6ff709d00..25524921d 100644 --- a/2000/robison/Makefile +++ b/2000/robison/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/schneiderwent/Makefile b/2000/schneiderwent/Makefile index 6ff709d00..25524921d 100644 --- a/2000/schneiderwent/Makefile +++ b/2000/schneiderwent/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/thadgavin/Makefile b/2000/thadgavin/Makefile index 6ff709d00..25524921d 100644 --- a/2000/thadgavin/Makefile +++ b/2000/thadgavin/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2000/tomx/Makefile b/2000/tomx/Makefile index 6ff709d00..25524921d 100644 --- a/2000/tomx/Makefile +++ b/2000/tomx/Makefile @@ -8,14 +8,14 @@ # entirety and remains unaltered. All other uses must receive prior permission # from the contest judges. -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/Makefile b/2001/Makefile index 81dd8693a..f1a40acf6 100644 --- a/2001/Makefile +++ b/2001/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/2001/anonymous/Makefile b/2001/anonymous/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/anonymous/Makefile +++ b/2001/anonymous/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/bellard/Makefile b/2001/bellard/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/bellard/Makefile +++ b/2001/bellard/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/cheong/Makefile b/2001/cheong/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/cheong/Makefile +++ b/2001/cheong/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/coupard/Makefile b/2001/coupard/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/coupard/Makefile +++ b/2001/coupard/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/ctk/Makefile b/2001/ctk/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/ctk/Makefile +++ b/2001/ctk/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/dgbeards/Makefile b/2001/dgbeards/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/dgbeards/Makefile +++ b/2001/dgbeards/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/herrmann1/Makefile b/2001/herrmann1/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/herrmann1/Makefile +++ b/2001/herrmann1/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/herrmann2/Makefile b/2001/herrmann2/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/herrmann2/Makefile +++ b/2001/herrmann2/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/jason/Makefile b/2001/jason/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/jason/Makefile +++ b/2001/jason/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/kev/Makefile b/2001/kev/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/kev/Makefile +++ b/2001/kev/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/ollinger/Makefile b/2001/ollinger/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/ollinger/Makefile +++ b/2001/ollinger/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/rosten/Makefile b/2001/rosten/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/rosten/Makefile +++ b/2001/rosten/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/schweikh/Makefile b/2001/schweikh/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/schweikh/Makefile +++ b/2001/schweikh/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/westley/Makefile b/2001/westley/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/westley/Makefile +++ b/2001/westley/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2001/williams/Makefile b/2001/williams/Makefile index 4e5458226..49e7cf5a9 100644 --- a/2001/williams/Makefile +++ b/2001/williams/Makefile @@ -45,14 +45,14 @@ # See: http://creativecommons.org/licenses/by-sa/3.0/ -SHELL= bash +SHELL= /bin/sh CAT= cat RM= rm SED= sed TRUE= true #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/Makefile b/2004/Makefile index d81d5b978..69964d36a 100644 --- a/2004/Makefile +++ b/2004/Makefile @@ -50,7 +50,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash MAKE= make diff --git a/2004/anonymous/Makefile b/2004/anonymous/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/anonymous/Makefile +++ b/2004/anonymous/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/arachnid/Makefile b/2004/arachnid/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/arachnid/Makefile +++ b/2004/arachnid/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/burley/Makefile b/2004/burley/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/burley/Makefile +++ b/2004/burley/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/gavare/Makefile b/2004/gavare/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/gavare/Makefile +++ b/2004/gavare/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/gavin/Makefile b/2004/gavin/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/gavin/Makefile +++ b/2004/gavin/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/hibachi/Makefile b/2004/hibachi/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/hibachi/Makefile +++ b/2004/hibachi/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/hoyle/Makefile b/2004/hoyle/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/hoyle/Makefile +++ b/2004/hoyle/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/jdalbec/Makefile b/2004/jdalbec/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/jdalbec/Makefile +++ b/2004/jdalbec/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/kopczynski/Makefile b/2004/kopczynski/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/kopczynski/Makefile +++ b/2004/kopczynski/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/newbern/Makefile b/2004/newbern/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/newbern/Makefile +++ b/2004/newbern/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/omoikane/Makefile b/2004/omoikane/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/omoikane/Makefile +++ b/2004/omoikane/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/schnitzi/Makefile b/2004/schnitzi/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/schnitzi/Makefile +++ b/2004/schnitzi/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/sds/Makefile b/2004/sds/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/sds/Makefile +++ b/2004/sds/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/vik1/Makefile b/2004/vik1/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/vik1/Makefile +++ b/2004/vik1/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2004/vik2/Makefile b/2004/vik2/Makefile index 88591c66d..84ef098e4 100644 --- a/2004/vik2/Makefile +++ b/2004/vik2/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -45,7 +45,7 @@ X11_LIBDIR= /usr/X11R6/lib #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2005/Makefile b/2005/Makefile index 3a8556bfd..56e789e1a 100644 --- a/2005/Makefile +++ b/2005/Makefile @@ -11,7 +11,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -31,7 +31,7 @@ X11_LIBDIR= /usr/X11R6/lib # X11_INCLUDEDIR= /usr/X11R6/include -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2006/Makefile b/2006/Makefile index d5ad3e1c9..0a6e2679e 100644 --- a/2006/Makefile +++ b/2006/Makefile @@ -10,7 +10,7 @@ # tool locations # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp GUNZIP= gunzip @@ -31,7 +31,7 @@ X11_LIBDIR= /usr/X11R6/lib X11_INCDIR= /usr/X11R6/include -# Optimization +# optimization # # Most compiles will safely use -O3. Some can use only -O2 or -O1 or -O. # A few compilers have broken optimizers and thus you may diff --git a/2011/Makefile b/2011/Makefile index 2180caf09..724734525 100644 --- a/2011/Makefile +++ b/2011/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash CP= cp CPP= cpp GUNZIP= gunzip diff --git a/2011/akari/Makefile b/2011/akari/Makefile index df5581c03..4beb27453 100644 --- a/2011/akari/Makefile +++ b/2011/akari/Makefile @@ -29,12 +29,12 @@ TRUE= true # CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # CSTD= -std=c99 CSTD2= -ansi -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness, # other entries require 64-bitess. @@ -42,7 +42,7 @@ CSTD2= -ansi # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/blakely/Makefile b/2011/blakely/Makefile index 6003bcd01..0288d8eb3 100644 --- a/2011/blakely/Makefile +++ b/2011/blakely/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/borsanyi/Makefile b/2011/borsanyi/Makefile index 729b08650..7e4fefa56 100644 --- a/2011/borsanyi/Makefile +++ b/2011/borsanyi/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/dlowe/Makefile b/2011/dlowe/Makefile index 0d3e4d986..485aa7a9f 100644 --- a/2011/dlowe/Makefile +++ b/2011/dlowe/Makefile @@ -29,11 +29,11 @@ TRUE= true # CWARN= -Wall -W -# Compiler standard +# compiler standard # CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness, # other entries require 64-bitess. @@ -41,7 +41,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/eastman/Makefile b/2011/eastman/Makefile index 330a76273..c8a1242f9 100644 --- a/2011/eastman/Makefile +++ b/2011/eastman/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/fredriksson/Makefile b/2011/fredriksson/Makefile index 58adc07b1..6c7db428f 100644 --- a/2011/fredriksson/Makefile +++ b/2011/fredriksson/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/goren/Makefile b/2011/goren/Makefile index 80e8935b7..06a6f3e2a 100644 --- a/2011/goren/Makefile +++ b/2011/goren/Makefile @@ -29,11 +29,11 @@ TRUE= true # CWARN= -# Compiler standard +# compiler standard # CSTD= -ansi -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness, # other entries require 64-bitess. @@ -52,7 +52,7 @@ else ARCH= endif -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/hamaji/Makefile b/2011/hamaji/Makefile index 8df412612..634f939bd 100644 --- a/2011/hamaji/Makefile +++ b/2011/hamaji/Makefile @@ -29,11 +29,11 @@ TRUE= true # CWARN= -Wall -W -# Compiler standard +# compiler standard # CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness, # other entries require 64-bitess. @@ -41,7 +41,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/hou/Makefile b/2011/hou/Makefile index 36af73f6e..dc122f5c1 100644 --- a/2011/hou/Makefile +++ b/2011/hou/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/konno/Makefile b/2011/konno/Makefile index 4babec4c7..e6b9ad1fd 100644 --- a/2011/konno/Makefile +++ b/2011/konno/Makefile @@ -29,11 +29,11 @@ TRUE= true # CWARN= -Wall -W -# Compiler standard +# compiler standard # CSTD= -ansi -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness, # other entries require 64-bitess. @@ -41,7 +41,7 @@ CSTD= -ansi # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/richards/Makefile b/2011/richards/Makefile index 4feaaac1d..e0119c054 100644 --- a/2011/richards/Makefile +++ b/2011/richards/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/toledo/Makefile b/2011/toledo/Makefile index a35d50577..aa683b755 100644 --- a/2011/toledo/Makefile +++ b/2011/toledo/Makefile @@ -31,7 +31,7 @@ X11_LIBDIR= /usr/X11R6/lib # X11_INCDIR= /usr/X11R6/include -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/vik/Makefile b/2011/vik/Makefile index 61b657726..590383e84 100644 --- a/2011/vik/Makefile +++ b/2011/vik/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2011/zucker/Makefile b/2011/zucker/Makefile index 5ac52ede9..d30ac2418 100644 --- a/2011/zucker/Makefile +++ b/2011/zucker/Makefile @@ -23,7 +23,7 @@ SED= sed TAR= tar TRUE= true -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/Makefile b/2012/Makefile index b96108de0..279365de3 100644 --- a/2012/Makefile +++ b/2012/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash CP= cp CPP= cpp GUNZIP= gunzip diff --git a/2012/blakely/Makefile b/2012/blakely/Makefile index dbf04de7f..dea22c76c 100644 --- a/2012/blakely/Makefile +++ b/2012/blakely/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include #CWARN= -Wall -W CWARN= -Wall -W -pedantic -Wno-unused-parameter -# Compiler standard +# compiler standard # #CSTD= CSTD= -ansi #CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -ansi # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/deckmyn/Makefile b/2012/deckmyn/Makefile index b84e68efc..6ee3a28aa 100644 --- a/2012/deckmyn/Makefile +++ b/2012/deckmyn/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/dlowe/Makefile b/2012/dlowe/Makefile index 531a9c9f5..9586f32ac 100644 --- a/2012/dlowe/Makefile +++ b/2012/dlowe/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/endoh1/Makefile b/2012/endoh1/Makefile index 25df4593d..9e3a9eed8 100644 --- a/2012/endoh1/Makefile +++ b/2012/endoh1/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include #CWARN= -Wall -W CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/endoh2/Makefile b/2012/endoh2/Makefile index 674bc15a8..18af5f651 100644 --- a/2012/endoh2/Makefile +++ b/2012/endoh2/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include #CWARN= -Wall -W CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/grothe/Makefile b/2012/grothe/Makefile index 16417fe42..d01f60606 100644 --- a/2012/grothe/Makefile +++ b/2012/grothe/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/hamano/Makefile b/2012/hamano/Makefile index e46f03b08..02f95839c 100644 --- a/2012/hamano/Makefile +++ b/2012/hamano/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/hou/Makefile b/2012/hou/Makefile index 78f2c057e..d5f290f35 100644 --- a/2012/hou/Makefile +++ b/2012/hou/Makefile @@ -39,13 +39,13 @@ CWARN= #CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= CSTD= -ansi #CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -ansi # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/kang/Makefile b/2012/kang/Makefile index 70c6b469f..9eda71558 100644 --- a/2012/kang/Makefile +++ b/2012/kang/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/konno/Makefile b/2012/konno/Makefile index 334a21848..72fa7c7ff 100644 --- a/2012/konno/Makefile +++ b/2012/konno/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/omoikane/Makefile b/2012/omoikane/Makefile index cc0e15799..cbf27d424 100644 --- a/2012/omoikane/Makefile +++ b/2012/omoikane/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/tromp/Makefile b/2012/tromp/Makefile index 11ade5e25..1e52debf9 100644 --- a/2012/tromp/Makefile +++ b/2012/tromp/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/vik/Makefile b/2012/vik/Makefile index 7089d4e17..e6df7b9aa 100644 --- a/2012/vik/Makefile +++ b/2012/vik/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= CSTD= -ansi #CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -ansi # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2012/zeitak/Makefile b/2012/zeitak/Makefile index e6f380bf8..723cccaf3 100644 --- a/2012/zeitak/Makefile +++ b/2012/zeitak/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/Makefile b/2013/Makefile index ca975c282..54116250c 100644 --- a/2013/Makefile +++ b/2013/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash CP= cp CPP= cpp GUNZIP= gunzip diff --git a/2013/birken/Makefile b/2013/birken/Makefile index a6ccf9f56..65753350b 100644 --- a/2013/birken/Makefile +++ b/2013/birken/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include #CWARN= -Wall -W CWARN= -Wall -pedantic -Wno-newline-eof -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/cable1/Makefile b/2013/cable1/Makefile index 1b93ac852..ea81d080e 100644 --- a/2013/cable1/Makefile +++ b/2013/cable1/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W -Wno-implicit-int -Wno-implicit-function-declaration #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/cable2/Makefile b/2013/cable2/Makefile index 138a86140..e94d2dfd5 100644 --- a/2013/cable2/Makefile +++ b/2013/cable2/Makefile @@ -42,13 +42,13 @@ CWARN= -Wall -Wno-bitwise-op-parentheses -Wno-unsequenced \ -Wno-implicit-int #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -60,7 +60,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/cable3/Makefile b/2013/cable3/Makefile index 780498b59..0c932f8d2 100644 --- a/2013/cable3/Makefile +++ b/2013/cable3/Makefile @@ -42,13 +42,13 @@ CWARN= -Wall -Wno-implicit-int -Wno-implicit-function-declaration \ -Wno-incompatible-pointer-types #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -60,7 +60,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/dlowe/Makefile b/2013/dlowe/Makefile index c7e8943c7..5a00000e3 100644 --- a/2013/dlowe/Makefile +++ b/2013/dlowe/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -Wno-implicit-int #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/endoh1/Makefile b/2013/endoh1/Makefile index 621cdda01..767fbbcb7 100644 --- a/2013/endoh1/Makefile +++ b/2013/endoh1/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/endoh2/Makefile b/2013/endoh2/Makefile index 69a30c06f..3396488e0 100644 --- a/2013/endoh2/Makefile +++ b/2013/endoh2/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W -Wno-empty-body #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/endoh3/Makefile b/2013/endoh3/Makefile index 0b59ffd32..43c72d420 100644 --- a/2013/endoh3/Makefile +++ b/2013/endoh3/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -Wno-implicit-int -Wno-main -Wno-implicit-function-declaration #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/endoh4/Makefile b/2013/endoh4/Makefile index 82fe0d2a3..4af07a573 100644 --- a/2013/endoh4/Makefile +++ b/2013/endoh4/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/hou/Makefile b/2013/hou/Makefile index 782102482..f9e23438e 100644 --- a/2013/hou/Makefile +++ b/2013/hou/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/mills/Makefile b/2013/mills/Makefile index 19d4add75..029e3f493 100644 --- a/2013/mills/Makefile +++ b/2013/mills/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/misaka/Makefile b/2013/misaka/Makefile index 10429a6ed..01711cc46 100644 --- a/2013/misaka/Makefile +++ b/2013/misaka/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W -Wno-comment -Wno-empty-body #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/morgan1/Makefile b/2013/morgan1/Makefile index bd9b681d7..af794a76a 100644 --- a/2013/morgan1/Makefile +++ b/2013/morgan1/Makefile @@ -40,13 +40,13 @@ CWARN= -Wall -W -Wall -Wextra -Wshadow -Wno-logical-op-parentheses \ -Wno-shift-op-parentheses #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/morgan2/Makefile b/2013/morgan2/Makefile index 5e7efad59..3627728f7 100644 --- a/2013/morgan2/Makefile +++ b/2013/morgan2/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -Wextra -Wshadow -pedantic \ -Wno-variadic-macros -Wno-string-plus-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2013/robison/Makefile b/2013/robison/Makefile index 185ff3ba1..f7f898fd6 100644 --- a/2013/robison/Makefile +++ b/2013/robison/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -W -Wno-unused-variable -Wno-parentheses -Wno-unused-value -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 #CWARN= -Wall -W -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/Makefile b/2014/Makefile index dd5383200..d5d3ebbfb 100644 --- a/2014/Makefile +++ b/2014/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash CP= cp CPP= cpp GUNZIP= gunzip diff --git a/2014/birken/Makefile b/2014/birken/Makefile index bd5fb6a67..238fbc9ef 100644 --- a/2014/birken/Makefile +++ b/2014/birken/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/deak/Makefile b/2014/deak/Makefile index 31592f5e8..a3e36426d 100644 --- a/2014/deak/Makefile +++ b/2014/deak/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/endoh1/Makefile b/2014/endoh1/Makefile index 2b9fed886..33f3a0c45 100644 --- a/2014/endoh1/Makefile +++ b/2014/endoh1/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/endoh2/Makefile b/2014/endoh2/Makefile index 678da9c4f..c10104156 100644 --- a/2014/endoh2/Makefile +++ b/2014/endoh2/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/maffiodo1/Makefile b/2014/maffiodo1/Makefile index 6b9b46fde..c469e76a4 100644 --- a/2014/maffiodo1/Makefile +++ b/2014/maffiodo1/Makefile @@ -47,13 +47,13 @@ SDL_INCDIR= $(shell sdl-config --cflags) CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -65,7 +65,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/maffiodo2/Makefile b/2014/maffiodo2/Makefile index d2650aeb0..9544337ab 100644 --- a/2014/maffiodo2/Makefile +++ b/2014/maffiodo2/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/morgan/Makefile b/2014/morgan/Makefile index 825cdfb21..35c5f5ce2 100644 --- a/2014/morgan/Makefile +++ b/2014/morgan/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include #CWARN= -Wall -pedantic CWARM= -Wall -Wextra -pedantic -Wshadow -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c99 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/sinon/Makefile b/2014/sinon/Makefile index 86a5e2f28..c5d64274a 100644 --- a/2014/sinon/Makefile +++ b/2014/sinon/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/skeggs/Makefile b/2014/skeggs/Makefile index bb61da51d..564aa9f7d 100644 --- a/2014/skeggs/Makefile +++ b/2014/skeggs/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include #CWARN= -Wall -pedantic CWARN= -Wall -Wno-format-extra-args -Wno-parentheses -Wno-return-type -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/vik/Makefile b/2014/vik/Makefile index d2819b759..2d8472ce5 100644 --- a/2014/vik/Makefile +++ b/2014/vik/Makefile @@ -40,13 +40,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall -Wno-bitwise-op-parentheses #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -58,7 +58,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2014/wiedijk/Makefile b/2014/wiedijk/Makefile index d111f8e6f..6b6ea81e2 100644 --- a/2014/wiedijk/Makefile +++ b/2014/wiedijk/Makefile @@ -39,13 +39,13 @@ X11_INCDIR= /usr/X11R6/include CWARN= -Wall #CWARN= -Wall -pedantic -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -57,7 +57,7 @@ CSTD= -std=c11 # ARCH= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/Makefile b/2015/Makefile index f060968b4..bb2b69b64 100644 --- a/2015/Makefile +++ b/2015/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash CP= cp CPP= cpp GUNZIP= gunzip diff --git a/2015/burton/Makefile b/2015/burton/Makefile index 6221c45cc..faab51e9d 100644 --- a/2015/burton/Makefile +++ b/2015/burton/Makefile @@ -63,13 +63,13 @@ CSILENCE= -Wno-return-type -Wno-parentheses -Wno-char-subscripts \ -Wno-shadow -Wno-shorten-64-to-32 -Wno-sign-conversion \ -Wno-unused-parameter -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -81,12 +81,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= CDEFINE= -DR=return -DI=typedef -DH=unsigned -DX=long -D"W(x)=for(;x;)" -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -94,7 +94,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/dogon/Makefile b/2015/dogon/Makefile index 0016ae77f..d4dd80cfe 100644 --- a/2015/dogon/Makefile +++ b/2015/dogon/Makefile @@ -65,13 +65,13 @@ CSILENCE= -Wno-implicit-int -Wno-variadic-macros -Wno-absolute-value \ -Wno-reserved-id-macro -Wno-shadow -Wno-shorten-64-to-32 \ -Wno-sign-conversion -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -83,17 +83,17 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= CDEFINE= -DW=1024 -Dp=800 -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= CINCLUDE= -I ${X11_INCDIR} -include stdlib.h -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/duble/Makefile b/2015/duble/Makefile index 624664d59..b84f45fb1 100644 --- a/2015/duble/Makefile +++ b/2015/duble/Makefile @@ -62,7 +62,7 @@ CSILENCE= -Wno-parentheses -Wno-unused-value -Wno-return-type \ clang_CSILENCE=-Wno-string-plus-int -Wno-int-conversion -# Compiler standard +# compiler standard # CSTD= -std=c11 \ -D_BSD_SOURCE \ @@ -70,7 +70,7 @@ CSTD= -std=c11 \ # _BSD_SOURCE needed for function usleep() # _XOPEN_SOURCE needed for function lrand48() -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,15 +82,15 @@ CSTD= -std=c11 \ # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/endoh1/Makefile b/2015/endoh1/Makefile index b64f3f783..b660d3424 100644 --- a/2015/endoh1/Makefile +++ b/2015/endoh1/Makefile @@ -60,14 +60,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-conversion -Wno-float-conversion -Wno-missing-prototypes \ -Wno-missing-variable-declarations -Wno-shadow -Wno-sign-conversion -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -79,15 +79,15 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/endoh2/Makefile b/2015/endoh2/Makefile index 7c6ef85e8..d484977cd 100644 --- a/2015/endoh2/Makefile +++ b/2015/endoh2/Makefile @@ -59,13 +59,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= CSILENCE= -Wno-char-subscripts -Wno-format-nonliteral -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -77,16 +77,16 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= CINCLUDE= -include stdio.h -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/endoh3/Makefile b/2015/endoh3/Makefile index 224ee2499..ea4b15a44 100644 --- a/2015/endoh3/Makefile +++ b/2015/endoh3/Makefile @@ -60,13 +60,13 @@ CSILENCE= -Wno-cast-align -Wno-missing-prototypes \ -Wno-missing-variable-declarations -Wno-shorten-64-to-32 \ -Wno-unreachable-code -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -78,15 +78,15 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/endoh4/Makefile b/2015/endoh4/Makefile index c24369ad1..8d75a1de0 100644 --- a/2015/endoh4/Makefile +++ b/2015/endoh4/Makefile @@ -60,13 +60,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-implicit-function-declaration -Wno-implicit-int -Wno-main \ -Wno-missing-prototypes -Wno-pedantic -Wno-return-type -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -78,15 +78,15 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/hou/Makefile b/2015/hou/Makefile index 56bc9d35c..b404d83e4 100644 --- a/2015/hou/Makefile +++ b/2015/hou/Makefile @@ -60,13 +60,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-cast-qual -Wno-missing-prototypes \ -Wno-missing-variable-declarations -Wno-shadow -Wno-ignored-qualifiers -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -78,15 +78,15 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/howe/Makefile b/2015/howe/Makefile index 00bcd394a..f73fb185f 100644 --- a/2015/howe/Makefile +++ b/2015/howe/Makefile @@ -27,7 +27,7 @@ # On OpenBSD # /bin/ksh = /bin/pdksh # -SHELL= bash +SHELL= /bin/sh CP= cp CPP= cpp @@ -75,13 +75,13 @@ CSILENCE= -Wno-sign-compare -Wno-missing-prototypes \ -Wno-padded -Wno-shadow \ -Wno-sign-conversion -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -93,15 +93,15 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/mills1/Makefile b/2015/mills1/Makefile index 9eb3a8011..50709b36e 100644 --- a/2015/mills1/Makefile +++ b/2015/mills1/Makefile @@ -60,13 +60,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-parentheses -Wno-implicit-function-declaration \ -Wno-missing-variable-declarations -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -78,7 +78,7 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= CDEFINE= -DU=${DU} -DD=${DD} -DW=${DW} -DH=${DH} -DA=${DA} -DI=${DI} \ @@ -118,11 +118,11 @@ DG='"Tap to Flap!"' # Instruction text. # Change to your native tongue. # NOTE: The string MUST be enclosed inside double quotes. -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/mills2/Makefile b/2015/mills2/Makefile index 2e48ded33..1c1375dc0 100644 --- a/2015/mills2/Makefile +++ b/2015/mills2/Makefile @@ -61,13 +61,13 @@ CSILENCE= -Wno-shift-op-parentheses -Wno-implicit-function-declaration \ -Wno-unused-parameter -Wno-missing-prototypes \ -Wno-missing-variable-declarations -Wno-shadow -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -79,16 +79,16 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= CINCLUDE= -include stdlib.h -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/muth/Makefile b/2015/muth/Makefile index dbb8c513a..e048f8dc0 100644 --- a/2015/muth/Makefile +++ b/2015/muth/Makefile @@ -60,14 +60,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= CSILENCE= -Wno-keyword-macro -Wno-unused-macros -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c1x -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -79,17 +79,17 @@ CSTD= -std=c1x # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= CDEFINE= -DX="$(X)" -DV="$(V)" -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= CINCLUDE= -include "${MACHINE}" -include "${TAPE}" -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/schweikhardt/Makefile b/2015/schweikhardt/Makefile index 3990781be..ef652efff 100644 --- a/2015/schweikhardt/Makefile +++ b/2015/schweikhardt/Makefile @@ -58,14 +58,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} # CSILENCE= -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 #CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -77,16 +77,16 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= CDEFINE= -Dtyp=uint64_t -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2015/yang/Makefile b/2015/yang/Makefile index 34240281f..4645c4b0a 100644 --- a/2015/yang/Makefile +++ b/2015/yang/Makefile @@ -62,14 +62,14 @@ CSILENCE= # -Wno-missing-variable-declarations -Wno-old-style-cast \ # -Wno-unreachable-code -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c90 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -81,15 +81,15 @@ CSTD= -std=c90 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/Makefile b/2018/Makefile index ebe0ae292..def9b018d 100644 --- a/2018/Makefile +++ b/2018/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash CP= cp CPP= cpp GUNZIP= gunzip diff --git a/2018/algmyr/Makefile b/2018/algmyr/Makefile index 4e94317e9..26a1682c2 100644 --- a/2018/algmyr/Makefile +++ b/2018/algmyr/Makefile @@ -63,13 +63,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-string-plus-int -Wno-empty-body -Wno-unused-result #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -81,12 +81,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -94,7 +94,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/anderson/Makefile b/2018/anderson/Makefile index 97a29a00c..8ddf8ce1b 100644 --- a/2018/anderson/Makefile +++ b/2018/anderson/Makefile @@ -63,13 +63,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -81,12 +81,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -94,7 +94,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/bellard/Makefile b/2018/bellard/Makefile index d09e9a884..866e28aa4 100644 --- a/2018/bellard/Makefile +++ b/2018/bellard/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall -Wextra ${CSILENCE} #CSILENCE= CSILENCE= -Wno-implicit-int -Wno-parentheses -Wno-return-type -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/burton1/Makefile b/2018/burton1/Makefile index e6a13c419..8b6a2313e 100644 --- a/2018/burton1/Makefile +++ b/2018/burton1/Makefile @@ -63,13 +63,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -81,12 +81,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= #CINCLUDE= -include stdlib.h @@ -94,7 +94,7 @@ CINCLUDE= -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/burton2/Makefile b/2018/burton2/Makefile index 13d49144f..0277e7188 100644 --- a/2018/burton2/Makefile +++ b/2018/burton2/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall -Wextra ${CSILENCE} CSILENCE= -Wno-empty-body -Wno-parentheses -Wno-pointer-sign -Wno-char-subscripts -Wno-trigraphs -Wno-sign-compare #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -trigraphs -DW=\"keywords\" -DU=$(USAGE) #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/ciura/Makefile b/2018/ciura/Makefile index bbd2b3290..289dea417 100644 --- a/2018/ciura/Makefile +++ b/2018/ciura/Makefile @@ -65,13 +65,13 @@ CSILENCE= -Wno-unused-value -Wno-shift-op-parentheses -Wno-sign-conversion \ -Wno-comma -Wno-missing-prototypes -Wno-unused-result -Wno-parentheses #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -83,12 +83,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -96,7 +96,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/endoh1/Makefile b/2018/endoh1/Makefile index 3a87a29d0..e244d6382 100644 --- a/2018/endoh1/Makefile +++ b/2018/endoh1/Makefile @@ -63,13 +63,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -81,12 +81,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -94,7 +94,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/endoh2/Makefile b/2018/endoh2/Makefile index 4f8b403fd..c39e05889 100644 --- a/2018/endoh2/Makefile +++ b/2018/endoh2/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/ferguson/Makefile b/2018/ferguson/Makefile index 1f4717ab1..cebe39a28 100644 --- a/2018/ferguson/Makefile +++ b/2018/ferguson/Makefile @@ -64,14 +64,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 #CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -83,12 +83,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -96,7 +96,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/giles/Makefile b/2018/giles/Makefile index 9d6ae8497..b2867e4f5 100644 --- a/2018/giles/Makefile +++ b/2018/giles/Makefile @@ -64,14 +64,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -83,12 +83,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= $(shell sdl2-config --cflags) #CINCLUDE= -include stdlib.h @@ -96,7 +96,7 @@ CINCLUDE= $(shell sdl2-config --cflags) #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/hou/Makefile b/2018/hou/Makefile index f935a381d..ab03c0d85 100644 --- a/2018/hou/Makefile +++ b/2018/hou/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= -D_DEFAULT_SOURCE #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/mills/Makefile b/2018/mills/Makefile index a51fdd3a1..0e95c6268 100644 --- a/2018/mills/Makefile +++ b/2018/mills/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall ${CSILENCE} CSILENCE= -Wno-unused-result #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/poikola/Makefile b/2018/poikola/Makefile index 28c1a5856..c3d442668 100644 --- a/2018/poikola/Makefile +++ b/2018/poikola/Makefile @@ -63,14 +63,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-dollar-in-identifier-extension -Wno-comment -Wno-unused-parameter #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=gnu11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,13 +82,13 @@ CSTD= -std=gnu11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= CDEFINE= -Dunix=1 #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -96,7 +96,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/vokes/Makefile b/2018/vokes/Makefile index 08704b218..bf9e5a4a5 100644 --- a/2018/vokes/Makefile +++ b/2018/vokes/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-missing-prototypes #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2018/yang/Makefile b/2018/yang/Makefile index 11822dee6..284d4722d 100644 --- a/2018/yang/Makefile +++ b/2018/yang/Makefile @@ -64,13 +64,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -82,12 +82,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=25 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -95,7 +95,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/Makefile b/2019/Makefile index 667c7c3bc..9d1b53f37 100644 --- a/2019/Makefile +++ b/2019/Makefile @@ -13,7 +13,7 @@ # shell used by this Makefile ############################# # -SHELL= bash +SHELL= /bin/bash # Set X11_LIBDIR to the directory where the X11 library resides # diff --git a/2019/adamovsky/Makefile b/2019/adamovsky/Makefile index 38a01b5d5..0e4a5be1b 100644 --- a/2019/adamovsky/Makefile +++ b/2019/adamovsky/Makefile @@ -305,13 +305,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int CSILENCE=-Wno-format -Wno-implicit-function-declaration -Wno-newline-eof -Wno-shift-op-parentheses -Wno-unsequenced -Wno-trigraphs -Wno-comment -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -323,12 +323,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -336,7 +336,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/burton/Makefile b/2019/burton/Makefile index 4f74a2501..2b2abc0da 100644 --- a/2019/burton/Makefile +++ b/2019/burton/Makefile @@ -305,13 +305,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int CSILENCE= -Wno-implicit-int -Wno-missing-variable-declarations -Wno-parentheses -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -323,12 +323,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= #CINCLUDE= -include stdlib.h @@ -336,7 +336,7 @@ CINCLUDE= -include stdio.h #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/ciura/Makefile b/2019/ciura/Makefile index 72778ce2b..db91bf1ce 100644 --- a/2019/ciura/Makefile +++ b/2019/ciura/Makefile @@ -306,13 +306,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int CSILENCE= -Wno-empty-body -Wno-format-nonliteral -Wno-incompatible-pointer-types-discards-qualifiers -Wno-parentheses -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-string-plus-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -324,12 +324,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -337,7 +337,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/diels-grabsch1/Makefile b/2019/diels-grabsch1/Makefile index 4c3c80d8c..d7773597e 100644 --- a/2019/diels-grabsch1/Makefile +++ b/2019/diels-grabsch1/Makefile @@ -305,13 +305,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int #CSILENCE= -Wextra -Weverything -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -323,12 +323,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -336,7 +336,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/diels-grabsch2/Makefile b/2019/diels-grabsch2/Makefile index 662e72eee..708091954 100644 --- a/2019/diels-grabsch2/Makefile +++ b/2019/diels-grabsch2/Makefile @@ -304,13 +304,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -322,12 +322,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -335,7 +335,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/dogon/Makefile b/2019/dogon/Makefile index f3fd3a463..f69a3b3ec 100644 --- a/2019/dogon/Makefile +++ b/2019/dogon/Makefile @@ -306,14 +306,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-bitwise-op-parentheses -Wno-format -Wno-parentheses \ -Wno-shift-op-parentheses -Wno-sign-compare -Wno-unused-variable -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -326,13 +326,13 @@ CSTD= -std=c99 #ARCH= ARCH= -march=native -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= #CDEFINE= -DIOCCC=26 CDEFINE= -DX=1280l -DY=1024l -DZ=0x20000000 -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= #CINCLUDE= -include stdlib.h @@ -340,7 +340,7 @@ CDEFINE= -DX=1280l -DY=1024l -DZ=0x20000000 #CINCLUDE= -include stdlib.h -include stdio.h CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/duble/Makefile b/2019/duble/Makefile index 2aced0a3b..e916ff456 100644 --- a/2019/duble/Makefile +++ b/2019/duble/Makefile @@ -309,13 +309,13 @@ CSILENCE=-Wno-incompatible-pointer-types -Wno-return-type -Wno-format-security \ -Wno-dangling-else -Wno-implicit-int -Wno-unused-value -Wno-pedantic \ -Wno-misleading-indentation -Wno-sequence-point -Wno-unknown-warning-option -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -327,12 +327,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -340,7 +340,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/endoh/Makefile b/2019/endoh/Makefile index f16324882..96d7ced9a 100644 --- a/2019/endoh/Makefile +++ b/2019/endoh/Makefile @@ -304,13 +304,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -322,12 +322,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -335,7 +335,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/giles/Makefile b/2019/giles/Makefile index 8b538b92d..1c94112b1 100644 --- a/2019/giles/Makefile +++ b/2019/giles/Makefile @@ -305,14 +305,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int CSILENCE= -Wno-empty-body -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -324,12 +324,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -337,7 +337,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/karns/Makefile b/2019/karns/Makefile index f02692527..e1a127351 100644 --- a/2019/karns/Makefile +++ b/2019/karns/Makefile @@ -305,13 +305,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int CSILENCE=-Wno-implicit-function-declaration -Wno-implicit-int -Wno-incompatible-function-pointer-types -Wno-logical-op-parentheses -Wno-sign-compare -Wno-unused-label -Wno-unused-variable -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -323,12 +323,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -336,7 +336,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/lynn/Makefile b/2019/lynn/Makefile index a0e37d9d2..ed6a68a10 100644 --- a/2019/lynn/Makefile +++ b/2019/lynn/Makefile @@ -304,14 +304,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -323,12 +323,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -336,7 +336,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/mills/Makefile b/2019/mills/Makefile index 9c64b91bb..d7a7cba6c 100644 --- a/2019/mills/Makefile +++ b/2019/mills/Makefile @@ -305,13 +305,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} #CSILENCE= -Wno-implicit-int CSILENCE= -Wno-missing-field-initializers -Wno-for-loop-analysis -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -323,13 +323,13 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= #CDEFINE= -DIOCCC=26 CDEFINE= ${param} -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -337,7 +337,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/poikola/Makefile b/2019/poikola/Makefile index 62481adad..8564a35b3 100644 --- a/2019/poikola/Makefile +++ b/2019/poikola/Makefile @@ -306,13 +306,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= -Wno-gnu-label-as-value -Wno-sign-compare -Wno-unsequenced \ -Wno-dollar-in-identifier-extension -Wno-sometimes-uninitialized -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -324,12 +324,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -337,7 +337,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2019/yang/Makefile b/2019/yang/Makefile index 662e72eee..708091954 100644 --- a/2019/yang/Makefile +++ b/2019/yang/Makefile @@ -304,13 +304,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} CSILENCE= #CSILENCE= -Wno-implicit-int -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -322,12 +322,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC=26 -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -335,7 +335,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/Makefile b/2020/Makefile index afabb9df9..b2efaf9d0 100644 --- a/2020/Makefile +++ b/2020/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +SHELL= /bin/bash # BUNZIP2= bunzip2 BZIP2= bzip2 diff --git a/2020/burton/Makefile b/2020/burton/Makefile index 0d853343d..346e2a909 100644 --- a/2020/burton/Makefile +++ b/2020/burton/Makefile @@ -337,13 +337,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -355,12 +355,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # #CINCLUDE= #CINCLUDE= -include stdlib.h @@ -368,7 +368,7 @@ CDEFINE= CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/carlini/Makefile b/2020/carlini/Makefile index 6e8eec19e..df3c8c9d9 100644 --- a/2020/carlini/Makefile +++ b/2020/carlini/Makefile @@ -341,13 +341,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -359,12 +359,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -372,7 +372,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/endoh1/Makefile b/2020/endoh1/Makefile index e9fe3d0bc..a61f7caad 100644 --- a/2020/endoh1/Makefile +++ b/2020/endoh1/Makefile @@ -341,13 +341,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -359,12 +359,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -372,7 +372,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/endoh2/Makefile b/2020/endoh2/Makefile index 6e345fb90..cd3a4045a 100644 --- a/2020/endoh2/Makefile +++ b/2020/endoh2/Makefile @@ -342,14 +342,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +361,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -374,7 +374,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/endoh3/Makefile b/2020/endoh3/Makefile index b025b38b3..6c4eb8ac0 100644 --- a/2020/endoh3/Makefile +++ b/2020/endoh3/Makefile @@ -339,13 +339,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -357,12 +357,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -370,7 +370,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/ferguson1/Makefile b/2020/ferguson1/Makefile index 593605047..f236752b1 100644 --- a/2020/ferguson1/Makefile +++ b/2020/ferguson1/Makefile @@ -341,13 +341,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -359,7 +359,7 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= #CDEFINE= -DIOCCC @@ -367,7 +367,7 @@ CDEFINE= -D_XOPEN_SOURCE -D_POSIX_C_SOURCE -D'f(a,b)'='((a)<(b)?(a):(b))' -DWALL -DHEAD='COLOR_RED' -DBODY='COLOR_GREEN' -DWB='COLOR_BLACK' -DHB='COLOR_BLACK' -DBS='COLOR_BLACK' \ -DBG='COLOR_WHITE' -DBB='COLOR_BLACK' -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -375,7 +375,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/ferguson2/Makefile b/2020/ferguson2/Makefile index ffa610b23..ae91cfdd9 100644 --- a/2020/ferguson2/Makefile +++ b/2020/ferguson2/Makefile @@ -344,13 +344,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -362,13 +362,13 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= #CDEFINE= -DIOCCC CDEFINE= -D_POSIX_C_SOURCE=200809L -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +376,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/giles/Makefile b/2020/giles/Makefile index 3ce044a14..be8a9a1b8 100644 --- a/2020/giles/Makefile +++ b/2020/giles/Makefile @@ -342,14 +342,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -361,12 +361,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -374,7 +374,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/kurdyukov1/Makefile b/2020/kurdyukov1/Makefile index 5ff7de692..0117fbd17 100644 --- a/2020/kurdyukov1/Makefile +++ b/2020/kurdyukov1/Makefile @@ -338,13 +338,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -356,12 +356,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -369,7 +369,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/kurdyukov2/Makefile b/2020/kurdyukov2/Makefile index c6b1b5db8..1dadb3989 100644 --- a/2020/kurdyukov2/Makefile +++ b/2020/kurdyukov2/Makefile @@ -340,13 +340,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -358,12 +358,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -371,7 +371,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/kurdyukov3/Makefile b/2020/kurdyukov3/Makefile index 479541fac..659bc9e68 100644 --- a/2020/kurdyukov3/Makefile +++ b/2020/kurdyukov3/Makefile @@ -338,13 +338,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -356,12 +356,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -369,7 +369,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/kurdyukov4/Makefile b/2020/kurdyukov4/Makefile index d4a69753e..52d31d8f4 100644 --- a/2020/kurdyukov4/Makefile +++ b/2020/kurdyukov4/Makefile @@ -339,13 +339,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -357,12 +357,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -370,7 +370,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/otterness/Makefile b/2020/otterness/Makefile index 4d9ac77ad..a3f33a233 100644 --- a/2020/otterness/Makefile +++ b/2020/otterness/Makefile @@ -340,14 +340,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -359,12 +359,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -372,7 +372,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/tsoj/Makefile b/2020/tsoj/Makefile index da727a751..ff1da962b 100644 --- a/2020/tsoj/Makefile +++ b/2020/tsoj/Makefile @@ -344,14 +344,14 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi #CSTD= -std=c11 CSTD= -std=c99 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -363,12 +363,12 @@ CSTD= -std=c99 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -376,7 +376,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break diff --git a/2020/yang/Makefile b/2020/yang/Makefile index 131226a14..6e1c7392e 100644 --- a/2020/yang/Makefile +++ b/2020/yang/Makefile @@ -340,13 +340,13 @@ CWARN= -Wall -Wextra -pedantic ${CSILENCE} endif endif -# Compiler standard +# compiler standard # #CSTD= #CSTD= -ansi CSTD= -std=c11 -# Compiler bit architecture +# compiler bit architecture # # Some entries require 32-bitness: # ARCH= -m32 @@ -358,12 +358,12 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # CDEFINE= #CDEFINE= -DIOCCC -# Include files that are needed to compile +# include files that are needed to compile # CINCLUDE= #CINCLUDE= -include stdlib.h @@ -371,7 +371,7 @@ CINCLUDE= #CINCLUDE= -include stdlib.h -include stdio.h #CINCLUDE= -I ${X11_INCDIR} -# Optimization +# optimization # # Most compiles will safely use -O2. Some can use only -O1 or -O. # A few compilers have broken optimizers or this entry make break