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 91ee8286d..d06ef33b5 100644 --- a/1996/august/Makefile +++ b/1996/august/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= august -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 5e02a48ec..d06ef33b5 100644 --- a/1996/dalbec/Makefile +++ b/1996/dalbec/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= dalbec -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 aa73dae49..d06ef33b5 100644 --- a/1996/eldby/Makefile +++ b/1996/eldby/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= eldby -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 67b79945e..d06ef33b5 100644 --- a/1996/gandalf/Makefile +++ b/1996/gandalf/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= gandalf -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 a7ecc28c5..d06ef33b5 100644 --- a/1996/huffman/Makefile +++ b/1996/huffman/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= huffman -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 87cff8dc4..d06ef33b5 100644 --- a/1996/jonth/Makefile +++ b/1996/jonth/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= jonth -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 d32076589..d06ef33b5 100644 --- a/1996/rcm/Makefile +++ b/1996/rcm/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= rcm -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 b17c6539a..d06ef33b5 100644 --- a/1996/schweikh1/Makefile +++ b/1996/schweikh1/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= schweikh1 -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 2e0a8d0dc..d06ef33b5 100644 --- a/1996/schweikh2/Makefile +++ b/1996/schweikh2/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= schweikh2 -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 1e0e5c6f8..d06ef33b5 100644 --- a/1996/schweikh3/Makefile +++ b/1996/schweikh3/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= schweikh3 -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 4b5991e00..d06ef33b5 100644 --- a/1996/westley/Makefile +++ b/1996/westley/Makefile @@ -1,593 +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 +# 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 +# incorrectly. You might want 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 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang +# Set CC to the name of your ANSI compiler. +CC=cc #CC=gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +WINNERS= august dalbec eldby gandalf huffman jonth rcm schweikh1 \ + schweikh2 schweikh3 westley +ALT_NAMES= august.orig -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +LEVEL=5 +all: $(WINNERS) -############################## -# Special flags for this entry -############################## +# 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: # -ENTRY= westley -PROG= ${ENTRY} +# 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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +august.oc: august.c + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.c > august.oc + ${CHMOD} +r august.oc + +# NOTE: this is the original source that won # -ALT_OBJ= -ALT_TARGET= +august.orig: august.orig.c fac.oc parse.oc test.oc + ${CC} ${CFLAGS} -DZ=60000 -DZ=60000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c -o august.orig + ${RM} -f august.oc + ${CC} ${CFLAGS} -E -DZ=40000 -D'T=m[s]' -D'P=m[s++]' \ + -D'L=m[p++]' -D'g=getchar()' -DE=else -DW=while -D'B=m[p++]' \ + -DI=if -DR='s=s+l/2;T=r;I(l%2)s++' -D'X=m[s-' \ + -D'D=Q(13,-)Q(14,*)Q(15,/)Q(16,%)Q(6,==)Q(7,!=)Q(8,<)C(1,r=P;m[T]=r;T=r)C(9,r=P;m[T]=r;s++)' \ + august.orig.c > august.oc + ${CHMOD} +r fac.oc parse.oc test.oc august.oc +dalbec: dalbec.c + ${CC} ${CFLAGS} dalbec.c -o dalbec -################# -# build the entry -################# +eldby: eldby.c + ${CC} ${CFLAGS} eldby.c -o eldby + +gandalf: gandalf.c + ${CC} ${CFLAGS} gandalf.c -o gandalf + ${RM} -f hatcat cathat + ${CP} gandalf hatcat + ${CP} gandalf cathat + +huffman: huffman.c + ${CC} ${CFLAGS} huffman.c -o huffman + +# Add -I${X}/include and -L${X}/lib if this doesn't build +# (X is the root of the X Window distribution) +# Solaris users add -lsocket # -all: data ${TARGET} - @${TRUE} +jonth: jonth.c + ${CC} ${CFLAGS} jonth.c -o jonth -lX11 -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +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 -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schweikh1: schweikh1.c errno.h + ${CC} ${CFLAGS} -I. schweikh1.c -o schweikh1 -# alternative executable +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: # -alt: data ${ALT_TARGET} - @${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 -# data files -# -data: ${DATA} - @${TRUE} +westley: westley.c clock1 clock2 clock3 + ${CC} ${CFLAGS} westley.c -o westley + ${CHMOD} +x clock1 clock2 clock3 -# 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) + ${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 339f240d6..c939c82aa 100644 --- a/1998/banks/Makefile +++ b/1998/banks/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= banks -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 932a58d08..c939c82aa 100644 --- a/1998/bas1/Makefile +++ b/1998/bas1/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= bas1 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 af70d3892..c939c82aa 100644 --- a/1998/bas2/Makefile +++ b/1998/bas2/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= bas2 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 f47878688..c939c82aa 100644 --- a/1998/chaos/Makefile +++ b/1998/chaos/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= chaos -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 1978a8e5f..c939c82aa 100644 --- a/1998/df/Makefile +++ b/1998/df/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= df -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 cab9ea1ec..c939c82aa 100644 --- a/1998/dlowe/Makefile +++ b/1998/dlowe/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= dlowe -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 a58f2e716..c939c82aa 100644 --- a/1998/dloweneil/Makefile +++ b/1998/dloweneil/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= dloweneil -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 72d5bd3cd..c939c82aa 100644 --- a/1998/dorssel/Makefile +++ b/1998/dorssel/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= dorssel -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 57be73162..c939c82aa 100644 --- a/1998/fanf/Makefile +++ b/1998/fanf/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= fanf -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 ebe345492..c939c82aa 100644 --- a/1998/schnitzi/Makefile +++ b/1998/schnitzi/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= schnitzi -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 2859731e6..c939c82aa 100644 --- a/1998/schweikh1/Makefile +++ b/1998/schweikh1/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= schweikh1 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 8c5455d7e..c939c82aa 100644 --- a/1998/schweikh2/Makefile +++ b/1998/schweikh2/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= schweikh2 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 065911ea8..c939c82aa 100644 --- a/1998/schweikh3/Makefile +++ b/1998/schweikh3/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= schweikh3 -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 76404187b..c939c82aa 100644 --- a/1998/tomtorfs/Makefile +++ b/1998/tomtorfs/Makefile @@ -1,593 +1,174 @@ -#!/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/ +# 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. +# +# 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. +# +#CFLAGS=-O -Xa +#CFLAGS=-Xa +CFLAGS= -ansi +#CFLAGS= -ansi -O +#CFLAGS= +#CFLAGS= -ansi -L/usr/X11R6/lib - -############################# -# shell used by this Makefile -############################# +# ANSI compiler # -SHELL= bash - -####################### -# common tool locations -####################### +# Set CC to the name of your ANSI compiler. # -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 +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. # -#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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +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 -############################## -# Special flags for this entry -############################## +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 # -ENTRY= tomtorfs -PROG= ${ENTRY} +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 # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +banks.orig: banks.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DIT=XK_Page_Up -DDT=XK_Page_Down \ + -DUP=XK_Up -DDN=XK_Down -DLT=XK_Left -DRT=XK_Right \ + -DCS=XK_Return -Ddt=0.02 -lm -lX11 -o $@ + +banks_files: bb.sc horizon.sc mountains.sc pittsburgh.sc pyramids.sc river.sc + +dlowe: dlowe.c + ${CC} ${CFLAGS} $? -o $@ + +dlowe.orig: dlowe.orig.c + ${CC} ${CFLAGS} $? -o $@ + +bas2: bas2.c + ${CC} ${CFLAGS} $? -o $@ + +fanf: fanf.c + ${RM} -f fanftmp1.c fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} -E $? > fanftmp1.c + ${MAY_NEED_GCC} ${CFLAGS} -E fanftmp1.c > fanftmp2.c + ${MAY_NEED_GCC} ${CFLAGS} fanftmp2.c ${LDFLAGS} -o $@ + +fanf_files: fanf.lambda + +bas1: bas1.c + ${CC} ${CFLAGS} $? -o $@ + +tomtorfs: tomtorfs.c + ${CC} ${CFLAGS} $? -o $@ + +dorssel: dorssel.c + ${CC} ${CFLAGS} $? -o $@ + +schweikh2: schweikh2.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh2.orig: schweikh2.orig.c + ${MAY_NEED_GCC} ${CFLAGS} $? -o $@ + +schweikh3: schweikh3.c + ${MAY_NEED_GCC} ${CFLAGS} $? -DM0=sizeof -DM1=long -DM2=void \ + -DM3=realloc -DM4=calloc -DM5=free -o $@ + +schweikh3_files: samefile.1 + +schnitzi: schnitzi.c + ${CC} ${CFLAGS} $? -o $@ + +chaos: chaos.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + +# some libcurses do not have halfdelay(). This rule is for those systems # -ALT_OBJ= -ALT_TARGET= +chaos_nohalf: chaos_nohalf.c + ${CC} ${CFLAGS} $? -lcurses -o $@ + ${CP} -f $@ chaos +chaos_nohalf.c: chaos.c + ${RM} -f $@ + ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -################# -# build the entry -################# -# -all: data ${TARGET} - @${TRUE} +chaos_files: cube.data desk.data ioccc.data pyramid.data xwing.data -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -${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; \ - 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 ecdec4e46..25524921d 100644 --- a/2000/anderson/Makefile +++ b/2000/anderson/Makefile @@ -1,595 +1,215 @@ -anderson: anderson.c - ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - anderson +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= anderson -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/2000/bellard/Makefile b/2000/bellard/Makefile index 7196e5245..25524921d 100644 --- a/2000/bellard/Makefile +++ b/2000/bellard/Makefile @@ -1,595 +1,215 @@ -bellard: bellard.c - ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - bellard +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= bellard -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/2000/bmeyer/Makefile b/2000/bmeyer/Makefile index dfb9adc83..25524921d 100644 --- a/2000/bmeyer/Makefile +++ b/2000/bmeyer/Makefile @@ -1,3 +1,116 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP +# +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Specific Output +# +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Utility +# +# machines operating in 64 bit mode: +# bmeyer: bmeyer.c ${CC} -DY= -O6 $? -o $@ -lm # @@ -13,596 +126,90 @@ bmeyer: bmeyer.c # -O6 $? -o $@ -lm bmeyer_files: lavabus.pgm lenna.glic michael.pgm -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - bmeyer -################################################################################ +# Best Abuse of User # -# 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 -# -################################################################################ +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm -# 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/ +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ -####################### -# common tool locations -####################### +# Best of Show # -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 +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 -# 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 +jarijyrki_files: sheet1.info -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# Worst Abuse of the Rules # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` -# Common C compiler warnings to silence +# Best Small Program # -CSILENCE= -#CSILENCE= -Wno-implicit-int +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm -# Common C compiler warning flags +# Astronomically Obfuscated # -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 -# Compiler standard +# Best game # -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ -# Compiler bit architecture +# Most Portable Output # -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -# Include files that are needed to compile +# Most Complete Program # -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 +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# 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 +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= bmeyer -PROG= prog -# -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; \ - 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/2000/briddlebane/Makefile b/2000/briddlebane/Makefile index e250c222e..25524921d 100644 --- a/2000/briddlebane/Makefile +++ b/2000/briddlebane/Makefile @@ -1,598 +1,215 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP +# +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Specific Output +# +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Utility +# +# machines operating in 64 bit mode: +# +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.0, libc4/5: +# +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# briddlebane: briddlebane.c ${CC} ${CFLAGS} $? -o $@ -lm briddlebane.orig: briddlebane.orig.c ${CC} ${CFLAGS} $? -o $@ -lm -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - briddlebane -################################################################################ +# Best Layout # -# 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 -# -################################################################################ +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: -# -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 -############################# -# shell used by this Makefile -############################# -# -SHELL= bash +jarijyrki_files: sheet1.info -####################### -# common tool locations -####################### +# Worst Abuse of the Rules # -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 +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` -# Set X11_LIBDIR to the directory where the X11 library resides +# Best Small Program # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# Astronomically Obfuscated # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 -# Common C compiler warnings to silence +# Best game # -CSILENCE= -#CSILENCE= -Wno-implicit-int +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ -# Common C compiler warning flags +# Most Portable Output # -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -# Compiler bit architecture +# Most Complete Program # -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= briddlebane -PROG= prog -# -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; \ - 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/2000/dhyang/Makefile b/2000/dhyang/Makefile index 29b60703e..25524921d 100644 --- a/2000/dhyang/Makefile +++ b/2000/dhyang/Makefile @@ -1,598 +1,215 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP +# +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Specific Output +# +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Utility +# +# machines operating in 64 bit mode: +# +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.0, libc4/5: +# +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# dhyang: dhyang.c ${CC} ${CFLAGS} $? -o $@ dmy2jd: dmy2jd.c ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - dhyang -################################################################################ +# Best of Show # -# 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 -# -################################################################################ +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 -# 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/ +jarijyrki_files: sheet1.info +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` -############################# -# shell used by this Makefile -############################# +# Best Small Program # -SHELL= bash +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm -####################### -# common tool locations -####################### +# Astronomically Obfuscated # -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 +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 -# Set X11_LIBDIR to the directory where the X11 library resides +# Best game # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# Most Portable Output # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -# Common C compiler warning flags +# Most Complete Program # -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dhyang -PROG= prog -# -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; \ - 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/2000/dlowe/Makefile b/2000/dlowe/Makefile index d88350952..25524921d 100644 --- a/2000/dlowe/Makefile +++ b/2000/dlowe/Makefile @@ -1,3 +1,165 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP +# +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Specific Output +# +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Utility +# +# machines operating in 64 bit mode: +# +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.0, libc4/5: +# +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# # The following bit of perl may help determining the values you need: # # perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' @@ -7,596 +169,47 @@ dlowe: dlowe.c ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ `${PERL} -MExtUtils::Embed -e ldopts` -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - dlowe -################################################################################ +# Best Small Program # -# 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 -# -################################################################################ +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# Astronomically Obfuscated # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ -############################# -# shell used by this Makefile -############################# +# Most Portable Output # -SHELL= bash +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm -####################### -# common tool locations -####################### -# -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 +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -# Set X11_LIBDIR to the directory where the X11 library resides +# Most Complete Program # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# 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 +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dlowe -PROG= prog -# -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; \ - 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/2000/jarijyrki/Makefile b/2000/jarijyrki/Makefile index 790e2096d..25524921d 100644 --- a/2000/jarijyrki/Makefile +++ b/2000/jarijyrki/Makefile @@ -1,3 +1,150 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP +# +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Specific Output +# +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Utility +# +# machines operating in 64 bit mode: +# +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.0, libc4/5: +# +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# jarijyrki: jarijyrki.c ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ @@ -6,596 +153,63 @@ jarijyrki: jarijyrki.c $? -o $@ ${X11LDFLAGS} -lX11 jarijyrki_files: sheet1.info -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - jarijyrki -################################################################################ +# Worst Abuse of the Rules # -# An Historical Makefile NOTE: +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. # -# The orig.Makefile, if it exits, is the original Makefile before this IOCCC -# year directory was reworked so that entries are in separate directories. -# This also applies to any orig.ansi.mk and orig.common.mk files. +# The following bit of perl may help determining the values you need: # -# 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. +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' # -# 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 -# -################################################################################ +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# Best Small Program # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 -############################# -# shell used by this Makefile -############################# +# Best game # -SHELL= bash +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ -####################### -# common tool locations -####################### +# Most Portable Output # -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 +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm -# 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 +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# Most Complete Program # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= jarijyrki -PROG= prog -# -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; \ - 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/2000/natori/Makefile b/2000/natori/Makefile index e8987f0fb..25524921d 100644 --- a/2000/natori/Makefile +++ b/2000/natori/Makefile @@ -1,595 +1,215 @@ -natori: natori.c - ${CC} ${CFLAGS} $? -o $@ -lm -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - natori +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= natori -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/2000/primenum/Makefile b/2000/primenum/Makefile index fee97bb66..25524921d 100644 --- a/2000/primenum/Makefile +++ b/2000/primenum/Makefile @@ -1,595 +1,215 @@ -primenum: primenum.c - ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - primenum +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= primenum -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/2000/rince/Makefile b/2000/rince/Makefile index b5050d53f..25524921d 100644 --- a/2000/rince/Makefile +++ b/2000/rince/Makefile @@ -1,596 +1,215 @@ -rince: rince.c - ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ - $? -o $@ -lm ${X11LDFLAGS} -lX11 -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - rince +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= rince -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/2000/robison/Makefile b/2000/robison/Makefile index 0851ac0b5..25524921d 100644 --- a/2000/robison/Makefile +++ b/2000/robison/Makefile @@ -1,595 +1,215 @@ -robison: robison.c - ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - robison +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= robison -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/2000/schneiderwent/Makefile b/2000/schneiderwent/Makefile index b5dc23625..25524921d 100644 --- a/2000/schneiderwent/Makefile +++ b/2000/schneiderwent/Makefile @@ -1,3 +1,94 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# schneiderwent: schneiderwent.c ${CC} ${CFLAGS} $? -o $@ @@ -5,596 +96,120 @@ schneiderwent_files: schneiderwent.data schneiderwent.orig: schneiderwent.orig.c ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - schneiderwent -################################################################################ +# Best Abuse of CPP # -# 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 -# -################################################################################ +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: +# Most Specific Output # -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ +# Best Utility +# +# machines operating in 64 bit mode: +# +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.0, libc4/5: +# +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm -############################# -# shell used by this Makefile -############################# -# -SHELL= bash +bmeyer_files: lavabus.pgm lenna.glic michael.pgm -####################### -# common tool locations -####################### +# Best Abuse of User # -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 +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm -# 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 +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# Best Layout # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ -# Common C compiler warning flags +# Best of Show # -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu90 +jarijyrki_files: sheet1.info -# Compiler bit architecture +# Worst Abuse of the Rules # -# Some entries require 32-bitness: -# ARCH= -m32 +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. # -# Some entries require 64-bitness: -# ARCH= -m64 +# The following bit of perl may help determining the values you need: # -# By default we assume nothing: +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' # -ARCH= +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` -# Defines that are needed to compile +# Best Small Program # -CDEFINE= -#CDEFINE= -DIOCCC +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm -# Include files that are needed to compile +# Astronomically Obfuscated # -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 +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 -# Optimization +# Best game # -# 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 +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ -# Default flags for ANSI C compilation +# Most Portable Output # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -# C compiler to use +# Most Complete Program # -CC= cc -#CC=clang -#CC=gcc +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= schneiderwent -PROG= prog -# -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; \ - 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/2000/thadgavin/Makefile b/2000/thadgavin/Makefile index e638f9cd3..25524921d 100644 --- a/2000/thadgavin/Makefile +++ b/2000/thadgavin/Makefile @@ -1,598 +1,215 @@ +#!/bin/make +# 2000 makefile +# +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. + +SHELL= /bin/sh +CAT= cat +RM= rm +SED= sed +TRUE= true +#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 + +# optimization +# +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. +# +#OPT= +#OPT= -O +OPT= -O2 + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + +# winners that compile under ANSI C +# +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files + + +all: ${WINNERS} + +# Best use of flags +# +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output +# +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP +# +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Specific Output +# +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Utility +# +# machines operating in 64 bit mode: +# +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.0, libc4/5: +# +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# thadgavin: thadgavin.c ${CC} ${CFLAGS} $? -o $@ -lcurses -lm thadgavin.orig: thadgavin.orig.c ${CC} ${CFLAGS} $? -o $@ -lncurses -lm -#!/usr/bin/env make -# -# IOCCC 2000 winning entry - thadgavin -################################################################################ +# Most Complete Program # -# 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 -# -################################################################################ +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: -# -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= thadgavin -PROG= prog -# -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; \ - 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/2000/tomx/Makefile b/2000/tomx/Makefile index 152b6ae5a..25524921d 100644 --- a/2000/tomx/Makefile +++ b/2000/tomx/Makefile @@ -1,595 +1,215 @@ -tomx: tomx.c - ${CC} ${CFLAGS} $? -o $@ -#!/usr/bin/env make +#!/bin/make +# 2000 makefile # -# IOCCC 2000 winning entry - tomx +# Copyright (C) Simon Cooper, Landon Curt Noll, Peter Seebach +# and Leonid A. Broukhis, 2000. +# All Rights Reserved. Permission for personal, educational or non-profit +# use is granted provided this this copyright and notice are included in its +# entirety and remains unaltered. All other uses must receive prior permission +# from the contest judges. -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +NO_ANSI_CFLAGS= +#NO_ANSI_CFLAGS= + +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib +#X11LDFLAGS= + +# Perl +# +PERL= perl +#PERL= perl5 + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. # CC= cc -#CC=clang -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anderson schneiderwent primenum bellard bmeyer briddlebane dhyang \ + dmy2jd jarijyrki dlowe natori rince robison thadgavin tomx +ALT_NAMES= schneiderwent.orig briddlebane.orig thadgavin.orig +DATA_FILES= schneiderwent_files bmeyer_files jarijyrki_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Best use of flags # -ENTRY= tomx -PROG= prog +anderson: anderson.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Timely Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schneiderwent: schneiderwent.c + ${CC} ${CFLAGS} $? -o $@ + +schneiderwent_files: schneiderwent.data + +schneiderwent.orig: schneiderwent.orig.c + ${CC} ${CFLAGS} $? -o $@ + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +primenum: primenum.c + ${CC} ${CFLAGS} $? -o $@ - -################# -# build the entry -################# +# Most Specific Output # -all: data ${TARGET} - @${TRUE} +bellard: bellard.c + ${CC} ${CFLAGS} $? -o $@ -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto - -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - -# alternative executable +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} - -# data files +# machines operating in 64 bit mode: # -data: ${DATA} - @${TRUE} - -# both all and alt +bmeyer: bmeyer.c + ${CC} -DY= -O6 $? -o $@ -lm # -everything: all alt - - -############### -# utility rules -############### +# linux/x86, glibc 2.0, libc4/5: # +# bmeyer: bmeyer.c +# ${CC} -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm +# +# linux/x86, glibc 2.1: +# +# bmeyer: bmeyer.c +# ${MAY_NEED_GCC} -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' \ +# -O6 $? -o $@ -lm + +bmeyer_files: lavabus.pgm lenna.glic michael.pgm + +# Best Abuse of User +# +briddlebane: briddlebane.c + ${CC} ${CFLAGS} $? -o $@ -lm + +briddlebane.orig: briddlebane.orig.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Best Layout +# +dhyang: dhyang.c + ${CC} ${CFLAGS} $? -o $@ + +dmy2jd: dmy2jd.c + ${CC} ${CFLAGS} $? -o $@ + +# Best of Show +# +jarijyrki: jarijyrki.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \ + -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \ + -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \ + -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \ + $? -o $@ ${X11LDFLAGS} -lX11 + +jarijyrki_files: sheet1.info + +# Worst Abuse of the Rules +# +# NOTE: You will need to adjust this path to the place where Perl has been +# installed on your system. Running "perl -V" may help you locate +# this place. +# +# The following bit of perl may help determining the values you need: +# +# perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"' +# +# +dlowe: dlowe.c + ${CC} ${NO_ANSI_CFLAGS} -DPERL_POLLUTE \ + `${PERL} -MExtUtils::Embed -e ccopts` $? -o $@ \ + `${PERL} -MExtUtils::Embed -e ldopts` + +# Best Small Program +# +natori: natori.c + ${CC} ${CFLAGS} $? -o $@ -lm + +# Astronomically Obfuscated +# +rince: rince.c + ${CC} ${X11CCFLAGS} ${CFLAGS} -DM_PI=3.14159265358979323846 \ + $? -o $@ -lm ${X11LDFLAGS} -lX11 + +# Best game +# +robison: robison.c + ${CC} ${CFLAGS} $? -o $@ + +# Most Portable Output +# +thadgavin: thadgavin.c + ${CC} ${CFLAGS} $? -o $@ -lcurses -lm + +thadgavin.orig: thadgavin.orig.c + ${CC} ${CFLAGS} $? -o $@ -lncurses -lm + +# Most Complete Program +# +tomx: tomx.c + ${CC} ${CFLAGS} $? -o $@ + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + clean: - ${RM} -f ${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/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 d9efb41d3..49e7cf5a9 100644 --- a/2001/anonymous/Makefile +++ b/2001/anonymous/Makefile @@ -1,14 +1,6 @@ -anonymous: anonymous.c - magic='${MAY_NEED_GCC} -O1'; \ - X='-DA(X)=#X'; \ - warning='-pedantic -Dprocessor'; \ - $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ - -o anonymous anonymous.c - -anonymous_files: anonymous.ten.c #!/usr/bin/env make # -# IOCCC 2001 winning entry - anonymous +# IOCCC 2001 entry Makefile ################################################################################ # @@ -20,7 +12,6 @@ anonymous_files: anonymous.ten.c # # 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: # @@ -54,548 +45,192 @@ anonymous_files: anonymous.ten.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= anonymous -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/bellard/Makefile b/2001/bellard/Makefile index 3d6ba6c3e..49e7cf5a9 100644 --- a/2001/bellard/Makefile +++ b/2001/bellard/Makefile @@ -1,10 +1,6 @@ -bellard: bellard.c - ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl - -bellard_files: bellard.otccex.c #!/usr/bin/env make # -# IOCCC 2001 winning entry - bellard +# IOCCC 2001 entry Makefile ################################################################################ # @@ -16,7 +12,6 @@ bellard_files: bellard.otccex.c # # 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: # @@ -50,548 +45,192 @@ bellard_files: bellard.otccex.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= bellard -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/cheong/Makefile b/2001/cheong/Makefile index 9808b41f2..49e7cf5a9 100644 --- a/2001/cheong/Makefile +++ b/2001/cheong/Makefile @@ -1,8 +1,6 @@ -cheong: cheong.c - ${CC} ${CFLAGS} cheong.c -o cheong #!/usr/bin/env make # -# IOCCC 2001 winning entry - cheong +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ cheong: cheong.c # # 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: # @@ -48,548 +45,192 @@ cheong: cheong.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= cheong -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/coupard/Makefile b/2001/coupard/Makefile index fbd210b35..49e7cf5a9 100644 --- a/2001/coupard/Makefile +++ b/2001/coupard/Makefile @@ -1,8 +1,6 @@ -coupard: coupard.c - ${CC} ${CFLAGS} -o coupard coupard.c #!/usr/bin/env make # -# IOCCC 2001 winning entry - coupard +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ coupard: coupard.c # # 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: # @@ -48,548 +45,192 @@ coupard: coupard.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= coupard -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/ctk/Makefile b/2001/ctk/Makefile index e8d3e7cbe..49e7cf5a9 100644 --- a/2001/ctk/Makefile +++ b/2001/ctk/Makefile @@ -1,8 +1,6 @@ -ctk: ctk.c - ${CC} ${CFLAGS} -o ctk ctk.c #!/usr/bin/env make # -# IOCCC 2001 winning entry - ctk +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ ctk: ctk.c # # 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: # @@ -48,548 +45,192 @@ ctk: ctk.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= ctk -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/dgbeards/Makefile b/2001/dgbeards/Makefile index cfb914807..49e7cf5a9 100644 --- a/2001/dgbeards/Makefile +++ b/2001/dgbeards/Makefile @@ -1,9 +1,6 @@ -dgbeards: dgbeards.c - ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ - -DI=0xFFFF dgbeards.c -o dgbeards #!/usr/bin/env make # -# IOCCC 2001 winning entry - dgbeards +# IOCCC 2001 entry Makefile ################################################################################ # @@ -15,7 +12,6 @@ dgbeards: dgbeards.c # # 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: # @@ -49,548 +45,192 @@ dgbeards: dgbeards.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= dgbeards -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/herrmann1/Makefile b/2001/herrmann1/Makefile index 9d30016d3..49e7cf5a9 100644 --- a/2001/herrmann1/Makefile +++ b/2001/herrmann1/Makefile @@ -1,11 +1,6 @@ -herrmann1: herrmann1.c herrmann1.sh - @echo "NOTE: $@ must be built/run using the script $@.sh" - ${SHELL} ./herrmann1.sh - -herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 #!/usr/bin/env make # -# IOCCC 2001 winning entry - herrmann1 +# IOCCC 2001 entry Makefile ################################################################################ # @@ -17,7 +12,6 @@ herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 # # 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: # @@ -51,548 +45,192 @@ herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= herrmann1 -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/herrmann2/Makefile b/2001/herrmann2/Makefile index 91e9d89d4..49e7cf5a9 100644 --- a/2001/herrmann2/Makefile +++ b/2001/herrmann2/Makefile @@ -1,12 +1,6 @@ -herrmann2: herrmann2.c - ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ - -include /usr/include/stdlib.h -include /usr/include/stdio.h \ - -include /usr/include/time.h -include /usr/include/unistd.h - -herrmann2_files: herrmann2.cup herrmann2.ioccc #!/usr/bin/env make # -# IOCCC 2001 winning entry - herrmann2 +# IOCCC 2001 entry Makefile ################################################################################ # @@ -18,7 +12,6 @@ herrmann2_files: herrmann2.cup herrmann2.ioccc # # 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: # @@ -52,548 +45,192 @@ herrmann2_files: herrmann2.cup herrmann2.ioccc # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= herrmann2 -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/jason/Makefile b/2001/jason/Makefile index 04e985e16..49e7cf5a9 100644 --- a/2001/jason/Makefile +++ b/2001/jason/Makefile @@ -1,8 +1,6 @@ -jason: jason.c - ${CC} ${CFLAGS} -o jason jason.c #!/usr/bin/env make # -# IOCCC 2001 winning entry - jason +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ jason: jason.c # # 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: # @@ -48,548 +45,192 @@ jason: jason.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= jason -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/kev/Makefile b/2001/kev/Makefile index 9961217ab..49e7cf5a9 100644 --- a/2001/kev/Makefile +++ b/2001/kev/Makefile @@ -1,10 +1,6 @@ -kev: kev.c - ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ - -lcurses -ltermcap \ - -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" #!/usr/bin/env make # -# IOCCC 2001 winning entry - kev +# IOCCC 2001 entry Makefile ################################################################################ # @@ -16,7 +12,6 @@ kev: kev.c # # 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: # @@ -50,548 +45,192 @@ kev: kev.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= kev -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/ollinger/Makefile b/2001/ollinger/Makefile index 3c58cdf04..49e7cf5a9 100644 --- a/2001/ollinger/Makefile +++ b/2001/ollinger/Makefile @@ -1,8 +1,6 @@ -ollinger: ollinger.c - ${CC} ${CFLAGS} ollinger.c -o ollinger #!/usr/bin/env make # -# IOCCC 2001 winning entry - ollinger +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ ollinger: ollinger.c # # 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: # @@ -48,548 +45,192 @@ ollinger: ollinger.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= ollinger -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/rosten/Makefile b/2001/rosten/Makefile index 0a10c8e5c..49e7cf5a9 100644 --- a/2001/rosten/Makefile +++ b/2001/rosten/Makefile @@ -1,9 +1,6 @@ -rosten: rosten.c - ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ - -o rosten #!/usr/bin/env make # -# IOCCC 2001 winning entry - rosten +# IOCCC 2001 entry Makefile ################################################################################ # @@ -15,7 +12,6 @@ rosten: rosten.c # # 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: # @@ -49,548 +45,192 @@ rosten: rosten.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= rosten -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/schweikh/Makefile b/2001/schweikh/Makefile index 9fd0e2cbe..49e7cf5a9 100644 --- a/2001/schweikh/Makefile +++ b/2001/schweikh/Makefile @@ -1,8 +1,6 @@ -schweikh: schweikh.c - ${CC} ${CFLAGS} schweikh.c -o schweikh #!/usr/bin/env make # -# IOCCC 2001 winning entry - schweikh +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ schweikh: schweikh.c # # 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: # @@ -48,548 +45,192 @@ schweikh: schweikh.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= schweikh -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/westley/Makefile b/2001/westley/Makefile index 714c9cc1c..49e7cf5a9 100644 --- a/2001/westley/Makefile +++ b/2001/westley/Makefile @@ -1,11 +1,6 @@ -westley: westley.c - ${CC} ${CFLAGS} westley.c -o westley - -westley.orig: westley.orig.c - ${CC} ${CFLAGS} westley.orig.c -o westley.orig #!/usr/bin/env make # -# IOCCC 2001 winning entry - westley +# IOCCC 2001 entry Makefile ################################################################################ # @@ -17,7 +12,6 @@ westley.orig: westley.orig.c # # 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: # @@ -51,548 +45,192 @@ westley.orig: westley.orig.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= westley -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2001/williams/Makefile b/2001/williams/Makefile index 19e479564..49e7cf5a9 100644 --- a/2001/williams/Makefile +++ b/2001/williams/Makefile @@ -1,8 +1,6 @@ -williams: williams.c - ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams #!/usr/bin/env make # -# IOCCC 2001 winning entry - williams +# IOCCC 2001 entry Makefile ################################################################################ # @@ -14,7 +12,6 @@ williams: williams.c # # 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: # @@ -48,548 +45,192 @@ williams: williams.c # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 +SHELL= /bin/sh 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 +# 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. +# Most compiles will safely use -O2. Some can use only -O. +# A few compilers have broken optimizers and thus you may +# not want anything. # #OPT= #OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 +OPT= -O2 -# Default flags for ANSI C compilation +# flags for ANSI compiles # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} -# C compiler to use +# NOTE: On some systems, the library path does not include the location +# of the X11 libraries. You might need to use a -L/path/to/X11/lib/dir +# in order to compile with these libs. +# +X11CCFLAGS= -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/X11 +#X11CCFLAGS= +X11LDFLAGS= -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib +#X11LDFLAGS= + +# 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 -#CC=gcc +MAY_NEED_GCC= gcc -# Compiler add-ons or replacements for clang only +# winners that compile under ANSI C # -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +WINNERS= anonymous bellard bellard.otccex cheong coupard \ + ctk dgbeards herrmann1 herrmann2 jason kev ollinger rosten \ + schweikh westley williams +ALT_NAMES= westley.orig +DATA_FILES= anonymous_files bellard_files herrmann1_files herrmann2_files -############################## -# Special flags for this entry -############################## +all: ${WINNERS} + +# Most likely to amaze # -ENTRY= williams -PROG= prog +anonymous: anonymous.c + magic='${MAY_NEED_GCC} -O1'; \ + X='-DA(X)=#X'; \ + warning='-pedantic -Dprocessor'; \ + $$magic $$warning -Dmagic= $$X "-DX=A($$magic \"$$X\")" \ + -o anonymous anonymous.c + +anonymous_files: anonymous.ten.c + +# Best abuse of the rules # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +bellard: bellard.c + ${CC} -rdynamic ${CFLAGS} bellard.c -o bellard -ldl + +bellard_files: bellard.otccex.c + +# Best short program # -ALT_OBJ= -ALT_TARGET= +cheong: cheong.c + ${CC} ${CFLAGS} cheong.c -o cheong - -################# -# build the entry -################# +# Most obfuscated sound # -all: data ${TARGET} - @${TRUE} +coupard: coupard.c + ${CC} ${CFLAGS} -o coupard coupard.c -.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 +# Worst Driver # -alt: data ${ALT_TARGET} - @${TRUE} +ctk: ctk.c + ${CC} ${CFLAGS} -o ctk ctk.c -# data files +# Worst AI # -data: ${DATA} - @${TRUE} +dgbeards: dgbeards.c + ${CC} ${CFLAGS} -DE=break -DF=char -DK=case -DP=int -DR=return \ + -DI=0xFFFF dgbeards.c -o dgbeards -# both all and alt +# Best abuse of the C preprocessor # -everything: all alt +herrmann1: herrmann1.c herrmann1.sh + @echo "NOTE: $@ must be built/run using the script $@.sh" + ${SHELL} ./herrmann1.sh +herrmann1_files: herrmann1.gcd herrmann1.sh herrmann1.times2 -############### -# utility rules -############### +# Most eye-crossing # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} - -# you may be able to misunderstand the source by reading indent.c +# This entry requires the GCC -include feature. # -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 +herrmann2: herrmann2.c + ${MAY_NEED_GCC} ${CFLAGS} herrmann2.c -o herrmann2 \ + -include /usr/include/stdlib.h -include /usr/include/stdio.h \ + -include /usr/include/time.h -include /usr/include/unistd.h +herrmann2_files: herrmann2.cup herrmann2.ioccc -################## -# 133t hacker rulz -################## +# Best Of Show # +jason: jason.c + ${CC} ${CFLAGS} -o jason jason.c + +# Best Curses Game +# +kev: kev.c + ${CC} ${CFLAGS} -DPORT=5455 -DSPEED=50 -o kev kev.c \ + -lcurses -ltermcap \ + -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" + +# Best primal ASCII graphics +# +ollinger: ollinger.c + ${CC} ${CFLAGS} ollinger.c -o ollinger + +# Best abuse of the user +# +rosten: rosten.c + ${CC} ${CFLAGS} rosten.c ${X11CCFLAGS} ${X11LDFLAGS} -pedantic -lX11 \ + -o rosten + +# Best one-liner +# +schweikh: schweikh.c + ${CC} ${CFLAGS} schweikh.c -o schweikh + +# Best position-independant code +# +westley: westley.c + ${CC} ${CFLAGS} westley.c -o westley + +westley.orig: westley.orig.c + ${CC} ${CFLAGS} westley.orig.c -o westley.orig + +# Best position-independant code +# +williams: williams.c + ${CC} williams.c ${X11CCFLAGS} ${X11LDFLAGS} -lX11 -o williams + +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} + love: @echo 'not war?' - @${TRUE} haste: - $(MAKE) waste - @${TRUE} + ${MAKE} waste waste: - @echo 'haste' + @echo 'waste' + +clean: + ${RM} -f *.o a.out core ${WINNERS} + +clobber: clean + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/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 4156f6ab6..84ef098e4 100644 --- a/2004/anonymous/Makefile +++ b/2004/anonymous/Makefile @@ -1,3 +1,118 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# anonymous: anonymous.c ${CC} anonymous.c -o anonymous @@ -6,596 +121,242 @@ anonymous_clean: anonymous_clobber: anonymous_clean ${RM} -f anonymous -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - anonymous - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best use of Vision # -SHELL= bash +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses -####################### -# common tool locations -####################### -# -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 +arachnid_clean: + ${RM} -f arachnid.o -# 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 +arachnid_clobber: arachnid_clean + ${RM} -f arachnid -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +arachnid_files: arachnid.info -############################## -# Special flags for this entry -############################## +# Best Calculated Risk # -ENTRY= anonymous -PROG= prog +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show # -ALT_OBJ= -ALT_TARGET= +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt -################# -# build the entry -################# +# Best Abuse of the Guidelines # -all: data ${TARGET} - @${TRUE} +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi -# alternative executable +hibachi_files: hibachi.tar.gz + + +# Most Functional Output # -alt: data ${ALT_TARGET} - @${TRUE} +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm -# data files +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table # -data: ${DATA} - @${TRUE} +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec -# both all and alt +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner # -everything: all alt +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/arachnid/Makefile b/2004/arachnid/Makefile index 6b795d13e..84ef098e4 100644 --- a/2004/arachnid/Makefile +++ b/2004/arachnid/Makefile @@ -1,3 +1,130 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# arachnid: arachnid.c ${CC} -o arachnid -DL=LINES -DS=COLS \ -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses @@ -9,596 +136,227 @@ arachnid_clobber: arachnid_clean ${RM} -f arachnid arachnid_files: arachnid.info -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - arachnid - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Calculated Risk # -SHELL= bash +burley: burley.c + ${CC} -ansi burley.c -o burley -####################### -# common tool locations -####################### -# -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 +burley_clean: + ${RM} -f burley.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +burley_clobber: burley_clean + ${RM} -f burley -############################## -# Special flags for this entry -############################## +# Best Use of Light and Spheres # -ENTRY= arachnid -PROG= prog +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines # -ALT_OBJ= -ALT_TARGET= +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz -################# -# build the entry -################# +# Most Functional Output # -all: data ${TARGET} - @${TRUE} +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o -# alternative executable +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table # -alt: data ${ALT_TARGET} - @${TRUE} +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec -# data files +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner # -data: ${DATA} - @${TRUE} +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski -# both all and alt +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine # -everything: all alt +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/burley/Makefile b/2004/burley/Makefile index 8a2a46be8..84ef098e4 100644 --- a/2004/burley/Makefile +++ b/2004/burley/Makefile @@ -1,3 +1,145 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# burley: burley.c ${CC} -ansi burley.c -o burley @@ -6,596 +148,215 @@ burley_clean: burley_clobber: burley_clean ${RM} -f burley -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - burley - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Use of Light and Spheres # -SHELL= bash +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare -####################### -# common tool locations -####################### -# -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 +gavare_clean: + ${RM} -f gavare.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +gavare_clobber: gavare_clean + ${RM} -f gavare -############################## -# Special flags for this entry -############################## +# Best of Show # -ENTRY= burley -PROG= prog +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output # -ALT_OBJ= -ALT_TARGET= +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig -################# -# build the entry -################# +# Best Abuse of the Periodic Table # -all: data ${TARGET} - @${TRUE} +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec -# alternative executable + +# Best one-liner # -alt: data ${ALT_TARGET} - @${TRUE} +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski -# data files +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine # -data: ${DATA} - @${TRUE} +newbern: newbern.c + ${CC} newbern.c -o newbern -# both all and alt +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility # -everything: all alt +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/gavare/Makefile b/2004/gavare/Makefile index c2315f544..84ef098e4 100644 --- a/2004/gavare/Makefile +++ b/2004/gavare/Makefile @@ -1,3 +1,157 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# gavare: gavare.c ${CC} -O3 gavare.c -o gavare @@ -6,596 +160,203 @@ gavare_clean: gavare_clobber: gavare_clean ${RM} -f gavare -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - gavare - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best of Show # -SHELL= bash +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim -####################### -# common tool locations -####################### -# -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 +gavin_clean: + ${RM} -f sh vi kernel gavin.o -# 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 +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +gavin_files: boot.b lilo.conf prim gavin_install.txt -############################## -# Special flags for this entry -############################## +# Best Abuse of the Guidelines # -ENTRY= gavare -PROG= prog +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table # -ALT_OBJ= -ALT_TARGET= +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec -################# -# build the entry -################# +# Best one-liner # -all: data ${TARGET} - @${TRUE} +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o -# alternative executable +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine # -alt: data ${ALT_TARGET} - @${TRUE} +newbern: newbern.c + ${CC} newbern.c -o newbern -# data files +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility # -data: ${DATA} - @${TRUE} +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane -# both all and alt +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses # -everything: all alt +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/gavin/Makefile b/2004/gavin/Makefile index 3ebb921f4..84ef098e4 100644 --- a/2004/gavin/Makefile +++ b/2004/gavin/Makefile @@ -1,3 +1,28 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + # Special flags for the gavin entry # # FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 @@ -13,6 +38,130 @@ GAVIN_FLAGS=\ '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + # Best of Show # gavin: gavin.c @@ -34,596 +183,180 @@ gavin_clobber: gavin_clean ${RM} -f gavin fs.tar gavin_files: boot.b lilo.conf prim gavin_install.txt -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - gavin - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Abuse of the Guidelines # -SHELL= bash +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) -####################### -# common tool locations -####################### -# -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 +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar -# 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 +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +hibachi_files: hibachi.tar.gz -############################## -# Special flags for this entry -############################## +# Most Functional Output # -ENTRY= gavin -PROG= prog +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner # -ALT_OBJ= -ALT_TARGET= +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 -################# -# build the entry -################# +# Best Font Engine # -all: data ${TARGET} - @${TRUE} +newbern: newbern.c + ${CC} newbern.c -o newbern -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +newbern_clean: + ${RM} -f newbern.o -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +newbern_clobber: newbern_clean + ${RM} -f newbern -# alternative executable +newbern_files: newbern.dat + + +# Best Utility # -alt: data ${ALT_TARGET} - @${TRUE} +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane -# data files +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses # -data: ${DATA} - @${TRUE} +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi -# both all and alt +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation # -everything: all alt +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/hibachi/Makefile b/2004/hibachi/Makefile index b0931ac56..84ef098e4 100644 --- a/2004/hibachi/Makefile +++ b/2004/hibachi/Makefile @@ -1,3 +1,192 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# hibachi: hibachi.tar.gz ${RM} -f hibachi.tar ${GUNZIP} < hibachi.tar.gz > hibachi.tar @@ -13,596 +202,161 @@ hibachi_clobber: hibachi_clean ${RM} -rf hibachi hibachi_files: hibachi.tar.gz -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - hibachi - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Most Functional Output # -SHELL= bash +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm -####################### -# common tool locations -####################### -# -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 +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm -# 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 +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig -############################## -# Special flags for this entry -############################## +# Best Abuse of the Periodic Table # -ENTRY= hibachi -PROG= prog +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine # -ALT_OBJ= -ALT_TARGET= +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat -################# -# build the entry -################# +# Best Utility # -all: data ${TARGET} - @${TRUE} +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +omoikane_clean: + ${RM} -f omoikane.o -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +omoikane_clobber: omoikane_clean + ${RM} -f omoikane -# alternative executable +omoikane_files: omoikane.info + + +# Best Non-Use of Curses # -alt: data ${ALT_TARGET} - @${TRUE} +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi -# data files +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation # -data: ${DATA} - @${TRUE} +sds: sds.c + ${CC} -o sds sds.c -# both all and alt +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game # -everything: all alt +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/hoyle/Makefile b/2004/hoyle/Makefile index 299d88198..84ef098e4 100644 --- a/2004/hoyle/Makefile +++ b/2004/hoyle/Makefile @@ -1,3 +1,211 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# hoyle: hoyle.c ${CC} hoyle.c -o hoyle -lm @@ -9,596 +217,146 @@ hoyle_clean: hoyle_clobber: hoyle_clean ${RM} -f hoyle hoyle.orig -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - hoyle - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Abuse of the Periodic Table # -SHELL= bash +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec -####################### -# common tool locations -####################### -# -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 +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec -############################## -# Special flags for this entry -############################## +# Best one-liner # -ENTRY= hoyle -PROG= prog +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility # -ALT_OBJ= -ALT_TARGET= +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info -################# -# build the entry -################# +# Best Non-Use of Curses # -all: data ${TARGET} - @${TRUE} +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +schnitzi_clean: + ${RM} -f schnitzi.o -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi -# alternative executable +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation # -alt: data ${ALT_TARGET} - @${TRUE} +sds: sds.c + ${CC} -o sds sds.c -# data files +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game # -data: ${DATA} - @${TRUE} +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 -# both all and alt +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP # -everything: all alt +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/jdalbec/Makefile b/2004/jdalbec/Makefile index 81b5d40bb..84ef098e4 100644 --- a/2004/jdalbec/Makefile +++ b/2004/jdalbec/Makefile @@ -1,3 +1,226 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# jdalbec: jdalbec.c @${RM} -f jdalbec2.c -${CC} -E jdalbec.c > jdalbec2.c @@ -10,596 +233,130 @@ jdalbec_clean: jdalbec_clobber: jdalbec_clean ${RM} -f jdalbec -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - jdalbec - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best one-liner # -SHELL= bash +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski -####################### -# common tool locations -####################### -# -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 +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig -# 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 +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o -# 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 +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 -############################## -# Special flags for this entry -############################## +# Best Font Engine # -ENTRY= jdalbec -PROG= prog +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses # -ALT_OBJ= -ALT_TARGET= +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 -################# -# build the entry -################# +# Best Abuse of Indentation # -all: data ${TARGET} - @${TRUE} +sds: sds.c + ${CC} -o sds sds.c -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +sds_clobber: sds_clean + ${RM} -f sds sds_encoder -# alternative executable + +# Best X11 Game # -alt: data ${ALT_TARGET} - @${TRUE} +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 -# data files +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP # -data: ${DATA} - @${TRUE} +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 -# both all and alt -# -everything: all alt +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/kopczynski/Makefile b/2004/kopczynski/Makefile index 5d8f932cc..84ef098e4 100644 --- a/2004/kopczynski/Makefile +++ b/2004/kopczynski/Makefile @@ -1,3 +1,242 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# kopczynski: kopczynski.c ${CC} -Dif=while kopczynski.c -o kopczynski @@ -12,596 +251,112 @@ kopczynski_clobber: kopczynski_clean kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ kopczynski-8c kopczynski-9 -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - kopczynski - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Font Engine # -SHELL= bash +newbern: newbern.c + ${CC} newbern.c -o newbern -####################### -# common tool locations -####################### -# -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 +newbern_clean: + ${RM} -f newbern.o -# 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 +newbern_clobber: newbern_clean + ${RM} -f newbern -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +newbern_files: newbern.dat -############################## -# Special flags for this entry -############################## +# Best Utility # -ENTRY= kopczynski -PROG= prog +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation # -ALT_OBJ= -ALT_TARGET= +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder -################# -# build the entry -################# +# Best X11 Game # -all: data ${TARGET} - @${TRUE} +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +vik1_clean: + ${RM} -f vik1.o -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +vik1_clobber: vik1_clean + ${RM} -f vik1 -# alternative executable + +# Best Abuse of CPP # -alt: data ${ALT_TARGET} - @${TRUE} +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 -# data files -# -data: ${DATA} - @${TRUE} +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o -# both all and alt -# -everything: all alt +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/newbern/Makefile b/2004/newbern/Makefile index 61ac63f3a..84ef098e4 100644 --- a/2004/newbern/Makefile +++ b/2004/newbern/Makefile @@ -1,3 +1,260 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# newbern: newbern.c ${CC} newbern.c -o newbern @@ -8,596 +265,98 @@ newbern_clobber: newbern_clean ${RM} -f newbern newbern_files: newbern.dat -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - newbern - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Utility # -SHELL= bash +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane -####################### -# common tool locations -####################### -# -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 +omoikane_clean: + ${RM} -f omoikane.o -# 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 +omoikane_clobber: omoikane_clean + ${RM} -f omoikane -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +omoikane_files: omoikane.info -############################## -# Special flags for this entry -############################## +# Best Non-Use of Curses # -ENTRY= newbern -PROG= prog +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game # -ALT_OBJ= -ALT_TARGET= +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 -################# -# build the entry -################# +# Best Abuse of CPP # -all: data ${TARGET} - @${TRUE} +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o -${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 +vik2_clobber: vik2_clean + ${RM} -f vik2 -############### # utility rules -############### # -clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/omoikane/Makefile b/2004/omoikane/Makefile index 86368503e..84ef098e4 100644 --- a/2004/omoikane/Makefile +++ b/2004/omoikane/Makefile @@ -1,3 +1,274 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# omoikane: omoikane.c ${CC} -O omoikane.c -o omoikane @@ -8,596 +279,84 @@ omoikane_clobber: omoikane_clean ${RM} -f omoikane omoikane_files: omoikane.info -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - omoikane - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Non-Use of Curses # -SHELL= bash +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi -####################### -# common tool locations -####################### -# -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 +schnitzi_clean: + ${RM} -f schnitzi.o -# 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 +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +schnitzi_files: schnitzi.inp0 schnitzi.inp1 -############################## -# Special flags for this entry -############################## +# Best Abuse of Indentation # -ENTRY= omoikane -PROG= prog +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP # -ALT_OBJ= -ALT_TARGET= +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -################# -# 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; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/schnitzi/Makefile b/2004/schnitzi/Makefile index 973784b2b..84ef098e4 100644 --- a/2004/schnitzi/Makefile +++ b/2004/schnitzi/Makefile @@ -1,3 +1,288 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# schnitzi: schnitzi.c ${CC} schnitzi.c -o schnitzi @@ -8,596 +293,70 @@ schnitzi_clobber: schnitzi_clean ${RM} -f schnitzi schnitzi_files: schnitzi.inp0 schnitzi.inp1 -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - schnitzi - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Abuse of Indentation # -SHELL= bash +sds: sds.c + ${CC} -o sds sds.c -####################### -# common tool locations -####################### -# -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 +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +sds_clobber: sds_clean + ${RM} -f sds sds_encoder -############################## -# Special flags for this entry -############################## +# Best X11 Game # -ENTRY= schnitzi -PROG= prog +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -################# -# 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; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/sds/Makefile b/2004/sds/Makefile index b22c50e16..84ef098e4 100644 --- a/2004/sds/Makefile +++ b/2004/sds/Makefile @@ -1,3 +1,302 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# sds: sds.c ${CC} -o sds sds.c @@ -6,596 +305,58 @@ sds_clean: sds_clobber: sds_clean ${RM} -f sds sds_encoder -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - sds - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best X11 Game # -SHELL= bash +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 -####################### -# common tool locations -####################### -# -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 +vik1_clean: + ${RM} -f vik1.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +vik1_clobber: vik1_clean + ${RM} -f vik1 -############################## -# Special flags for this entry -############################## +# Best Abuse of CPP # -ENTRY= sds -PROG= prog -# -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 + +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o + +vik2_clobber: vik2_clean + ${RM} -f vik2 -################# -# 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; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/vik1/Makefile b/2004/vik1/Makefile index 8a46c39be..84ef098e4 100644 --- a/2004/vik1/Makefile +++ b/2004/vik1/Makefile @@ -1,3 +1,314 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# vik1: vik1.c ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 @@ -6,596 +317,46 @@ vik1_clean: vik1_clobber: vik1_clean ${RM} -f vik1 -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - vik1 - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# +# Best Abuse of CPP # -SHELL= bash +vik2: vik2.c + @${RM} -f vik2_1.c + ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c + @${RM} -f vik2_2.c + ${CC} -E vik2_1.c > vik2_2.c + ${CC} -O vik2_2.c -o vik2 -####################### -# common tool locations -####################### -# -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 +vik2_clean: + ${RM} -f vik2_1.c vik2_2.c vik2.o -# 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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif +vik2_clobber: vik2_clean + ${RM} -f vik2 -############################## -# Special flags for this entry -############################## -# -ENTRY= vik1 -PROG= prog -# -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; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/2004/vik2/Makefile b/2004/vik2/Makefile index 44fb1dd0a..84ef098e4 100644 --- a/2004/vik2/Makefile +++ b/2004/vik2/Makefile @@ -1,3 +1,326 @@ +#!/bin/make +# +# 2004 makefile +# +# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + + +# tool locations +# +SHELL= /bin/sh +CP= cp +CPP= cpp +GUNZIP= gunzip +LD= ld +MAKE= make +RM= rm +SED= sed +TAR= tar +TRUE= true + + +# Special flags for the gavin entry +# +# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1 +# +GAVIN_OPT= -O1 +GAVIN_FLAGS=\ + '-DY(m)=*((int*)(m))'\ + '-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\ + '-DM=for(D=0;D<786432;D++)'\ + '-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\ + '-DV=0x90200'\ + '-DK=0'\ + '-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\ + '-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}' + + +# Set X11_LIBDIR to the directory where the X11 library resides +# +X11_LIBDIR= /usr/X11R6/lib + +#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 and thus you may +# not want anything. +# +#OPT= +#OPT= -O +#OPT= -O1 +OPT= -O2 + + +# flags for ANSI compiles +# +# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, +# others such as gcc may want -ansi, others (Compaq Tru64 Unix) +# want -std1, and others may want nothing at all. +# Adjust the CFLAGS line as needed. +# +# NOTE: Some compilers cannot optimize, or optimize some entries +# incorrectly. You might want to turn on -O to see if your +# compiler can handle them. +# +# +#CFLAGS= -Xa ${OPT} +#CFLAGS= -std1 $(OPT) +CFLAGS= -ansi ${OPT} + + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. +# +# Some entries seem to need gcc. If you have gcc, set +# both CC and MAY_NEED_GCC to gcc. +# +# If you do not have gcc, set CC to the name of your ANSI compiler, and +# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : +# to disable such programs. +# +CC= cc +MAY_NEED_GCC= gcc + + +# 2004 winners +# +WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \ + kopczynski newbern omoikane schnitzi sds vik1 vik2 +CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \ + hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \ + newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \ + vik2_clean +CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \ + gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \ + kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \ + sds_clobber vik1_clobber vik2_clobber +ALT_NAMES= hoyle.orig kopczynski.orig +DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \ + newbern_files omoikane_files schnitzi_files + + +# default build +# +all: ${WINNERS} + + +# Best use of "Precious" Lines +# +anonymous: anonymous.c + ${CC} anonymous.c -o anonymous + +anonymous_clean: + ${RM} -f anonymous.o + +anonymous_clobber: anonymous_clean + ${RM} -f anonymous + + +# Best use of Vision +# +arachnid: arachnid.c + ${CC} -o arachnid -DL=LINES -DS=COLS \ + -DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses + +arachnid_clean: + ${RM} -f arachnid.o + +arachnid_clobber: arachnid_clean + ${RM} -f arachnid + +arachnid_files: arachnid.info + + +# Best Calculated Risk +# +burley: burley.c + ${CC} -ansi burley.c -o burley + +burley_clean: + ${RM} -f burley.o + +burley_clobber: burley_clean + ${RM} -f burley + + +# Best Use of Light and Spheres +# +gavare: gavare.c + ${CC} -O3 gavare.c -o gavare + +gavare_clean: + ${RM} -f gavare.o + +gavare_clobber: gavare_clean + ${RM} -f gavare + + +# Best of Show +# +gavin: gavin.c + ${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c + ${RM} -f kernel + ./gavin > kernel + ${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c + ${RM} -f sh + ${LD} -s -o sh gavin.o + ${RM} -f vi + ${CP} sh vi + ${RM} -f fs.tar + ${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim + +gavin_clean: + ${RM} -f sh vi kernel gavin.o + +gavin_clobber: gavin_clean + ${RM} -f gavin fs.tar + +gavin_files: boot.b lilo.conf prim gavin_install.txt + + +# Best Abuse of the Guidelines +# +hibachi: hibachi.tar.gz + ${RM} -f hibachi.tar + ${GUNZIP} < hibachi.tar.gz > hibachi.tar + ${TAR} -xvf hibachi.tar + ${RM} -f hibachi.tar + (cd hibachi && ${SHELL} ./configure) + ([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true) + +hibachi_clean: + ${RM} -f hibachi/hibachi.o hibachi.tar + +hibachi_clobber: hibachi_clean + ${RM} -rf hibachi + +hibachi_files: hibachi.tar.gz + + +# Most Functional Output +# +hoyle: hoyle.c + ${CC} hoyle.c -o hoyle -lm + +hoyle.orig: hoyle.orig.c + ${CC} hoyle.orig.c -o hoyle.orig -lm + +hoyle_clean: + ${RM} -f hoyle.o hoyle.orig.o + +hoyle_clobber: hoyle_clean + ${RM} -f hoyle hoyle.orig + + +# Best Abuse of the Periodic Table +# +jdalbec: jdalbec.c + @${RM} -f jdalbec2.c + -${CC} -E jdalbec.c > jdalbec2.c + @${RM} -f jdalbec3.c + ${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c + ${CC} -ansi jdalbec3.c -o jdalbec + +jdalbec_clean: + ${RM} -f jdalbec2.c jdalbec3.c jdalbec.o + +jdalbec_clobber: jdalbec_clean + ${RM} -f jdalbec + + +# Best one-liner +# +kopczynski: kopczynski.c + ${CC} -Dif=while kopczynski.c -o kopczynski + +kopczynski.orig: kopczynski.orig.c + ${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig + +kopczynski_clean: + ${RM} -f kopczynski.o kopczynski.orig.o + +kopczynski_clobber: kopczynski_clean + ${RM} -f kopczynski kopczynski.orig + +kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \ + kopczynski-8c kopczynski-9 + + +# Best Font Engine +# +newbern: newbern.c + ${CC} newbern.c -o newbern + +newbern_clean: + ${RM} -f newbern.o + +newbern_clobber: newbern_clean + ${RM} -f newbern + +newbern_files: newbern.dat + + +# Best Utility +# +omoikane: omoikane.c + ${CC} -O omoikane.c -o omoikane + +omoikane_clean: + ${RM} -f omoikane.o + +omoikane_clobber: omoikane_clean + ${RM} -f omoikane + +omoikane_files: omoikane.info + + +# Best Non-Use of Curses +# +schnitzi: schnitzi.c + ${CC} schnitzi.c -o schnitzi + +schnitzi_clean: + ${RM} -f schnitzi.o + +schnitzi_clobber: schnitzi_clean + ${RM} -f schnitzi + +schnitzi_files: schnitzi.inp0 schnitzi.inp1 + + +# Best Abuse of Indentation +# +sds: sds.c + ${CC} -o sds sds.c + +sds_clean: + ${RM} -f sds_encoder.c sds_encoder.o sds.o + +sds_clobber: sds_clean + ${RM} -f sds sds_encoder + + +# Best X11 Game +# +vik1: vik1.c + ${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11 + +vik1_clean: + ${RM} -f vik1.o + +vik1_clobber: vik1_clean + ${RM} -f vik1 + + +# Best Abuse of CPP +# vik2: vik2.c @${RM} -f vik2_1.c ${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c @@ -10,596 +333,30 @@ vik2_clean: vik2_clobber: vik2_clean ${RM} -f vik2 -#!/usr/bin/env make -# -# IOCCC 2004 winning entry - vik2 - -################################################################################ -# -# 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/ -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vik2 -PROG= prog -# -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; \ - fi +everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES} -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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' + @echo 'waste' + +clean: ${CLEAN} + ${RM} -f a.out core + +clobber: ${CLOBBER} + ${RM} -f ${WINNERS} + ${RM} -f ${ALT_NAMES} + +nuke: clobber @${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/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/2005/aidan/Makefile b/2005/aidan/Makefile index 04983ba38..ac3871770 100644 --- a/2005/aidan/Makefile +++ b/2005/aidan/Makefile @@ -1,595 +1,15 @@ + +build: aidan + +clean: + +clobber: + -rm aidan + aidan: aidan.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - aidan -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= aidan -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/anon/Makefile b/2005/anon/Makefile index 2f7f028e5..4b714cc97 100644 --- a/2005/anon/Makefile +++ b/2005/anon/Makefile @@ -1,595 +1,15 @@ + +build: anon + +clean: + +clobber: + -rm anon + anon: anon.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - anon -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= anon -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/boutines/Makefile b/2005/boutines/Makefile index 3dcc88313..fc6b52340 100644 --- a/2005/boutines/Makefile +++ b/2005/boutines/Makefile @@ -1,3 +1,11 @@ + +build: boutines + +clean: + +clobber: + -rm boutines + boutines: boutines.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ @@ -5,596 +13,6 @@ alt: boutines.orig boutines.orig: boutines.orig.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - boutines -################################################################################ -# -# 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 -# -################################################################################ +data: -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: -# -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= boutines -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/chia/Makefile b/2005/chia/Makefile index 8750c593f..1f94dc5d5 100644 --- a/2005/chia/Makefile +++ b/2005/chia/Makefile @@ -1,595 +1,15 @@ + +build: chia + +clean: + +clobber: + -rm chia + chia: chia.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - chia -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= chia -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/giljade/Makefile b/2005/giljade/Makefile index 6a204a54e..592d62ed3 100644 --- a/2005/giljade/Makefile +++ b/2005/giljade/Makefile @@ -1,595 +1,15 @@ + +build: giljade + +clean: + +clobber: + -rm giljade + giljade: giljade.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - giljade -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= giljade -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/jetro/Makefile b/2005/jetro/Makefile index 377d61e48..843680777 100644 --- a/2005/jetro/Makefile +++ b/2005/jetro/Makefile @@ -1,598 +1,18 @@ + INCDIR=`sdl-config --cflags` LDFLAGS+=`sdl-config --libs` +build: jetro + +clean: + +clobber: + -rm jetro + jetro: jetro.c sdl-config --version && ${CC} ${CFLAGS} ${INCDIR} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - jetro -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= jetro -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/klausler/Makefile b/2005/klausler/Makefile index 188bba1db..561a43864 100644 --- a/2005/klausler/Makefile +++ b/2005/klausler/Makefile @@ -1,3 +1,12 @@ + +build: klausler + +clean: + -rm dict.h + +clobber: clean + -rm klausler + klausler: klausler.c dict.h ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ @@ -18,596 +27,3 @@ dict.h: uniq |\ sed 's/^/"/;s/$$/",/' >dict.h -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - klausler - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= klausler -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/mikeash/Makefile b/2005/mikeash/Makefile index d23e280d9..060c0439e 100644 --- a/2005/mikeash/Makefile +++ b/2005/mikeash/Makefile @@ -1,597 +1,16 @@ C99=--std=c99 +build: mikeash + +clean: + +clobber: + -rm mikeash + mikeash: mikeash.c ${CC} ${CFLAGS} ${C99} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - mikeash -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mikeash -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/mynx/Makefile b/2005/mynx/Makefile index e23127883..2c3337133 100644 --- a/2005/mynx/Makefile +++ b/2005/mynx/Makefile @@ -1,595 +1,15 @@ + +build: mynx + +clean: + +clobber: + -rm mynx + mynx: mynx.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - mynx -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mynx -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/persano/Makefile b/2005/persano/Makefile index 31e332e98..ab657f699 100644 --- a/2005/persano/Makefile +++ b/2005/persano/Makefile @@ -1,597 +1,15 @@ LDFLAGS+=-lm +build: persano + +clean: + +clobber: + -rm persano persano: persano.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - persano -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= persano -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/sykes/Makefile b/2005/sykes/Makefile index 6f91c465b..1190e6e87 100644 --- a/2005/sykes/Makefile +++ b/2005/sykes/Makefile @@ -36,596 +36,3 @@ kernal-2.901465-03.bin: nullfill.bin: dd bs=2k count=1 if=/dev/zero of=nullfill.bin -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - sykes - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= sykes -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/timwi/Makefile b/2005/timwi/Makefile index e7bb85cf2..5bebb85ae 100644 --- a/2005/timwi/Makefile +++ b/2005/timwi/Makefile @@ -1,595 +1,15 @@ + +build: timwi + +clean: + +clobber: + -rm timwi + timwi: timwi.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - timwi -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= timwi -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/toledo/Makefile b/2005/toledo/Makefile index e7c4727dd..94666cc28 100644 --- a/2005/toledo/Makefile +++ b/2005/toledo/Makefile @@ -1,3 +1,11 @@ + +build: toledo + +clean: + +clobber: + -rm toledo toledo2 + toledo: toledo.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ @@ -5,596 +13,6 @@ alt: toledo2 toledo2: toledo2.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - toledo -################################################################################ -# -# 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 -# -################################################################################ +data: -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: -# -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= toledo -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/vik/Makefile b/2005/vik/Makefile index 63488a639..86d64a368 100644 --- a/2005/vik/Makefile +++ b/2005/vik/Makefile @@ -1,597 +1,15 @@ LDFLAGS+=-L${X11_LIBDIR} -lX11 -lm +build: vik + +clean: + +clobber: + -rm vik vik: vik.c ${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - vik -################################################################################ -# -# 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 -# -################################################################################ +alt: -# 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/ +data: - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vik -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2005/vince/Makefile b/2005/vince/Makefile index 45554108d..534e58b04 100644 --- a/2005/vince/Makefile +++ b/2005/vince/Makefile @@ -1,5 +1,9 @@ LDFLAGS+=-lGL -lGLU -L${X11_LIBDIR} -lX11 +build: vince + +clean: + clobber: -rm vince vince.improved @@ -10,596 +14,6 @@ alt: vince.improved vince.improved: vince.improved.c ${CC} ${CFLAGS} -I${X11_INCLUDEDIR} ${LDFLAGS} $< -o $@ -#!/usr/bin/env make -# -# IOCCC 2005 winning entry - vince -################################################################################ -# -# 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 -# -################################################################################ +data: -# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under: -# -# Creative Commons Attribution-ShareAlike 3.0 Unported License. -# -# See: http://creativecommons.org/licenses/by-sa/3.0/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vince -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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/2006/birken/Makefile b/2006/birken/Makefile index 6b9706b54..e862d6727 100644 --- a/2006/birken/Makefile +++ b/2006/birken/Makefile @@ -1,595 +1,31 @@ -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - birken +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ +# data files for this entry # -# 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 -# -################################################################################ +DATA= adder.tofu buffer.tofu computer.tofu counter.tofu divider.tofu \ + lfsr.tofu memory.tofu multiplier.tofu multiplier2.tofu oneline.tofu \ + shift.tofu zuse.tofu zuse2.tofu -# 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/ +build: ${ENTRY} -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= birken -PROG= prog -# -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; \ - fi + -${RM} ${ENTRY} clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/borsanyi/Makefile b/2006/borsanyi/Makefile index e5fb1e85d..aa4f18704 100644 --- a/2006/borsanyi/Makefile +++ b/2006/borsanyi/Makefile @@ -1,596 +1,31 @@ +# 2006 makefile +# +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + +# data files for this entry +# +DATA= + + +build: ${ENTRY} + + +clean: + -${RM} ${ENTRY} + +clobber: clean + + +alt: + + +data: + + ${ENTRY}: ${ENTRY}.c ${DATA} ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make -# -# IOCCC 2006 winning entry - borsanyi - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= borsanyi -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2006/grothe/Makefile b/2006/grothe/Makefile index 6bb2ec24e..b3a4d2629 100644 --- a/2006/grothe/Makefile +++ b/2006/grothe/Makefile @@ -1,597 +1,35 @@ -LOCAL_FLAGS= -I${X11_INCDIR} -L${X11_LIBDIR} -lX11 ${OPT} -DATA= arabian.txt olympic.txt twinkle.txt test.txt -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - grothe +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ -# -# An Historical Makefile NOTE: -# -# The orig.Makefile, if it exits, is the original Makefile before this IOCCC -# year directory was reworked so that entries are in separate directories. -# This also applies to any orig.ansi.mk and orig.common.mk files. -# -# Several Makefiles were modified / formed in 2022, and as such it may have -# elements that are not historically compatible with way entries were built. -# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. -# -# Regarding individual entries: -# -# IOCCC winning entry code may not work on your system. Even with standards, -# conditions and build environments change, especially when it comes to more -# extreme code such you might find in an IOCCC winner. Moreover, what was -# allowed and liked in one IOCCC contest may no longer be liked/allowed in -# later IOCCC years. -# -# Corrections on winning author and fixing typos in remarks are VERY WELCOME. -# -# GitHub pull requests are welcome: -# -# If you have a patch that might make running an entry work in modern Unix-like -# environments, please create a GitHub pull request for the IOCCC 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## # Special flags for this entry -############################## # -ENTRY= grothe -PROG= prog +LOCAL_FLAGS= -I${X11_INCDIR} -L${X11_LIBDIR} -lX11 ${OPT} + +# Data files for this entry # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= +DATA= arabian.txt olympic.txt twinkle.txt test.txt -################# -# 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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/hamre/Makefile b/2006/hamre/Makefile index cb3cdf186..31788eae5 100644 --- a/2006/hamre/Makefile +++ b/2006/hamre/Makefile @@ -1,595 +1,31 @@ -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - hamre +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ +# data files for this entry # -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hamre -PROG= prog -# -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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/meyer/Makefile b/2006/meyer/Makefile index e3841952b..31788eae5 100644 --- a/2006/meyer/Makefile +++ b/2006/meyer/Makefile @@ -1,595 +1,31 @@ -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - meyer +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ +# data files for this entry # -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= meyer -PROG= prog -# -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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/monge/Makefile b/2006/monge/Makefile index 4da7db3d8..b948789f0 100644 --- a/2006/monge/Makefile +++ b/2006/monge/Makefile @@ -1,602 +1,41 @@ +# 2006 makefile +# +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + +# Special flags for this entry +# LOCAL_FLAGS= -O3 `sdl-config --libs --cflags` # For Mac OS X with Darwin Ports installed # LOCAL_FLAGS= -O3 `/opt/local/bin/sdl-config --libs --cflags` + +# Data files for this entry +# +DATA= + + +build: ${ENTRY} ${ENTRY}_orig + + +clean: + -${RM} ${ENTRY} ${ENTRY}_orig + + +clobber: clean + + +alt: + + +data: + + ${ENTRY}: ${ENTRY}.c ${DATA} ${CC} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} ${ENTRY}_orig: ${ENTRY}_orig.c ${CC} ${LOCAL_FLAGS} ${ENTRY}_orig.c -o ${ENTRY}_orig -#!/usr/bin/env make -# -# IOCCC 2006 winning entry - monge - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= monge -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2006/night/Makefile b/2006/night/Makefile index c7f656b79..83dacec13 100644 --- a/2006/night/Makefile +++ b/2006/night/Makefile @@ -1,597 +1,36 @@ +# 2006 makefile +# +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + +# Special flags for this entry +# LOCAL_FLAGS= -lncurses + +# data files for this entry +# +DATA= + + +build: ${ENTRY} + + +clean: + -${RM} ${ENTRY} ${ENTRY}_orig + + +clobber: clean + + +alt: + + +data: + + ${ENTRY}: ${ENTRY}.c ${DATA} ${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make -# -# IOCCC 2006 winning entry - night - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= night -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2006/sloane/Makefile b/2006/sloane/Makefile index 27fa5e1f0..6b78d6dfc 100644 --- a/2006/sloane/Makefile +++ b/2006/sloane/Makefile @@ -1,596 +1,35 @@ -LOCAL_FLAGS= ${CFLAGS} -lm -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - sloane +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ -# -# An Historical Makefile NOTE: -# -# The orig.Makefile, if it exits, is the original Makefile before this IOCCC -# year directory was reworked so that entries are in separate directories. -# This also applies to any orig.ansi.mk and orig.common.mk files. -# -# Several Makefiles were modified / formed in 2022, and as such it may have -# elements that are not historically compatible with way entries were built. -# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. -# -# Regarding individual entries: -# -# IOCCC winning entry code may not work on your system. Even with standards, -# conditions and build environments change, especially when it comes to more -# extreme code such you might find in an IOCCC winner. Moreover, what was -# allowed and liked in one IOCCC contest may no longer be liked/allowed in -# later IOCCC years. -# -# Corrections on winning author and fixing typos in remarks are VERY WELCOME. -# -# GitHub pull requests are welcome: -# -# If you have a patch that might make running an entry work in modern Unix-like -# environments, please create a GitHub pull request for the IOCCC 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## # Special flags for this entry -############################## # -ENTRY= sloane -PROG= prog +LOCAL_FLAGS= ${CFLAGS} -lm + +# data files for this entry # -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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} ${ENTRY}_orig + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/stewart/Makefile b/2006/stewart/Makefile index ace8ddc22..d706882ca 100644 --- a/2006/stewart/Makefile +++ b/2006/stewart/Makefile @@ -1,595 +1,39 @@ -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - stewart +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ -# -# An Historical Makefile NOTE: -# -# The orig.Makefile, if it exits, is the original Makefile before this IOCCC -# year directory was reworked so that entries are in separate directories. -# This also applies to any orig.ansi.mk and orig.common.mk files. -# -# Several Makefiles were modified / formed in 2022, and as such it may have -# elements that are not historically compatible with way entries were built. -# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. -# -# Regarding individual entries: -# -# IOCCC winning entry code may not work on your system. Even with standards, -# conditions and build environments change, especially when it comes to more -# extreme code such you might find in an IOCCC winner. Moreover, what was -# allowed and liked in one IOCCC contest may no longer be liked/allowed in -# later IOCCC years. -# -# Corrections on winning author and fixing typos in remarks are VERY WELCOME. -# -# GitHub pull requests are welcome: -# -# If you have a patch that might make running an entry work in modern Unix-like -# environments, please create a GitHub pull request for the IOCCC 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## # Special flags for this entry -############################## # -ENTRY= stewart -PROG= prog +#CFLAGS= + +# data files for this entry # -OBJ= ${PROG}.o -DATA= -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= +DATA= altar box box2 box3 carpet circles cross cross2 cross3 \ + crystal curve diamonds diamonds2 dragon dragon2 dragon3 \ + fern gasket gasket_mod gasket_mod2 ioccc maze octagon \ + pentagon pentagons rings rings2 spirals spirals2 spirals3 \ + spirals4 squares stars stars2 tree tree2 tree3 tree4 triangle -################# -# 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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/sykes1/Makefile b/2006/sykes1/Makefile index 7cb3309fe..e40eebf08 100644 --- a/2006/sykes1/Makefile +++ b/2006/sykes1/Makefile @@ -1,603 +1,39 @@ +# 2006 makefile +# +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + +# Special flags for this entry +# LOCAL_FLAGS= -Wall -W -ansi -O3 --unroll-loops + +# data files for this entry +# +DATA= + + +build: ${ENTRY} ${ENTRY}.html + + +clean: + -${RM} ${ENTRY} ${ENTRY}.html + + +clobber: clean + + +alt: + + +data: + + ${ENTRY}: ${ENTRY}.c ${DATA} ${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} ${ENTRY}.html: ${ENTRY}.c ${RM} ${ENTRY}.html cp ${ENTRY}.c ${ENTRY}.html - -clean: - -${RM} ${ENTRY} ${ENTRY}.html -#!/usr/bin/env make -# -# IOCCC 2006 winning entry - sykes1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= sykes1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2006/sykes2/Makefile b/2006/sykes2/Makefile index 9d03bebe7..78e61ebce 100644 --- a/2006/sykes2/Makefile +++ b/2006/sykes2/Makefile @@ -1,595 +1,35 @@ -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - sykes2 +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ -# -# An Historical Makefile NOTE: -# -# The orig.Makefile, if it exits, is the original Makefile before this IOCCC -# year directory was reworked so that entries are in separate directories. -# This also applies to any orig.ansi.mk and orig.common.mk files. -# -# Several Makefiles were modified / formed in 2022, and as such it may have -# elements that are not historically compatible with way entries were built. -# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. -# -# Regarding individual entries: -# -# IOCCC winning entry code may not work on your system. Even with standards, -# conditions and build environments change, especially when it comes to more -# extreme code such you might find in an IOCCC winner. Moreover, what was -# allowed and liked in one IOCCC contest may no longer be liked/allowed in -# later IOCCC years. -# -# Corrections on winning author and fixing typos in remarks are VERY WELCOME. -# -# GitHub pull requests are welcome: -# -# If you have a patch that might make running an entry work in modern Unix-like -# environments, please create a GitHub pull request for the IOCCC 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## # Special flags for this entry -############################## # -ENTRY= sykes2 -PROG= prog +#CFLAGS= + +# data files for this entry # -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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} ${ENTRY}.html + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/toledo1/Makefile b/2006/toledo1/Makefile index 42c054022..531d7d468 100644 --- a/2006/toledo1/Makefile +++ b/2006/toledo1/Makefile @@ -1,595 +1,35 @@ -${ENTRY}: ${ENTRY}.c ${DATA} - ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -#!/usr/bin/env make +# 2006 makefile # -# IOCCC 2006 winning entry - toledo1 +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. -################################################################################ -# -# An Historical Makefile NOTE: -# -# The orig.Makefile, if it exits, is the original Makefile before this IOCCC -# year directory was reworked so that entries are in separate directories. -# This also applies to any orig.ansi.mk and orig.common.mk files. -# -# Several Makefiles were modified / formed in 2022, and as such it may have -# elements that are not historically compatible with way entries were built. -# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile. -# -# Regarding individual entries: -# -# IOCCC winning entry code may not work on your system. Even with standards, -# conditions and build environments change, especially when it comes to more -# extreme code such you might find in an IOCCC winner. Moreover, what was -# allowed and liked in one IOCCC contest may no longer be liked/allowed in -# later IOCCC years. -# -# Corrections on winning author and fixing typos in remarks are VERY WELCOME. -# -# GitHub pull requests are welcome: -# -# If you have a patch that might make running an entry work in modern Unix-like -# environments, please create a GitHub pull request for the IOCCC 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## # Special flags for this entry -############################## # -ENTRY= toledo1 -PROG= prog +#CFLAGS= + +# data files for this entry # -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 +build: ${ENTRY} -############### -# utility rules -############### -# clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + -${RM} ${ENTRY} + clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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} +alt: -haste: - $(MAKE) waste - @${TRUE} -waste: - @echo 'haste' - @${TRUE} +data: -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" +${ENTRY}: ${ENTRY}.c ${DATA} + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} diff --git a/2006/toledo2/Makefile b/2006/toledo2/Makefile index 484d783cd..b97aeffe1 100644 --- a/2006/toledo2/Makefile +++ b/2006/toledo2/Makefile @@ -1,603 +1,39 @@ +# 2006 makefile +# +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + +# Special flags for this entry +# +#CFLAGS= + +# data files for this entry +# DATA=C C.BASIC C.BIOS + + +build: ${ENTRY} + + +clean: + -${RM} ${ENTRY} C + + +clobber: clean + + +alt: + + +data: + + ${ENTRY}: ${ENTRY}.c ${DATA} ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} C: C.BASIC ${RM} C cp C.BASIC C - -clean: - -${RM} ${ENTRY} C -#!/usr/bin/env make -# -# IOCCC 2006 winning entry - toledo2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= toledo2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2006/toledo3/Makefile b/2006/toledo3/Makefile index 5f33b4897..55e113997 100644 --- a/2006/toledo3/Makefile +++ b/2006/toledo3/Makefile @@ -1,4 +1,36 @@ +# 2006 makefile +# +# Copyright (C) 2006-2009, Landon Curt Noll, Simon Cooper, Peter Seebach +# and Leonid A. Broukhis. All Rights Reserved. Permission for personal, +# educational or non-profit use is granted provided this copyright and +# notice are included in its entirety and remains unaltered. All other +# uses must receive prior permission from the contest judges. + +# Special flags for this entry +# LOCAL_FLAGS= -I${X11_INCDIR} -L${X11_LIBDIR} -lX11 ${OPT} + +# data files for this entry +# +DATA= + + +build: ${ENTRY} ${ENTRY}-sbar ${ENTRY}-txt + + +clean: + -${RM} ${ENTRY} ${ENTRY}-sbar ${ENTRY}-txt + + +clobber: clean + + +alt: + + +data: + + ${ENTRY}: ${ENTRY}.c ${DATA} ${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY} @@ -7,596 +39,3 @@ ${ENTRY}-sbar: ${ENTRY}-sbar.c ${DATA} ${ENTRY}-txt: ${ENTRY}-txt.c ${DATA} ${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}-txt.c -o ${ENTRY}-txt -#!/usr/bin/env make -# -# IOCCC 2006 winning entry - toledo3 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= toledo3 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 25debb7d1..4beb27453 100644 --- a/2011/akari/Makefile +++ b/2011/akari/Makefile @@ -1,426 +1,65 @@ #!/usr/bin/env make # -# IOCCC 2011 winning entry - akari - -################################################################################ +# 2011 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: +# This work by Landon Curt Noll, Simon Cooper, and Leonid A. Broukhis +# is licensed under: # # Creative Commons Attribution-ShareAlike 3.0 Unported License. # # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# +################ +# tool locations +################ # SHELL= bash - -####################### -# common tool locations -####################### -# -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 +# Compiler warnings # -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib +CWARN= -Wall -W -pedantic -# Set X11_INCLUDEDIR to the directory where the X11 include files reside +# compiler standard # -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include +CSTD= -std=c99 +CSTD2= -ansi -# Common C compiler warnings to silence +# compiler bit architecture # -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: +# Some entries require 32-bitness, +# other entries require 64-bitess. +# By default we assume nothing. # ARCH= -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC - -# 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 +# 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 +OPT= -O2 -# Default flags for ANSI C compilation +# default flags for ANSI C compilation # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} +CFLAGS= ${CWARN} ${CSTD} ${ARCH} ${OPT} +CFLAGS2= ${CSTD2} ${ARCH} ${OPT} -# Libraries needed to build +# ANSI compiler # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL - -# C compiler to use +# Set CC to the name of your ANSI compiler. # CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif ############################## @@ -428,104 +67,70 @@ endif ############################## # ENTRY= akari -PROG= ${ENTRY} -# -OBJ= ${PROG}.o DATA= example.ppm -TARGET= ${PROG} ${PROG}2 ${PROG}3 ${PROG}4 -# -ALT_OBJ= -ALT_TARGET= ################# # build the entry ################# # -all: data ${TARGET} +all: ${ENTRY} ${DATA} @${TRUE} -.PHONY: all alt data everything clean clobber install \ - love haste waste maker easter_egg sandwich \ - supernova deep_magic magic charon pluto +everything: ${ENTRY} \ + ${ENTRY}2.c ${ENTRY}2 \ + ${ENTRY}3.c ${ENTRY}3 \ + ${ENTRY}4.c ${ENTRY}4 + @${TRUE} -${PROG}: ${PROG}.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} +${ENTRY}: ${ENTRY}.c + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} -${PROG}2.c: ${PROG} - ./${PROG} ${PROG}.c $@ +${ENTRY}2.c: ${ENTRY} + ./${ENTRY} ${ENTRY}.c $@ -${PROG}2: ${PROG}2.c - ${CC} ${CFLAGS} ${PROG}2.c -o $@ +${ENTRY}2: ${ENTRY}2.c + ${CC} ${CFLAGS} ${ENTRY}2.c -o $@ -${PROG}3.c: ${PROG} ${PROG}.c - ./${PROG} < ${PROG}.c | ./${PROG} > $@ +${ENTRY}3.c: ${ENTRY} ${ENTRY}.c + ./${ENTRY} < ${ENTRY}.c | ./${ENTRY} > $@ -${PROG}3: ${PROG}3.c - ${CC} ${CFLAGS2} ${PROG}3.c -o $@ +${ENTRY}3: ${ENTRY}3.c + ${CC} ${CFLAGS2} ${ENTRY}3.c -o $@ -${PROG}4.c: ${PROG} ${PROG}.c - ./${PROG} < ${PROG}.c | ./${PROG} | ./${PROG} > $@ +${ENTRY}4.c: ${ENTRY} ${ENTRY}.c + ./${ENTRY} < ${ENTRY}.c | ./${ENTRY} | ./${ENTRY} > $@ -${PROG}4: ${PROG}4.c - ${CC} ${CFLAGS2} ${PROG}4.c -o $@ +${ENTRY}4: ${ENTRY}4.c + ${CC} ${CFLAGS2} ${ENTRY}4.c -o $@ # alternative executable # -alt: data ${ALT_TARGET} +alt: @${TRUE} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - ############### # utility rules ############### # +everything: all alt + clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f ${ENTRY}.o ${ENTRY}2.c ${ENTRY}3.c ${ENTRY}4.c clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - ${RM} -f ${PROG}2.c ${PROG}3.c ${PROG}4.c - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${ENTRY} ${ENTRY}2 ${ENTRY}3 ${ENTRY}4 + +nuke: clobber + @echo gnab gib! install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} + @echo "Surely you're joking Mr. Feynman!" -# you may be able to misunderstand the source by reading indent.c +# backwards compatibility # -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 +build: all ################## @@ -534,672 +139,15 @@ indent.c: ${PROG}.c # love: @echo 'not war?' - @${TRUE} haste: $(MAKE) waste - @${TRUE} waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} + @echo 'waste' 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" + @echo you expected to mis-understand this $${RANDOM} magic + @echo chongo '' "/\\oo/\\" + @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${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" -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - akari - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= akari -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/blakely/Makefile b/2011/blakely/Makefile index eaf9f7f47..0288d8eb3 100644 --- a/2011/blakely/Makefile +++ b/2011/blakely/Makefile @@ -1,427 +1,53 @@ #!/usr/bin/env make # -# IOCCC 2011 winning entry - blakely - -################################################################################ +# 2011 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. +# Copyright (C) 2011, Landon Curt Noll, Simon Cooper, and Leonid A. Broukhis. # +# Creative Commons Attribution-ShareAlike 3.0 Unported License. # See: http://creativecommons.org/licenses/by-sa/3.0/ -############################# -# shell used by this Makefile -############################# +################ +# tool locations +################ # SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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= -Do=char -Dn=return -Dd=int -Dz=memset -Dk=sizeof - -# Include files that are needed to compile -# -#CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -CINCLUDE= -include stdio.h -include string.h -include unistd.h -#CINCLUDE= -I ${X11_INCDIR} -#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 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 +OPT= -O2 -# Default flags for ANSI C compilation +# bitness # -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build +# Some entries require 32-bitness, +# other entries require 64-bitess. +# By default we assume nothing. # -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL +ARCH= -# C compiler to use +# default flags for ANSI C compilation +# +CFLAGS= -Wall -ansi -pedantic -Do=char -Dn=return -Dd=int -Dz=memset -Dk=sizeof -include stdio.h -include string.h -include unistd.h ${ARCH} ${OPT} + +# ANSI compiler +# +# Set CC to the name of your ANSI compiler. # CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif ############################## @@ -429,85 +55,46 @@ endif ############################## # ENTRY= blakely -PROG= ${ENTRY} -# -OBJ= ${PROG}.o DATA= 3.dat evolve_to_3.dat t0_3.dat -TARGET= ${PROG} -# -ALT_OBJ= -ALT_TARGET= ################# # build the entry ################# # -all: data ${TARGET} +all: ${ENTRY} ${DATA} @${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} +${ENTRY}: ${ENTRY}.c + ${CC} ${CFLAGS} ${ENTRY}.c -o ${ENTRY} # alternative executable # -alt: data ${ALT_TARGET} +alt: @${TRUE} -# data files -# -data: ${DATA} - @${TRUE} - -# both all and alt -# -everything: all alt - ############### # utility rules ############### # +everything: all alt + clean: - ${RM} -f ${OBJ} ${ALT_OBJ} - @-if [ -f indent.c ]; then \ - echo ${RM} -f indent.c; \ - ${RM} -f indent.c; \ - fi + ${RM} -f ${ENTRY}.o clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi + ${RM} -f ${ENTRY} + +nuke: clobber + @echo gnab gib! install: - @echo "Dr. Spock says that is not logical!" - @${TRUE} + @echo "Surely you're joking Mr. Feynman!" -# you may be able to misunderstand the source by reading indent.c +# backwards compatibility # -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 +build: all ################## @@ -516,672 +103,15 @@ indent.c: ${PROG}.c # love: @echo 'not war?' - @${TRUE} haste: $(MAKE) waste - @${TRUE} waste: - @echo 'haste' - @${TRUE} - -maker: - @echo 'Participate in a maker faire' - @${TRUE} + @echo 'waste' 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" + @echo you expected to mis-understand this $${RANDOM} magic + @echo chongo '' "/\\oo/\\" + @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${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" -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - blakely - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= blakely -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/borsanyi/Makefile b/2011/borsanyi/Makefile index e8b3f657b..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 @@ -115,596 +115,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - borsanyi - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= borsanyi -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/dlowe/Makefile b/2011/dlowe/Makefile index b9e3b3168..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 @@ -125,596 +125,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - dlowe - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dlowe -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/eastman/Makefile b/2011/eastman/Makefile index 2283be887..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 @@ -115,596 +115,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - eastman - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= eastman -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/fredriksson/Makefile b/2011/fredriksson/Makefile index 4d043bd7a..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 @@ -115,596 +115,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - fredriksson - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= fredriksson -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/goren/Makefile b/2011/goren/Makefile index be1934761..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 @@ -136,596 +136,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - goren - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= goren -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/hamaji/Makefile b/2011/hamaji/Makefile index 1337d900a..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 @@ -125,596 +125,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - hamaji - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hamaji -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/hou/Makefile b/2011/hou/Makefile index d37b9b2fd..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 @@ -115,596 +115,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - hou - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hou -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/konno/Makefile b/2011/konno/Makefile index e08573724..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 @@ -125,596 +125,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - konno - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= konno -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/richards/Makefile b/2011/richards/Makefile index 6c8aa990c..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 @@ -115,596 +115,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - richards - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= richards -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/toledo/Makefile b/2011/toledo/Makefile index 453365ad9..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 @@ -123,596 +123,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - toledo - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= toledo -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/vik/Makefile b/2011/vik/Makefile index 24c0f47dd..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 @@ -116,596 +116,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - vik - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vik -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2011/zucker/Makefile b/2011/zucker/Makefile index c7328ec3e..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 @@ -115,596 +115,3 @@ easter_egg: @echo chongo '' "/\\oo/\\" @echo Readers shall not be disallowed from being unable to partly misunderstand this final echo. @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2011 winning entry - zucker - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= zucker -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 6a8287994..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 @@ -202,596 +202,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - blakely - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= blakely -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/deckmyn/Makefile b/2012/deckmyn/Makefile index 76335cd68..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - deckmyn - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= deckmyn -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/dlowe/Makefile b/2012/dlowe/Makefile index 2eec58894..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - dlowe - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dlowe -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/endoh1/Makefile b/2012/endoh1/Makefile index 969c1ca33..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 @@ -220,596 +220,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - endoh1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh1 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/endoh2/Makefile b/2012/endoh2/Makefile index f19558cce..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 @@ -349,596 +349,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - endoh2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh2 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/grothe/Makefile b/2012/grothe/Makefile index 90b569697..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 @@ -205,596 +205,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - grothe - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= grothe -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/hamano/Makefile b/2012/hamano/Makefile index 8dc1f061b..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 @@ -204,596 +204,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - hamano - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hamano -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/hou/Makefile b/2012/hou/Makefile index 392c20697..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - hou - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hou -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/kang/Makefile b/2012/kang/Makefile index 1494abd56..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 @@ -204,596 +204,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - kang - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= kang -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/konno/Makefile b/2012/konno/Makefile index ba4189fae..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 @@ -207,596 +207,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - konno - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= konno -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/omoikane/Makefile b/2012/omoikane/Makefile index d59e67bdd..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - omoikane - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= omoikane -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/tromp/Makefile b/2012/tromp/Makefile index 31723af54..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 @@ -205,596 +205,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - tromp - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= tromp -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/vik/Makefile b/2012/vik/Makefile index c18bf6830..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - vik - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vik -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2012/zeitak/Makefile b/2012/zeitak/Makefile index 9f91417e6..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 @@ -208,596 +208,3 @@ magic: deep_magic echo "These aren't the droids you're looking for Mr. Spock!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2012 winning entry - zeitak - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= zeitak -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 35b2a7092..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 @@ -210,596 +210,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - birken - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= birken -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/cable1/Makefile b/2013/cable1/Makefile index f4de5c0c2..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 @@ -200,596 +200,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - cable1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= cable1 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/cable2/Makefile b/2013/cable2/Makefile index d41961650..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 @@ -206,596 +206,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - cable2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= cable2 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/cable3/Makefile b/2013/cable3/Makefile index 280f9baf5..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 @@ -206,596 +206,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - cable3 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= cable3 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/dlowe/Makefile b/2013/dlowe/Makefile index e55b76bbb..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 @@ -202,596 +202,3 @@ magic: deep_magic fi @${TRUE} dlowe: dlowe.c -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - dlowe - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dlowe -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/endoh1/Makefile b/2013/endoh1/Makefile index 7a2ef76a0..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 @@ -208,596 +208,3 @@ magic: deep_magic fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - endoh1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh1 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/endoh2/Makefile b/2013/endoh2/Makefile index fc3240870..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 @@ -217,596 +217,3 @@ magic: deep_magic fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - endoh2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh2 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/endoh3/Makefile b/2013/endoh3/Makefile index 3887753b4..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 @@ -200,596 +200,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - endoh3 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh3 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/endoh4/Makefile b/2013/endoh4/Makefile index 391b7791c..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 @@ -203,596 +203,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - endoh4 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh4 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/hou/Makefile b/2013/hou/Makefile index effd9f557..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 @@ -210,596 +210,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - hou - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hou -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/mills/Makefile b/2013/mills/Makefile index 48f779a15..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 @@ -200,596 +200,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - mills - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mills -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/misaka/Makefile b/2013/misaka/Makefile index 8ab694964..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 @@ -276,596 +276,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - misaka - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= misaka -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/morgan1/Makefile b/2013/morgan1/Makefile index 070f0a030..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - morgan1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= morgan1 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/morgan2/Makefile b/2013/morgan2/Makefile index 6e2db9aea..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 @@ -202,596 +202,3 @@ magic: deep_magic fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - morgan2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= morgan2 -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2013/robison/Makefile b/2013/robison/Makefile index 2be3c6658..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 @@ -200,596 +200,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Paul Erdos!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2013 winning entry - robison - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= robison -PROG= ${ENTRY} -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 3b50f9090..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 @@ -204,596 +204,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - birken - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= birken -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/deak/Makefile b/2014/deak/Makefile index 580a4ff8d..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - deak - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= deak -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/endoh1/Makefile b/2014/endoh1/Makefile index 12e5c6921..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 @@ -206,596 +206,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - endoh1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/endoh2/Makefile b/2014/endoh2/Makefile index 8b6a16c0c..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 @@ -203,596 +203,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - endoh2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/maffiodo1/Makefile b/2014/maffiodo1/Makefile index 3a18f7451..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 @@ -211,596 +211,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - maffiodo1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= maffiodo1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/maffiodo2/Makefile b/2014/maffiodo2/Makefile index 228a3b73c..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 @@ -202,596 +202,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - maffiodo2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= maffiodo2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/morgan/Makefile b/2014/morgan/Makefile index a4f59c042..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 @@ -203,596 +203,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - morgan - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= morgan -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/sinon/Makefile b/2014/sinon/Makefile index 821768a4e..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 @@ -203,596 +203,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - sinon - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= sinon -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/skeggs/Makefile b/2014/skeggs/Makefile index 0ee1c55cb..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 @@ -205,596 +205,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - skeggs - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= skeggs -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/vik/Makefile b/2014/vik/Makefile index 56983c440..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 @@ -201,596 +201,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - vik - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vik -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2014/wiedijk/Makefile b/2014/wiedijk/Makefile index e0d131f72..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 @@ -200,596 +200,3 @@ magic: deep_magic echo "These aren't the primes you're looking for Pauline!"; \ fi @${TRUE} -#!/usr/bin/env make -# -# IOCCC 2014 winning entry - wiedijk - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= wiedijk -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 34e937b88..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 @@ -261,596 +261,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - burton - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= burton -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/dogon/Makefile b/2015/dogon/Makefile index b41f68c6f..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 @@ -260,596 +260,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - dogon - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dogon -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/duble/Makefile b/2015/duble/Makefile index 18675ccd0..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 @@ -257,596 +257,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - duble - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= duble -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/endoh1/Makefile b/2015/endoh1/Makefile index 02b4c33fa..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 @@ -316,596 +316,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - endoh1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/endoh2/Makefile b/2015/endoh2/Makefile index 515f80662..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 @@ -252,596 +252,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - endoh2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/endoh3/Makefile b/2015/endoh3/Makefile index a63982583..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 @@ -252,596 +252,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - endoh3 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh3 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/endoh4/Makefile b/2015/endoh4/Makefile index fec8dfa6c..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 @@ -252,596 +252,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - endoh4 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh4 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/hou/Makefile b/2015/hou/Makefile index 754c34cdb..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 @@ -259,596 +259,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - hou - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hou -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/howe/Makefile b/2015/howe/Makefile index 0872cd8ae..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 @@ -275,596 +275,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - howe - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= howe -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/mills1/Makefile b/2015/mills1/Makefile index f6e061a81..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 @@ -419,596 +419,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - mills1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mills1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/mills2/Makefile b/2015/mills2/Makefile index b8919ebfc..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 @@ -254,596 +254,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - mills2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mills2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/muth/Makefile b/2015/muth/Makefile index ddb6704aa..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 @@ -266,596 +266,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - muth - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= muth -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/schweikhardt/Makefile b/2015/schweikhardt/Makefile index ea38968bf..ef652efff 100644 --- a/2015/schweikhardt/Makefile +++ b/2015/schweikhardt/Makefile @@ -14,7 +14,7 @@ # tool locations ################ # -SHELL= bash +#SHELL= bash CP= cp CPP= cpp GUNZIP= gunzip @@ -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 @@ -252,596 +252,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - schweikhardt - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= schweikhardt -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2015/yang/Makefile b/2015/yang/Makefile index 074422773..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 @@ -279,596 +279,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2015 winning entry - yang - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu11 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= yang -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 a92ae9a6c..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 @@ -284,596 +284,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - algmyr - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= algmyr -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/anderson/Makefile b/2018/anderson/Makefile index 53a39d403..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 @@ -284,596 +284,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - anderson - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= anderson -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/bellard/Makefile b/2018/bellard/Makefile index 6ce2ae7df..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 @@ -285,596 +285,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - bellard - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= bellard -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/burton1/Makefile b/2018/burton1/Makefile index 738afc016..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 @@ -284,596 +284,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - burton1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= burton1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/burton2/Makefile b/2018/burton2/Makefile index f6c57ba74..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 @@ -308,596 +308,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - burton2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= burton2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/ciura/Makefile b/2018/ciura/Makefile index cadc685ee..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 @@ -286,596 +286,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - ciura - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= ciura -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/endoh1/Makefile b/2018/endoh1/Makefile index 8dc5deb3c..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 @@ -284,596 +284,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - endoh1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/endoh2/Makefile b/2018/endoh2/Makefile index f8c6d0e92..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 @@ -306,596 +306,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - endoh2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/ferguson/Makefile b/2018/ferguson/Makefile index b456ff578..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 @@ -299,596 +299,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - ferguson - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= ferguson -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/giles/Makefile b/2018/giles/Makefile index 77b0e5d4c..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 @@ -283,596 +283,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - giles - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= giles -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/hou/Makefile b/2018/hou/Makefile index 35e52068e..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 @@ -285,596 +285,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - hou - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= hou -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/mills/Makefile b/2018/mills/Makefile index 2272b79d1..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 @@ -340,596 +340,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - mills - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mills -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/poikola/Makefile b/2018/poikola/Makefile index 8ca16ade2..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 @@ -294,596 +294,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - poikola - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= poikola -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/vokes/Makefile b/2018/vokes/Makefile index d40bbebfd..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 @@ -282,596 +282,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - vokes - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= vokes -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2018/yang/Makefile b/2018/yang/Makefile index bf8d2d5ac..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 @@ -403,596 +403,3 @@ pluto: supernova @echo dwarf is a type of planet @echo $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2018 winning entry - yang - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= yang -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 6a32b4973..0e4a5be1b 100644 --- a/2019/adamovsky/Makefile +++ b/2019/adamovsky/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -307,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 @@ -325,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 @@ -338,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 @@ -538,596 +536,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - adamovsky - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= adamovsky -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/burton/Makefile b/2019/burton/Makefile index 159d6e5e3..2b2abc0da 100644 --- a/2019/burton/Makefile +++ b/2019/burton/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -307,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 @@ -325,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 @@ -338,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 @@ -538,596 +536,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - burton - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= burton -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/ciura/Makefile b/2019/ciura/Makefile index 4bb65eb51..db91bf1ce 100644 --- a/2019/ciura/Makefile +++ b/2019/ciura/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -308,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 @@ -326,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 @@ -339,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 @@ -526,596 +524,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - ciura - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= ciura -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/diels-grabsch1/Makefile b/2019/diels-grabsch1/Makefile index f375322d3..d7773597e 100644 --- a/2019/diels-grabsch1/Makefile +++ b/2019/diels-grabsch1/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -307,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 @@ -325,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 @@ -338,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 @@ -525,596 +523,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - diels-grabsch1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= diels-grabsch1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/diels-grabsch2/Makefile b/2019/diels-grabsch2/Makefile index 3c6da7930..708091954 100644 --- a/2019/diels-grabsch2/Makefile +++ b/2019/diels-grabsch2/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -306,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 @@ -324,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 @@ -337,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 @@ -524,596 +522,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - diels-grabsch2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= diels-grabsch2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/dogon/Makefile b/2019/dogon/Makefile index b5014a2a5..f69a3b3ec 100644 --- a/2019/dogon/Makefile +++ b/2019/dogon/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -308,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 @@ -328,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 @@ -342,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 @@ -530,596 +528,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - dogon - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= dogon -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/duble/Makefile b/2019/duble/Makefile index ff8c99312..e916ff456 100644 --- a/2019/duble/Makefile +++ b/2019/duble/Makefile @@ -1,3 +1,4 @@ + #!/usr/bin/env make # # 2019 makefile @@ -106,7 +107,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -310,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 @@ -328,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 @@ -341,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 @@ -595,596 +594,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - duble - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= duble -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/endoh/Makefile b/2019/endoh/Makefile index 5551ac41e..96d7ced9a 100644 --- a/2019/endoh/Makefile +++ b/2019/endoh/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -306,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 @@ -324,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 @@ -337,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 @@ -526,596 +524,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - endoh - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/giles/Makefile b/2019/giles/Makefile index 696a0fb82..1c94112b1 100644 --- a/2019/giles/Makefile +++ b/2019/giles/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -307,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 @@ -326,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 @@ -339,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 @@ -526,596 +524,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - giles - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= giles -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/karns/Makefile b/2019/karns/Makefile index f9c9b270d..e1a127351 100644 --- a/2019/karns/Makefile +++ b/2019/karns/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -307,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 @@ -325,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 @@ -338,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 @@ -528,596 +526,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - karns - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= karns -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/lynn/Makefile b/2019/lynn/Makefile index addade73b..ed6a68a10 100644 --- a/2019/lynn/Makefile +++ b/2019/lynn/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -306,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 @@ -325,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 @@ -338,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 @@ -525,596 +523,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - lynn - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= lynn -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/mills/Makefile b/2019/mills/Makefile index fd090f016..d7a7cba6c 100644 --- a/2019/mills/Makefile +++ b/2019/mills/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -307,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 @@ -325,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 @@ -339,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 @@ -707,596 +705,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - mills - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= mills -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/poikola/Makefile b/2019/poikola/Makefile index 355f621ba..8564a35b3 100644 --- a/2019/poikola/Makefile +++ b/2019/poikola/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -308,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 @@ -326,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 @@ -339,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 @@ -529,596 +527,3 @@ pluto: supernova @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - poikola - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= poikola -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2019/yang/Makefile b/2019/yang/Makefile index a2a8f1ad3..708091954 100644 --- a/2019/yang/Makefile +++ b/2019/yang/Makefile @@ -106,7 +106,6 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts -GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -246,7 +245,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -306,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 @@ -324,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 @@ -337,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 @@ -524,596 +522,3 @@ pluto: supernova @echo dwarf is a type of planet @echo therefore, $@ is a planet @echo get used to having lots of planets becasue supernovae can ${MAKE} a lot of them -#!/usr/bin/env make -# -# IOCCC 2019 winning entry - yang - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= yang -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" 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 e51f8f0ea..346e2a909 100644 --- a/2020/burton/Makefile +++ b/2020/burton/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -338,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 @@ -356,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 @@ -369,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 @@ -617,596 +616,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - burton - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= burton -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/carlini/Makefile b/2020/carlini/Makefile index 7061a5032..df3c8c9d9 100644 --- a/2020/carlini/Makefile +++ b/2020/carlini/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -342,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 @@ -360,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 @@ -373,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 @@ -586,596 +585,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - carlini - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= carlini -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/endoh1/Makefile b/2020/endoh1/Makefile index 1727cf635..a61f7caad 100644 --- a/2020/endoh1/Makefile +++ b/2020/endoh1/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -342,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 @@ -360,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 @@ -373,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 @@ -587,596 +586,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - endoh1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/endoh2/Makefile b/2020/endoh2/Makefile index f528a3e7b..cd3a4045a 100644 --- a/2020/endoh2/Makefile +++ b/2020/endoh2/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -343,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 @@ -362,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 @@ -375,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 @@ -588,596 +587,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - endoh2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/endoh3/Makefile b/2020/endoh3/Makefile index 30d0249b1..6c4eb8ac0 100644 --- a/2020/endoh3/Makefile +++ b/2020/endoh3/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -340,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 @@ -358,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 @@ -371,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 @@ -600,596 +599,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - endoh3 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= endoh3 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/ferguson1/Makefile b/2020/ferguson1/Makefile index 59dbee0f6..f236752b1 100644 --- a/2020/ferguson1/Makefile +++ b/2020/ferguson1/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -342,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 @@ -360,7 +359,7 @@ CSTD= -std=c11 # ARCH= -# Defines that are needed to compile +# defines that are needed to compile # #CDEFINE= #CDEFINE= -DIOCCC @@ -368,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 @@ -376,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 @@ -620,596 +619,3 @@ pluto: supernova 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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - ferguson1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= ferguson1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/ferguson2/Makefile b/2020/ferguson2/Makefile index 2b1368279..ae91cfdd9 100644 --- a/2020/ferguson2/Makefile +++ b/2020/ferguson2/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -345,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 @@ -363,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 @@ -377,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 @@ -598,596 +597,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - ferguson2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= ferguson2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/giles/Makefile b/2020/giles/Makefile index ee1635a57..be8a9a1b8 100644 --- a/2020/giles/Makefile +++ b/2020/giles/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -343,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 @@ -362,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 @@ -375,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 @@ -588,596 +587,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - giles - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= giles -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/kurdyukov1/Makefile b/2020/kurdyukov1/Makefile index 085f4e5ef..0117fbd17 100644 --- a/2020/kurdyukov1/Makefile +++ b/2020/kurdyukov1/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -339,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 @@ -357,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 @@ -370,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 @@ -583,596 +582,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - kurdyukov1 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= kurdyukov1 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/kurdyukov2/Makefile b/2020/kurdyukov2/Makefile index 00463d710..1dadb3989 100644 --- a/2020/kurdyukov2/Makefile +++ b/2020/kurdyukov2/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -341,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 @@ -359,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 @@ -372,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 @@ -596,596 +595,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - kurdyukov2 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= kurdyukov2 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/kurdyukov3/Makefile b/2020/kurdyukov3/Makefile index 6134cf478..659bc9e68 100644 --- a/2020/kurdyukov3/Makefile +++ b/2020/kurdyukov3/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -339,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 @@ -357,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 @@ -370,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 @@ -583,596 +582,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - kurdyukov3 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= kurdyukov3 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/kurdyukov4/Makefile b/2020/kurdyukov4/Makefile index ae315b548..52d31d8f4 100644 --- a/2020/kurdyukov4/Makefile +++ b/2020/kurdyukov4/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -340,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 @@ -358,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 @@ -371,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 @@ -585,596 +584,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - kurdyukov4 - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= kurdyukov4 -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/otterness/Makefile b/2020/otterness/Makefile index fa9e5c731..a3f33a233 100644 --- a/2020/otterness/Makefile +++ b/2020/otterness/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -341,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 @@ -360,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 @@ -373,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 @@ -586,596 +585,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - otterness - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= otterness -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/tsoj/Makefile b/2020/tsoj/Makefile index 535fd1370..ff1da962b 100644 --- a/2020/tsoj/Makefile +++ b/2020/tsoj/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -345,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 @@ -364,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 @@ -377,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 @@ -590,596 +589,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - tsoj - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= tsoj -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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" diff --git a/2020/yang/Makefile b/2020/yang/Makefile index fd86a719f..6e1c7392e 100644 --- a/2020/yang/Makefile +++ b/2020/yang/Makefile @@ -246,7 +246,6 @@ W= w WAIT4PATH= wait4path WAIT= wait WC= wc -WGET= wget WHAT= what WHATIS= whatis WHICH= which @@ -341,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 @@ -359,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 @@ -372,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 @@ -585,596 +584,3 @@ pluto: supernova @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 -#!/usr/bin/env make -# -# IOCCC 2020 winning entry - yang - -################################################################################ -# -# 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/ - - -############################# -# shell used by this Makefile -############################# -# -SHELL= bash - -####################### -# common tool locations -####################### -# -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 - -# Common C compiler warnings to silence -# -CSILENCE= -#CSILENCE= -Wno-implicit-int - -# Common C compiler warning flags -# -#CWARN= ${CSILENCE} -#CWARN= -Wall ${CSILENCE} -#CWARN= -Wall -Wextra ${CSILENCE} -CWARN= -Wall -Wextra -pedantic ${CSILENCE} - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu17 - -# 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 - -# 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 - -# C compiler to use -# -CC= cc -#CC=clang -#CC=gcc - -# Compiler add-ons or replacements for clang only -# -ifeq ($(CC),clang) -# -#CSILENCE+= -# -CWARN+= -Weverything -# -endif - -# Specific add-ons or replacements for gcc only -# -ifeq ($(CC),gcc) -# -#CSILENCE+= -# -#CWARN+= -# -endif - - -############################## -# Special flags for this entry -############################## -# -ENTRY= yang -PROG= prog -# -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; \ - fi - -clobber: clean - ${RM} -f ${TARGET} ${ALT_TARGET} - @-if [ -e sandwich ]; then \ - ${RM} -f sandwich; \ - echo 'ate sandwich'; \ - fi - -install: - @echo "Dr. Spock says that is not logical!" - @${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"