fix 1992 Makefiles and update README.md files

This commit is contained in:
Landon Curt Noll committed 2023-02-22 01:24:18 -08:00
1 parent 2f425d38e6
commit 79c7f3d1a0
33 files changed
+7477 -2751

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@
# tool locations # tool locations
################ ################
# #
SHELL= /bin/bash SHELL= bash
MAKE= make MAKE= make
+11
View File
@@ -1 +1,12 @@
adbasename
adbasename.c
adecho
adecho.c
adgrep
adhead
adhead.c
adrian adrian
adsleep
adsleep.c
adwc
adwc.c
+588 -211
View File
@@ -1,244 +1,621 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - adrian
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit #
# use is granted provided this this copyright and notice are included in its # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# entirety and remains unaltered. All other uses must receive prior permission # year directory was reworked so that entries are in separate directories.
# from Landon Curt Noll and Larry Bassel. # 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=/bin/sh #############################
CHMOD=chmod # shell used by this Makefile
CP=cp #############################
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: SHELL= bash
# CPP=/lib/cpp
#
CPP=/usr/ccs/lib/acpp
# flags for ansi compiles #######################
# common tool locations
#######################
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, A2P= a2p
# others such as gcc may want -ansi, others may want nothing AR= ar
# at all. Adjust the CFLAGS line as needed. ASA= asa
# AT= at
# NOTE: Some compilers cannot optimize, or optimize some entries ATQ= atq
# entries incorrectly. You might want need to turn on -O ATRM= atrm
# to see if your compiler can handle them. AWK= awk
# BANNER= banner
#CFLAGS=-O -Xa BASE64= base64
CFLAGS=-Xa BASENAME= basename
CC=cc BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# misc shell babble # Set X11_LIBDIR to the directory where the X11 library resides
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' #X11_LIBDIR= /usr/X11R6/lib
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g' #X11_LIBDIR= /usr/X11/lib
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*' X11_LIBDIR= /opt/X11/lib
# winners that compile under ANSI C # Set X11_INCLUDEDIR to the directory where the X11 include files reside
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ #X11_INCDIR= /usr/X11R6/include
lush marangon nathan vern westley #X11_INCDIR= /usr/X11/include
ALT_NAMES= adgrep am babble first ag whereami X11_INCDIR= /opt/X11/include
all: $(WINNERS) $(ALT_NAMES) # Common C compiler warnings to silence
#
#CSILENCE=
CSILENCE= -Wno-bitwise-op-parentheses -Wno-comment -Wno-deprecated-declarations \
-Wno-error -Wno-implicit-function-declaration -Wno-format-security \
-Wno-logical-op-parentheses -Wno-macro-redefined -Wno-parentheses \
-Wno-return-type -Wno-uninitialized -Wno-unused-value -Wno-unused-variable \
-Wno-unused-but-set-variable -Wno-unsequenced -Wno-unused-parameter
adrian: adrian.c # Common C compiler warning flags
$(CC) $(CFLAGS) adrian.c -o adrian #
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c #CWARN= ${CSILENCE}
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp #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+= -Wno-comma -Wno-float-conversion -Wno-missing-noreturn \
-Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-padded \
-Wno-poison-system-directories -Wno-shadow -Wno-unreachable-code \
-Wno-unused-macros
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= adrian
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}
${RM} -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
${SED} '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c -./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c ${CC} ${CFLAGS} -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp ${SED} '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c -./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c ${CC} ${CFLAGS} -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp ${SED} '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c -./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c ${CC} ${CFLAGS} -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp ${SED} '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c -./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c ${CC} ${CFLAGS} -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp ${SED} '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c -./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c ${CC} ${CFLAGS} -o adsleep adsleep.c
$(RM) -f ad.temp ${RM} -f ad.temp
# NOTE: this is the original source that won adgrep: ${PROG}
${RM} -f $@
${LN} $< $@
# alternative executable
# #
adrian.orig: adrian.orig.c alt: data ${ALT_TARGET}
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig @${TRUE}
albert: albert.c # data files
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c data: ${DATA}
$(CC) $(CFLAGS) albert.orig.c -o albert.orig @${TRUE}
ant: ant.c # both all and alt
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c everything: all alt
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need: ###############
# utility rules
###############
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11
#
kivinen: kivinen.c
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#
# NOTE: some systems may only need:
#
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11
#
kivinen.orig: kivinen.orig.c
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \
-lsocket -lresolv -lnsl
imc: imc.c
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
#
imc.orig: imc.orig.c
$(CC) $(CFLAGS) imc.orig.c -o imc.orig
lush: lush.c
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
#
lush.orig: lush.orig.c
$(CC) $(CFLAGS) lush.orig.c -o lush.orig
# NOTE: some systems may need:
#
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap
#
marangon: marangon.c
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses
# NOTE: this is the original program that won
#
# NOTE: some systems may need:
#
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap
#
marangon.orig: marangon.orig.c
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
#
nathan.orig: nathan.orig.c
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
#
vern.orig: vern.orig.tmp.c
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig
vern.orig.tmp.c: vern.orig.c
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
#
adgrep: adrian
$(RM) -f adgrep
$(LN) adrian adgrep
am: ant
$(RM) -f am
$(LN) ant am
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+12 -11
View File
@@ -1,4 +1,4 @@
Most Educational: # Most Educational:
Adrian Mariano Adrian Mariano
University of Washington University of Washington
@@ -6,25 +6,26 @@ Most Educational:
Mercer Island, WA 98040 Mercer Island, WA 98040
USA USA
## To build:
Judges' comments: make all
To build: ### To run
make adrian
Try: ./adrian adrian.grep.try < adrian.hint
adrian adrian.grep.try < adrian.hint
For the slow minded, try:
For the slow minded, try:
adsleep 32767 ./adsleep 32767
## Judges' comments
Once you get past the obfuscation, you have an opportunity to learn Once you get past the obfuscation, you have an opportunity to learn
about regular expressions and state machines. about regular expressions and state machines.
NOTE: Some compilers have had trouble optimizing this entry. NOTE: Some compilers have had trouble optimizing this entry.
## Author's comments
Selected notes from the author:
ADrian's GREP (adgrep) ADrian's GREP (adgrep)
+551 -202
View File
@@ -1,244 +1,593 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - albert
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-unused-parameter
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-poison-system-directories -Wno-shorten-64-to-32
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= albert
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: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+9 -7
View File
@@ -1,4 +1,4 @@
Most Useful Program: # Most Useful Program:
Albert van der Horst Albert van der Horst
S P&A R&C S P&A R&C
@@ -6,19 +6,21 @@ Most Useful Program:
3511 RA UTRECHT 3511 RA UTRECHT
The Netherlands The Netherlands
## To build:
Judges' comments: make all
For a canned example: ### To run
make albert
albert 1234567890123456789 ./albert 1234567890123456789
## Judges' comments
We were impressed with the speed at which it was able to factor We were impressed with the speed at which it was able to factor
arbitrarily large numbers consisting of factors that fit into arbitrarily large numbers consisting of factors that fit into
a long. a long.
## Author's comments
Selected notes from the author:
The Obfuscated version of the Horst algorithm. The Obfuscated version of the Horst algorithm.
+2
View File
@@ -1 +1,3 @@
am
am.safe
ant ant
+564 -201
View File
@@ -1,244 +1,607 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - ant
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-unsequenced
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-conditional-uninitialized -Wno-implicit-int-conversion \
-Wno-missing-prototypes -Wno-missing-variable-declarations \
-Wno-poison-system-directories -Wno-shadow -Wno-shorten-64-to-32 \
-Wno-sign-conversion -Wno-strict-prototypes
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= ant
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 \
am am_clobber \
supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
am: ${PROG}
${RM} -f $@
${LN} $< $@
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am am_clobber: clean am
$(RM) -f am.safe ${RM} -f am.safe
$(CP) am am.safe ${CP} am am.safe
$(RM) -f $(WINNERS) a.out ${CP} am.safe am
$(RM) -f $(ALT_NAMES) ${RM} -f am.safe
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber install:
@true @echo "Dr. Spock says that is not logical!"
@${TRUE}
install: all # you may be able to misunderstand the source by reading indent.c
cat $(WINNERS) > /dev/null #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+13 -10
View File
@@ -1,4 +1,4 @@
Best Utility: # Best Utility:
Anthony C Howe Anthony C Howe
Mortice Kern Systems Inc. Mortice Kern Systems Inc.
@@ -7,13 +7,16 @@ Best Utility:
N2J 3G4 N2J 3G4
Canada Canada
## To build:
Judges' comments: make all
### To run
./am ant.test.mk
## Judges' comments
To use:
make am
am ant.test.mk
Like much of Posix, obfuscation has its place. Your task is to Like much of Posix, obfuscation has its place. Your task is to
figure out where. figure out where.
@@ -22,12 +25,12 @@ Judges' comments:
P1003 sub-committee. P1003 sub-committee.
We also suggest that you try: We also suggest that you try:
make am make am
am Makefile am_clobber <-- clobber everything except am ./am Makefile am_clobber # clobber everything except am
am Makefile all ./am Makefile all
## Author's comments
Selected notes from the author:
See the file ant.README. See the file ant.README.
+3
View File
@@ -1 +1,4 @@
babble
babble.cppcb
buzzard.1 buzzard.1
tmp
+587 -202
View File
@@ -1,244 +1,629 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - buzzard.1
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pedantic \
-Wno-unused-parameter
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
CWARN= -Wall -Wextra ${CSILENCE}
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-missing-variable-declarations -Wno-poison-system-directories \
-Wno-unused-macros
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= buzzard.1
PROG= ${ENTRY}
#
OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
NOINCLUDE= ${SED} -e 's/^.\([ ]*\)include/%include/'
SPACECLEAN= ${SED} -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN= ${GREP} -v '^. [0-9][0-9]*'
#################
# 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}
babble.cppcb: ${PROG}.c
${RM} -f tmp
${NOINCLUDE} ${PROG}.c | \
${CPP} ${CPPFLAGS} | \
${CPPCLEAN} | \
${UNIQ} | \
${SPACECLEAN} > tmp 2>&1
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < tmp > $@"; \
${GINDENT} < tmp > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < tmp > $@; \
else \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${MV} -f tmpbabble.cppcb $@"; \
${MV} -f tmp $@; \
fi
${RM} -f tmp
babble: ${PROG}
${RM} -f $@
${LN} $< $@
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) ${RM} -f babble.cppcb babble
$(RM) -f adwc adbasename adecho adhead adsleep @-if [ -e sandwich ]; then \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig ${RM} -f sandwich; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig echo 'ate sandwich'; \
fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+13 -11
View File
@@ -7,24 +7,26 @@ Most Obfuscated Algorithm:
USA USA
Judges' comments: ## To build:
make all
### To run
./babble 0 10
./babble 56 720
./babble 1 521
## Judges' comments
To see clearly why this won an award:
make babble
Try:
babble 0 10
babble 56 720
babble 1 521
To see good C Preprocessor babble, try: To see good C Preprocessor babble, try:
make babble.cppcb make babble.cppcb
cat babble.cppcb cat babble.cppcb
Notice how many statements it takes to do anything useful? Notice how many statements it takes to do anything useful?
## Author's comments
Selected notes from the author:
What you shouldn't think about babble: What you shouldn't think about babble:
+1
View File
@@ -1 +1,2 @@
buzzard.2 buzzard.2
first
+558 -202
View File
@@ -1,244 +1,600 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - buzzard.2
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pedantic \
-Wno-return-type
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \
-Wno-poison-system-directories -Wno-strict-prototypes -Wno-unreachable-code
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= buzzard.2
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}
first: ${PROG}
${RM} -f $@
${LN} $< $@
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) ${RM} -f first
$(RM) -f adwc adbasename adecho adhead adsleep @-if [ -e sandwich ]; then \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig ${RM} -f sandwich; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig echo 'ate sandwich'; \
fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+23 -13
View File
@@ -1,4 +1,4 @@
Best Language Tool: # Best Language Tool:
Sean Barrett Sean Barrett
Software Construction Company Software Construction Company
@@ -6,27 +6,37 @@ Best Language Tool:
College Station, TX 77840 College Station, TX 77840
USA USA
## To build:
Judges' comments: make all
### To run
First: First:
make first
Second:
echo help | cat third help.th - | first
cat third demo5.th | first
Third:
cat third help.th - | first
Wait until Ok is printed and the type: make first
Second:
echo help | cat third help.th - | ./first
cat third demo5.th | ./first
Third:
cat third help.th - | ./first
NOTE: Wait until Ok is printed and the type:
2 3 + . cr <-- yes you should really type the 2 letters: cr 2 3 + . cr <-- yes you should really type the 2 letters: cr
Forth: Forth:
Sorry, this is third! Sorry, this is third!
## Judges' comments
Selected notes from the author: Have fun!
## Author's comments
What it does: What it does:
@@ -116,7 +126,7 @@ Selected notes from the author:
it also obfuscates the code. (Unfortunately, the top of stack it also obfuscates the code. (Unfortunately, the top of stack
is a global variable and neither gcc nor most bundled compilers is a global variable and neither gcc nor most bundled compilers
seem to register allocate it.) seem to register allocate it.)
More significant are the design obfuscations. m[0] is the More significant are the design obfuscations. m[0] is the
"dictionary pointer", used when compiling words, and m[1] is "dictionary pointer", used when compiling words, and m[1] is
the return stack index. Both are used as integer offsets into the return stack index. Both are used as integer offsets into
+1
View File
@@ -1 +1,2 @@
gson gson
og
+561 -202
View File
@@ -1,244 +1,603 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - gson
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-bitwise-op-parentheses -Wno-char-subscripts \
-Wno-deprecated-declarations -Wno-empty-body -Wno-error \
-Wno-implicit-function-declaration -Wno-parentheses -Wno-pedantic \
-Wno-return-type -Wno-unused-parameter -Wno-unused-value
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-prototypes \
-Wno-missing-variable-declarations -Wno-poison-system-directories \
-Wno-shorten-64-to-32 -Wno-strict-prototypes
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= gson
PROG= ${ENTRY}
#
OBJ= ${PROG}.o
DATA=
TARGET= ${PROG} og
#
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}
og: ${PROG}
${RM} -f $@
${LN} $< $@
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) ${RM} -f og
$(RM) -f adwc adbasename adecho adhead adsleep @-if [ -e sandwich ]; then \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig ${RM} -f sandwich; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig echo 'ate sandwich'; \
fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+21 -18
View File
@@ -1,4 +1,4 @@
Most Humorous Output: # Most Humorous Output:
Andreas Gustafsson Andreas Gustafsson
Helsinki University of Technology Helsinki University of Technology
@@ -6,36 +6,39 @@ Most Humorous Output:
00410 Helsinki 00410 Helsinki
FINLAND FINLAND
## To build:
Judges' comments: make all
### To run
./og word word2 word3 < /path/to/dictionary
## Judges' comment
To make:
make ag
Determine where your system dictionary is located. You may find Determine where your system dictionary is located. You may find
it located in one of the following places: it located in one of the following places:
/usr/dict/words /usr/share/dict/words
/usr/share/lib/spell/words /usr/share/lib/spell/words
/usr/ucblib/dict/words /usr/ucblib/dict/words
/dev/null <-- for machines with nothing to say /dev/null # <-- for machines with nothing to say
Then using the proper dictionary: Then using the proper dictionary:
ag free software foundation < /usr/dict/words ./ag free software foundation < /usr/share/dict/words
ag obfuscated c contest < /usr/dict/words ./ag obfuscated c contest < /usr/share/dict/words
ag unix international < /usr/dict/words ./ag unix international < /usr/share/dict/words
ag george bush < /usr/dict/words ./ag george bush < /usr/share/dict/words
ag bill clinton < /usr/dict/words ./ag bill clinton < /usr/share/dict/words
ag ross perot < /usr/dict/words ./ag ross perot < /usr/share/dict/words
ag paul e tsongas < /usr/dict/words ./ag paul e tsongas < /usr/share/dict/words
Recently some newspapers printed amusing anagrams of one of the Recently some newspapers printed amusing anagrams of one of the
names listed above. Run this program to find the anagrams they names listed above. Run this program to find the anagrams they
weren't allowed to print! weren't allowed to print!
## Author's comments
Selected notes from the author:
The name of the game: The name of the game:
+553 -202
View File
@@ -1,244 +1,595 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - imc
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-format
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-error -Wno-implicit-function-declaration -Wno-format \
-Wno-missing-variable-declarations -Wno-poison-system-directorie \
-Wno-poison-system-directories -Wno-unknown-warning-option
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= imc
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: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+9 -7
View File
@@ -1,4 +1,4 @@
Best Output: $ Best Output:
Ian Collier Ian Collier
Oxford University Oxford University
@@ -8,10 +8,13 @@ Best Output:
OX1 4AW OX1 4AW
ENGLAND ENGLAND
## To build:
Judges' comments: make all
Make and run. ### To run
## Judges' comments
The program is more interesting to run on workstations that can The program is more interesting to run on workstations that can
make use of a Sun raster file. Others can make use of the -text make use of a Sun raster file. Others can make use of the -text
@@ -19,13 +22,12 @@ Judges' comments:
Of course, the source (layout) is self-documenting! :-) Of course, the source (layout) is self-documenting! :-)
NOTE: The original winning source imc.orig.c assumed that NOTE: The original winning source assumed that
exit returned a value which cause problems for some exit returned a value which cause problems for some
systems where exit returned a void. The file imc.c systems where exit returned a void. The file imc.c
avoids this problem. has been modified to avoid this problem.
## Author's comments
Selected notes from the author:
Portability Portability
+1 -2
View File
@@ -1,5 +1,4 @@
#include <stdio.h> #include <stdio.h>
#include <malloc.h>
#define ext(a) (exit(a),0) #define ext(a) (exit(a),0)
#define I " .:\';+<?F7RQ&%#*" #define I " .:\';+<?F7RQ&%#*"
#define a "%s?\n" #define a "%s?\n"
@@ -29,7 +28,7 @@
=128,K=1,V,B=0,Y,m=128,p=0,N =128,K=1,V,B=0,Y,m=128,p=0,N
=768,U=768,h[]={0x59A66A95,256 =768,U=768,h[]={0x59A66A95,256
,192,1,6912,1,0,0},t,A=0,W=0,Z=63,X=23 ,192,1,6912,1,0,0},t,A=0,W=0,Z=63,X=23
;o*J,_;main(c,v)l c;o**v;{l q=1;for(;;q< ;o*J,_;main(c,v)int c;o**v;{l q=1;for(;;q<
c ?(((J=v[q])[0]&&J[0]<48&&J++,((_= *J)<99|| c ?(((J=v[q])[0]&&J[0]<48&&J++,((_= *J)<99||
_/2== '2'||(_-1)/3=='\"'||_==107||_/05*2==','||_ _/2== '2'||(_-1)/3=='\"'||_==107||_/05*2==','||_
>0x074)?( fprintf(i,a,v[q]),r):_>0152?(_/4>27?(_&1?( >0x074)?( fprintf(i,a,v[q]),r):_>0152?(_/4>27?(_&1?(
+553 -202
View File
@@ -1,244 +1,595 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - kivinen
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \
-Wno-logical-op-parentheses -Wno-main -Wno-variadic-macros
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian #CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am CINCLUDE= -I ${HOMEBREW_PREFIX}/include
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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 -lresolv
LIBS= -L ${HOMEBREW_PREFIX}/lib -lX11 -lresolv
# C compiler to use
#
CC= cc
#CC=clang
#CC=gcc
# Compiler add-ons or replacements for clang only
#
ifeq ($(CC),clang)
#
CSILENCE+= -Wno-poison-system-directories -Wno-comma \
-Wno-conditional-uninitialized -Wno-sign-conversion
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= kivinen
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: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+558 -202
View File
@@ -1,244 +1,600 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - lush
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-macro-redefined
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-comma -Wno-missing-variable-declarations \
-Wno-poison-system-directories -Wno-unused-macros
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= lush
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
@echo "NOTE: This entry requires a non-standard K&R C compiler to compile."
${CC} ${CFLAGS} $< -o $@ ${LIBS}
lush.again: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
${RM} -f $@
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c ${RM} -f lush.again
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c @-if [ -f indent.c ]; then \
echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+11 -11
View File
@@ -1,27 +1,27 @@
Worst Abuse of the C Preprocessor: # Worst Abuse of the C Preprocessor:
Ed Luke Ed Luke
Mississippi State University Mississippi State University
P.O. Box 6176 P.O. Box 6176
Mississippi State, MS 39762, USA Mississippi State, MS 39762, USA
## To build:
Judges' comments: make all
To setup: ### To run
make lush
make lush.again 2>&1 | ./lush
Try:
make lush.again 2>&1 | lush (sh or ksh users) NOTE: This entry requires a non-standard K&R C compiler to compile.
or:
make lush.again |& lush (csh users) ## Judges' comments
The program uses error messages issued by the C Proproessor to The program uses error messages issued by the C Proproessor to
generate its message to the world. One program's error is another generate its message to the world. One program's error is another
program's data! program's data!
## Author's comments
Selected notes from the author:
This program is yet another "Hello World." program with a twist. The This program is yet another "Hello World." program with a twist. The
string Hello World has been encoded in the error messages the compiler string Hello World has been encoded in the error messages the compiler
+555 -202
View File
@@ -1,244 +1,597 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - marangon
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \
-Wno-logical-op-parentheses -Wno-main-return-type -Wno-missing-braces \
-Wno-parentheses -Wno-return-type -Wno-tautological-bitwise-compare \
-Wno-unsequenced
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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= -lcurses
#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+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \
-Wno-poison-system-directories -Wno-strict-prototypes -Wno-unreachable-code
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= marangon
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: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+9 -5
View File
@@ -1,4 +1,4 @@
Best Game: # Best Game:
Marangoni Andrea Marangoni Andrea
Department of Computer Science at Milano Department of Computer Science at Milano
@@ -6,10 +6,15 @@ Best Game:
62014 Corridonia (MC) 62014 Corridonia (MC)
Italy Italy
## To build:
Judges' comments: make all
Make and run. ### To run
./marangon
## Judges' comments
The object is to refill the table with 5's, by incrementing The object is to refill the table with 5's, by incrementing
or decrementing numbers as needed. It is the side effects or decrementing numbers as needed. It is the side effects
@@ -25,8 +30,7 @@ Judges' comments:
systems where exit returned a void. The file marangon.c systems where exit returned a void. The file marangon.c
avoids this problem. avoids this problem.
## Author's comments
Selected notes from the author:
It starts off by creating a table with number 5 in all places. The It starts off by creating a table with number 5 in all places. The
CPU melts the numbers and you must return them in original state. CPU melts the numbers and you must return them in original state.
+551 -202
View File
@@ -1,244 +1,593 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - nathan
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig #CSILENCE= -Wno-implicit-int
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-poison-system-directories
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= nathan
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: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) @-if [ -e sandwich ]; then \
$(RM) -f adwc adbasename adecho adhead adsleep ${RM} -f sandwich; \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig echo 'ate sandwich'; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+11 -6
View File
@@ -1,4 +1,4 @@
Worst Abuse of the Rules: # Worst Abuse of the Rules:
Nathan Sidwell Nathan Sidwell
Inmos UK Inmos UK
@@ -7,8 +7,15 @@ Worst Abuse of the Rules:
Bristol Bristol
UK BS12 4SQ UK BS12 4SQ
## To build:
Judges' comments: make all
### To run
./nathan
## Judges' comments
The US International Traffic in Arms Regulations controls certain The US International Traffic in Arms Regulations controls certain
exportations going out of the United States. The U.S. Munitions exportations going out of the United States. The U.S. Munitions
@@ -54,8 +61,7 @@ Judges' comments:
rules entries are ones that tend to 'streach' the limits and rules entries are ones that tend to 'streach' the limits and
take the contest into unexpected territory. take the contest into unexpected territory.
### Personal note from chongo:
Personal note from chongo:
I think this situation shows just how ridiculous US crypto I think this situation shows just how ridiculous US crypto
regulations really are. Certain US federal officials can get away regulations really are. Certain US federal officials can get away
@@ -63,8 +69,7 @@ Personal note from chongo:
laws, but I personally can't re-distribute a program contest winner laws, but I personally can't re-distribute a program contest winner
to the network! to the network!
## Author's comments
Selected notes from the author:
PROGRAM USE PROGRAM USE
+1
View File
@@ -1 +1,2 @@
vern vern
vern.tmp.c
+561 -202
View File
@@ -1,244 +1,603 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - vern
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-bitwise-conditional-parentheses -Wno-dangling-else -Wno-error \
-Wno-implicit-function-declaration -Wno-parentheses -Wno-pedantic \
-Wno-return-type -Wno-shift-op-parentheses
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-comma -Wno-float-conversion -Wno-missing-prototypes \
-Wno-missing-variable-declarations -Wno-poison-system-directories \
-Wno-shadow -Wno-strict-prototypes
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= vern
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}.tmp.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
${PROG}.tmp.c: ${PROG}.c
${RM} -f $@
${SED} <${PROG}.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
${SED} 's/} /=/g;s/{ /i/g' >$@
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) ${RM} -f ${PROG}.tmp.c
$(RM) -f adwc adbasename adecho adhead adsleep @-if [ -e sandwich ]; then \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig ${RM} -f sandwich; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig echo 'ate sandwich'; \
fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+13 -9
View File
@@ -1,4 +1,4 @@
Best of Show: # Best of Show:
Vern Paxson Vern Paxson
Lawrence Berkeley Laboratory Lawrence Berkeley Laboratory
@@ -8,24 +8,29 @@ Best of Show:
1 Cyclotron Rd. 1 Cyclotron Rd.
Berkeley, CA 94720 USA Berkeley, CA 94720 USA
## To build:
Judges' comments: make all
Try: ### To run
make vern
vern 3 <-- default is 2 ./vern 3 # <-- default is 2
## Judges' comments
You might start off by giving the following input: You might start off by giving the following input:
63 43 63 43
76 55 76 55
71 52 71 52
67 57 (this may take a while) 67 57 (this may take a while)
The judges assume no responsibility for the obfuscated opening The judges assume no responsibility for the obfuscated opening
suggested above. :-) suggested above. :-)
For a real quick game try: For a real quick game try:
vern
./vern
65 55 65 55
66 46 66 46
@@ -35,8 +40,7 @@ Judges' comments:
NOTE: Because some mailers have problems with the original winning source, NOTE: Because some mailers have problems with the original winning source,
a slightly modified version with shorter lines has been provided. a slightly modified version with shorter lines has been provided.
## Author's comments
Selected notes from the author:
This program plays chess. You play the white pieces and the program This program plays chess. You play the white pieces and the program
the black pieces. Moves are entered as a two-digit number specifying the black pieces. Moves are entered as a two-digit number specifying
+558 -202
View File
@@ -1,244 +1,600 @@
# %W% %G% %U% #!/usr/bin/env make
# #
# 1992 makefile # IOCCC 1992 winning entry - westley
################################################################################
# #
# Copyright (c) 1992, Landon Curt Noll & Larry Bassel. # An Historical Makefile NOTE:
# All Rights Reserved. Permission for personal, educational or non-profit
# use is granted provided this this copyright and notice are included in its
# entirety and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
CHMOD=chmod
CP=cp
RM=rm
SED=sed
LN=ln
UNIQ=uniq
CB=cb
GREP=grep
# set this to where your C Processor resides
# #
# On some systems: # The orig.Makefile, if it exits, is the original Makefile before this IOCCC
# CPP=/lib/cpp # year directory was reworked so that entries are in separate directories.
# This also applies to any orig.ansi.mk and orig.common.mk files.
# #
CPP=/usr/ccs/lib/acpp # Several Makefiles were modified / formed in 2022, and as such it may have
# elements that are not historically compatible with way entries were built.
# flags for ansi compiles # The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
# #
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode, # Regarding individual entries:
# 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 # IOCCC winning entry code may not work on your system. Even with standards,
# entries incorrectly. You might want need to turn on -O # conditions and build environments change, especially when it comes to more
# to see if your compiler can handle them. # extreme code such you might find in an IOCCC winner. Moreover, what was
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
# later IOCCC years.
# #
#CFLAGS=-O -Xa # Corrections on winning author and fixing typos in remarks are VERY WELCOME.
CFLAGS=-Xa
CC=cc
# misc shell babble
# #
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/' # GitHub pull requests are welcome:
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
# winners that compile under ANSI C
# #
WINNERS= adrian albert ant buzzard.1 buzzard.2 gson kivinen imc \ # If you have a patch that might make running an entry work in modern Unix-like
lush marangon nathan vern westley # environments, please create a GitHub pull request for the IOCCC judges to
ALT_NAMES= adgrep am babble first ag whereami # consider.
all: $(WINNERS) $(ALT_NAMES)
adrian: adrian.c
$(CC) $(CFLAGS) adrian.c -o adrian
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
$(SED) '1s/\..*\./. wc ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adwc.c
$(CC) -o adwc adwc.c
$(SED) '1s/\..*\./. basename ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adbasename.c
$(CC) -o adbasename adbasename.c
$(SED) '1s/\..*\./. echo| ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adecho.c
$(CC) -o adecho adecho.c
$(SED) '1s/\..*\./. head; ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adhead.c
$(CC) -o adhead adhead.c
$(SED) '1s/\..*\./. sleep ./' adrian.c > ad.temp
-./adrian ad.temp <ad.temp >adsleep.c
$(CC) -o adsleep adsleep.c
$(RM) -f ad.temp
# NOTE: this is the original source that won
# #
adrian.orig: adrian.orig.c # Suggestions and corrections regarding Makefiles, winning author information,
$(CC) $(CFLAGS) adrian.orig.c -o adrian.orig # fixing typos in remarks, and code patches are welcome via opening a GitHub
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
albert: albert.c # to consider. To form a GitHub issue or GitHub pull, please visit:
$(CC) $(CFLAGS) albert.c -o albert
# NOTE: this is the original source that won
# #
albert.orig: albert.orig.c # https://github.com/ioccc-src/winner
$(CC) $(CFLAGS) albert.orig.c -o albert.orig
ant: ant.c
$(CC) $(CFLAGS) ant.c -o ant
buzzard.1: buzzard.1.c
$(CC) $(CFLAGS) buzzard.1.c -o buzzard.1
babble.cppcb: buzzard.1.c
$(NOINCLUDE) buzzard.1.c | \
$(CPP) $(CPPFLAGS) | \
$(CPPCLEAN) | \
$(CB) $(CBFLAGS) | \
$(UNIQ) | \
$(SPACECLEAN) > babble.cppcb 2>&1
buzzard.2: buzzard.2.c
$(CC) $(CFLAGS) buzzard.2.c -o buzzard.2
# NOTE: this is the original source that won
# #
buzzard.2.orig: buzzard.2.orig.c ################################################################################
$(CC) $(CFLAGS) buzzard.2.orig.c -o buzzard.2.orig
gson: gson.c # This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
$(CC) $(CFLAGS) gson.c -o gson
# NOTE: some systems may only need:
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 # Creative Commons Attribution-ShareAlike 3.0 Unported License.
# #
kivinen: kivinen.c # See: http://creativecommons.org/licenses/by-sa/3.0/
$(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 -lsocket -lresolv -lnsl
# NOTE: this is the original program that won
#############################
# shell used by this Makefile
#############################
# #
# NOTE: some systems may only need: SHELL= bash
#######################
# common tool locations
#######################
# #
# $(CC) $(CFLAGS) kivinen.c -o kivinen -lX11 A2P= a2p
AR= ar
ASA= asa
AT= at
ATQ= atq
ATRM= atrm
AWK= awk
BANNER= banner
BASE64= base64
BASENAME= basename
BATCH= batch
BC= bc
BINHEX= binhex
BISON= bison
BUNZIP2= bunzip2
BZCAT= bzcat
BZCMP= bzcmp
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
# #
kivinen.orig: kivinen.orig.c #X11_LIBDIR= /usr/X11R6/lib
$(CC) $(CFLAGS) kivinen.orig.c -o kivinen.orig -lX11 \ #X11_LIBDIR= /usr/X11/lib
-lsocket -lresolv -lnsl X11_LIBDIR= /opt/X11/lib
imc: imc.c # Set X11_INCLUDEDIR to the directory where the X11 include files reside
$(CC) $(CFLAGS) imc.c -o imc
# NOTE: this is the original program that won
# #
imc.orig: imc.orig.c #X11_INCDIR= /usr/X11R6/include
$(CC) $(CFLAGS) imc.orig.c -o imc.orig #X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
lush: lush.c # Common C compiler warnings to silence
$(CC) $(CFLAGS) lush.c -o lush
lush.again: lush.c
$(CC) $(CFLAGS) lush.c -o lush.again
$(RM) -f lush.again
# NOTE: this is the original program that won
# #
lush.orig: lush.orig.c #CSILENCE=
$(CC) $(CFLAGS) lush.orig.c -o lush.orig CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \
-Wno-parentheses -Wno-pedantic
# NOTE: some systems may need: # Common C compiler warning flags
# #
# $(CC) $(CFLAGS) marangon.c -o marangon -lcurses -ltermcap #CWARN= ${CSILENCE}
#CWARN= -Wall ${CSILENCE}
#CWARN= -Wall -Wextra ${CSILENCE}
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
# Compiler standard
# #
marangon: marangon.c #CSTD=
$(CC) $(CFLAGS) marangon.c -o marangon -lcurses #CSTD= -ansi
CSTD= -std=gnu90
# NOTE: this is the original program that won # Compiler bit architecture
# #
# NOTE: some systems may need: # Some entries require 32-bitness:
# ARCH= -m32
# #
# $(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses -ltermcap # Some entries require 64-bitness:
# ARCH= -m64
# #
marangon.orig: marangon.orig.c # By default we assume nothing:
$(CC) $(CFLAGS) marangon.orig.c -o marangon.orig -lcurses
nathan: nathan.c
$(CC) $(CFLAGS) nathan.c -o nathan
# NOTE: this is the original program that won
# #
nathan.orig: nathan.orig.c ARCH=
$(CC) $(CFLAGS) nathan.orig.c -o nathan.orig
vern: vern.tmp.c # Defines that are needed to compile
$(CC) $(CFLAGS) vern.tmp.c -o vern
vern.tmp.c: vern.c
$(RM) -f vern.tmp.c
$(SED) <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.tmp.c
# NOTE: this is the original program that won
# #
vern.orig: vern.orig.tmp.c CDEFINE=
$(CC) $(CFLAGS) vern.orig.tmp.c -o vern.orig #CDEFINE= -DIOCCC
vern.orig.tmp.c: vern.orig.c # Include files that are needed to compile
$(RM) -f vern.orig.tmp.c
$(SED) <vern.orig.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
$(SED) 's/} /=/g;s/{ /i/g' >vern.orig.tmp.c
westley: westley.c
$(CC) $(CFLAGS) westley.c -o westley
# alternate names for selected entries
# #
adgrep: adrian CINCLUDE=
$(RM) -f adgrep #CINCLUDE= -include stdlib.h
$(LN) adrian adgrep #CINCLUDE= -include stdio.h
am: ant #CINCLUDE= -include stdlib.h -include stdio.h
$(RM) -f am #CINCLUDE= -I ${X11_INCDIR}
$(LN) ant am #CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
babble: buzzard.1
$(RM) -f babble
$(LN) buzzard.1 babble
first: buzzard.2
$(RM) -f first
$(LN) buzzard.2 first
ag: gson
$(RM) -f ag
$(LN) gson ag
whereami: westley
$(RM) -f whereami
$(LN) westley whereami
# Optimization
#
# 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+= -Wno-poison-system-directories
#
CWARN+= -Weverything
#
endif
# Specific add-ons or replacements for gcc only
#
ifeq ($(CC),gcc)
#
#CSILENCE+=
#
#CWARN+=
#
endif
##############################
# Special flags for this entry
##############################
#
ENTRY= westley
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
@echo "NOTE: This entry may not compile when using modern compilers."
${CC} ${CFLAGS} $< -o $@ ${LIBS}
whereami: ${PROG}
${RM} -f $@
${LN} $< $@
# alternative executable
#
alt: data ${ALT_TARGET}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
# both all and alt
#
everything: all alt
###############
# utility rules
###############
#
clean: clean:
$(RM) -f *.o a.out core ${RM} -f ${OBJ} ${ALT_OBJ}
$(RM) -f vern.tmp.c lush.again babble.cppcb vern.orig.tmp.c @-if [ -f indent.c ]; then \
$(RM) -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c echo ${RM} -f indent.c; \
${RM} -f indent.c; \
fi
clobber: clean clobber: clean
$(RM) -f $(WINNERS) a.out ${RM} -f ${TARGET} ${ALT_TARGET}
$(RM) -f $(ALT_NAMES) ${RM} -f whereami
$(RM) -f adwc adbasename adecho adhead adsleep @-if [ -e sandwich ]; then \
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig ${RM} -f sandwich; \
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig echo 'ate sandwich'; \
fi
am_clobber: clean am install:
$(RM) -f am.safe @echo "Dr. Spock says that is not logical!"
$(CP) am am.safe @${TRUE}
$(RM) -f $(WINNERS) a.out
$(RM) -f $(ALT_NAMES)
$(RM) -f adwc adbasename adecho adhead adsleep
$(RM) -f adrian.orig lush.orig nathan.orig buzzard.2.orig
$(RM) -f kivinen.orig imc.orig albert.orig marangon.orig vern.orig
$(CP) am.safe am
$(RM) -f am.safe
nuke: clobber # you may be able to misunderstand the source by reading indent.c
@true #
indent.c: ${PROG}.c
@if which "${GINDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${GINDENT} < $< > $@"; \
${GINDENT} < $< > $@; \
elif which "${INDENT}" >/dev/null 2>&1; then \
echo ${RM} -f $@; \
${RM} -f $@; \
echo "${INDENT} < $< > $@"; \
${INDENT} < $< > $@; \
else \
echo "no intent tool found, ident $< yourself, sorry"; \
echo "exit 1"; \
exit 1; \
fi
install: all
cat $(WINNERS) > /dev/null ##################
# 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 '<was here>' /\\oo/\\"
@echo "Eggy"
sandwich: easter_egg
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: sandwich
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo "A $@ helps ${MAKE} the elements that help form planets"
@${TRUE}
deep_magic: supernova
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: magic
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore IAU, $@ is a planet"
pluto: charon
${MAKE} charon
@echo "$@ is a dwarf planet"
@echo "dwarf is a type of planet"
@echo "therefore, $@ is a planet"
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
+14 -6
View File
@@ -1,4 +1,4 @@
Best Small Program: # Best Small Program:
Brian Westley (aka Merlyn LeRoy) Brian Westley (aka Merlyn LeRoy)
Digi International Digi International
@@ -6,23 +6,31 @@ Best Small Program:
St. Paul, MN 55104 St. Paul, MN 55104
USA USA
## To build:
Judges' comments: make all
NOTE: This entry may not compile when using modern compilers.
### To run
If lost: If lost:
make whereami make whereami
Then run: Then run:
whereami lat long
./whereami lat long
## Judges' comments
Where lat and long correspond to your latitude and longitude. Where lat and long correspond to your latitude and longitude.
To find the approximate place where this entry was judged, type: To find the approximate place where this entry was judged, type:
whereami 37 -122 (- means west of meridian) ./whereami 37 -122 (- means west of meridian)
## Author's comments
Selected notes from the author:
Run the program with your latitude & longitude as integer Run the program with your latitude & longitude as integer
arguments; it will produce a map made up of '!' with the given arguments; it will produce a map made up of '!' with the given