improve 1993 Makefiles
This commit is contained in:
1 parent
b521f442a7
commit
53c5b0b66d
29 files changed
+6468
-1476
No files matched your search
+1
-1
@@ -50,7 +50,7 @@
|
|||||||
# tool locations
|
# tool locations
|
||||||
################
|
################
|
||||||
#
|
#
|
||||||
SHELL= /bin/bash
|
SHELL= bash
|
||||||
MAKE= make
|
MAKE= make
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
|
ag
|
||||||
|
ag.txt
|
||||||
ant
|
ant
|
||||||
+583
-127
@@ -1,147 +1,603 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - ant
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi -include stdlib.h
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-char-subscripts -Wno-error -Wno-implicit-function-declaration
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -Wno-missing-prototypes -Wno-missing-variable-declarations \
|
||||||
|
-Wno-poison-system-directories -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 \
|
||||||
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
|
${PROG}: ${PROG}.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
ag: ${PROG}
|
||||||
|
${RM} -f $@
|
||||||
|
${CP} -f $< $@
|
||||||
|
|
||||||
|
ag.txt: ${PROG}.txt
|
||||||
|
${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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f ag ag.txt
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+8
-10
@@ -1,4 +1,4 @@
|
|||||||
Best Utility:
|
# Best Utility:
|
||||||
|
|
||||||
Anthony Howe
|
Anthony Howe
|
||||||
Mortice Kern Systems, Inc.
|
Mortice Kern Systems, Inc.
|
||||||
@@ -6,17 +6,16 @@ Best Utility:
|
|||||||
Waterloo, Ontario, N2J 3G4
|
Waterloo, Ontario, N2J 3G4
|
||||||
Canada
|
Canada
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To use:
|
|
||||||
make ant
|
|
||||||
./ant 'ERE' [file ...]
|
./ant 'ERE' [file ...]
|
||||||
|
|
||||||
where:
|
## Judges' comments
|
||||||
ERE is an extended regular expression
|
|
||||||
file a file to process (default is stdin)
|
|
||||||
|
|
||||||
You may also want to try the author's test suite:
|
You may also want to try the author's test suite:
|
||||||
make -f ant.test.mk
|
make -f ant.test.mk
|
||||||
|
|
||||||
@@ -25,8 +24,7 @@ Judges' comments:
|
|||||||
|
|
||||||
This program demonstrates that Posix doesn't guarantee readability. :-)
|
This program demonstrates that Posix doesn't guarantee readability. :-)
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
Some of the features of my entry are:
|
Some of the features of my entry are:
|
||||||
|
|
||||||
|
|||||||
+580
-127
@@ -1,147 +1,600 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - cmills
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-return-type
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
#CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
#LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -Wno-comma -Wno-missing-prototypes -Wno-missing-variable-declarations \
|
||||||
|
-Wno-pedantic -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= cmills
|
||||||
|
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}
|
||||||
|
|
||||||
|
chris: ${PROG}
|
||||||
|
${RM} -f $@
|
||||||
|
${CP} -v $< $@
|
||||||
|
|
||||||
|
# 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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f chris
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+16
-18
@@ -1,4 +1,4 @@
|
|||||||
"Bill Gates" Award:
|
# "Bill Gates" Award:
|
||||||
|
|
||||||
Chris Mills
|
Chris Mills
|
||||||
Pagine Corporation
|
Pagine Corporation
|
||||||
@@ -6,8 +6,21 @@
|
|||||||
San Jose, CA 95131
|
San Jose, CA 95131
|
||||||
USA
|
USA
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
|
DISPLAY="your_X_server_display"
|
||||||
|
export DISPLAY
|
||||||
|
./cmills [speed] # must be run on an X11 server
|
||||||
|
|
||||||
|
where:
|
||||||
|
|
||||||
|
speed update speed from 1 to 9 (default is 9)
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
From the San Jose Mercury News (May 15, 1993 page 20A "West Hackers
|
From the San Jose Mercury News (May 15, 1993 page 20A "West Hackers
|
||||||
trounce East in computer quiz game"):
|
trounce East in computer quiz game"):
|
||||||
@@ -24,20 +37,6 @@ Judges' comments:
|
|||||||
[The expression on Bill Gates' face was a sight to behold, as reported
|
[The expression on Bill Gates' face was a sight to behold, as reported
|
||||||
to us by several who were there].
|
to us by several who were there].
|
||||||
|
|
||||||
To use:
|
|
||||||
make cmills # requires the X11 library
|
|
||||||
DISPLAY="your_X_server_display"
|
|
||||||
export DISPLAY
|
|
||||||
./cmills [speed] # must be run on an X11 server
|
|
||||||
|
|
||||||
where:
|
|
||||||
speed update speed from 1 to 9 (default is 9)
|
|
||||||
|
|
||||||
Csh users should use:
|
|
||||||
make cmills # requires the X11 library
|
|
||||||
setenv DISPLAY "your_X_server_display"
|
|
||||||
./cmills [speed] # must be run on an X11 server
|
|
||||||
|
|
||||||
You must set $DISPLAY in your environment or the program will
|
You must set $DISPLAY in your environment or the program will
|
||||||
dump core. This is not a bug as the author documented it as
|
dump core. This is not a bug as the author documented it as
|
||||||
a feature. :-)
|
a feature. :-)
|
||||||
@@ -53,8 +52,7 @@ Judges' comments:
|
|||||||
|
|
||||||
This program makes your windows about as useful as their windows. :-)
|
This program makes your windows about as useful as their windows. :-)
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
The program uses a single backing pixmap (which is the size of the
|
The program uses a single backing pixmap (which is the size of the
|
||||||
screen) for all of its subwindows (with a little bit of trickery to
|
screen) for all of its subwindows (with a little bit of trickery to
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
|
data.name
|
||||||
dgibson
|
dgibson
|
||||||
|
life.d
|
||||||
+578
-120
@@ -1,147 +1,605 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - dgibson
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
#
|
||||||
|
# If you 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
# 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/
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
#############################
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
#######################
|
||||||
|
# common tool locations
|
||||||
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-int-conversion -Wno-pointer-to-int-cast
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -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= dgibson
|
||||||
|
PROG= ${ENTRY}
|
||||||
|
#
|
||||||
|
OBJ= ${PROG}.o
|
||||||
|
DATA= dgibson.data1 dgibson.data2 dgibson.data3 dgibson.data4 dgibson.data5 \
|
||||||
|
dgibson.sh
|
||||||
|
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
|
||||||
-@if [ ! -f life.d ] ; then \
|
-@if [ ! -f life.d ] ; then \
|
||||||
echo "cp dgibson.data1 life.d"; \
|
echo "${CP} -f dgibson.data1 life.d"; \
|
||||||
cp dgibson.data1 life.d; \
|
${CP} -f dgibson.data1 life.d; \
|
||||||
echo "rm -f data.name"; \
|
echo "${RM} -f data.name"; \
|
||||||
rm -f data.name; \
|
${RM} -f data.name; \
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
echo "echo dgibson.data1 > data.name"; \
|
||||||
echo dgibson.data1 > data.name; \
|
echo dgibson.data1 > data.name; \
|
||||||
fi
|
fi
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
-${CHMOD} +x dgibson.sh
|
${CHMOD} +x dgibson.sh
|
||||||
|
|
||||||
ejb: ejb.c
|
# alternative executable
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
alt: data ${ALT_TARGET}
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
@${TRUE}
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
# data files
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
data: ${DATA}
|
||||||
$(RM) -f ag
|
@${TRUE}
|
||||||
$(LN) ant ag
|
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# both all and alt
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
everything: all alt
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
|
||||||
$(RM) -f mind
|
|
||||||
$(LN) leo mind
|
|
||||||
|
|
||||||
jkb: rince
|
|
||||||
$(RM) -f jkb
|
|
||||||
$(LN) rince jkb
|
|
||||||
|
|
||||||
tidy:
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
|
|
||||||
|
###############
|
||||||
|
# utility rules
|
||||||
|
###############
|
||||||
|
#
|
||||||
clean:
|
clean:
|
||||||
$(RM) -f *.o a.out core
|
${RM} -f ${OBJ} ${ALT_OBJ}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f life.d
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+10
-7
@@ -1,4 +1,4 @@
|
|||||||
Best Abuse of the C Preprocessor:
|
# Best Abuse of the C Preprocessor:
|
||||||
|
|
||||||
David Gibson
|
David Gibson
|
||||||
University of Cape Town
|
University of Cape Town
|
||||||
@@ -8,14 +8,18 @@ Best Abuse of the C Preprocessor:
|
|||||||
7945
|
7945
|
||||||
South Africa
|
South Africa
|
||||||
|
|
||||||
|
# To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To build use:
|
|
||||||
sh ./dgibson.sh [datafile]
|
sh ./dgibson.sh [datafile]
|
||||||
|
|
||||||
where:
|
where:
|
||||||
datafile initial pattern (default: dgibson.data1)
|
datafile initial pattern (default: dgibson.data1)
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
We have provided the shell script 'dgibson.sh' to make it easier
|
We have provided the shell script 'dgibson.sh' to make it easier
|
||||||
to run this entry. Run this shell script several times to
|
to run this entry. Run this shell script several times to
|
||||||
@@ -41,8 +45,7 @@ Judges' comments:
|
|||||||
of main(). If you have gcc under macOS it might work just as well. We did not
|
of main(). If you have gcc under macOS it might work just as well. We did not
|
||||||
test other systems.
|
test other systems.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
This program plays the Game of Life.
|
This program plays the Game of Life.
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
#define STAT ;long prs =
|
#define STAT ;long prs =
|
||||||
#define END ;
|
#define END ;
|
||||||
#define LIFE int bat, bit, but, las, gen, ret, rcl, rcf, rro, rrc, rrr, \
|
#define LIFE int bat, bit, but, las, gen, ret, rcl, rcf, rro, rrc, rrr, \
|
||||||
occ, ocp, sta, dfc; long prs; main(int col, int row) { \
|
occ, ocp, sta, dfc; long prs; int main(int col, char *argv[]) { \
|
||||||
int dfl = ((prs & 12) != 4), ccl = 0, cro = 0; return \
|
int row = (int)argv; int dfl = ((prs & 12) != 4), ccl = 0, cro = 0; return \
|
||||||
col == 1 && printf("LIFE\n"), (col < 0 ? recu : \
|
col == 1 && printf("LIFE\n"), (col < 0 ? recu : \
|
||||||
(((ret = 0) || (prs & 8) && addl || 0 && (0
|
(((ret = 0) || (prs & 8) && addl || 0 && (0
|
||||||
|
|
||||||
|
|||||||
+575
-127
@@ -1,147 +1,595 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - ejb
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi -include stdio.h -include stdlib.h -include string.h
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-bitwise-op-parentheses -Wno-error -Wno-implicit-function-declaration \
|
||||||
|
-Wno-pointer-sign
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -Wno-comma -Wno-format-nonliteral -Wno-implicit-int-conversion \
|
||||||
|
-Wno-poison-system-directories -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= ejb
|
||||||
|
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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+10
-8
@@ -1,4 +1,4 @@
|
|||||||
Best Obfuscated Algorithm:
|
# Best Obfuscated Algorithm:
|
||||||
|
|
||||||
E. Jay Berkenbilt
|
E. Jay Berkenbilt
|
||||||
Engineering Research Associates
|
Engineering Research Associates
|
||||||
@@ -6,15 +6,18 @@ Best Obfuscated Algorithm:
|
|||||||
Vienna, VA 22182-2235
|
Vienna, VA 22182-2235
|
||||||
USA
|
USA
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To run:
|
|
||||||
make ejb
|
|
||||||
./ejb level
|
./ejb level
|
||||||
|
|
||||||
where:
|
where:
|
||||||
level a value from -128 to 127
|
level a value from -128 to 127
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
A negative argument plays the patience puzzle. An argument
|
A negative argument plays the patience puzzle. An argument
|
||||||
greater than 0 plays the Tower of Hanoi puzzle. In either case
|
greater than 0 plays the Tower of Hanoi puzzle. In either case
|
||||||
@@ -25,8 +28,7 @@ Judges' comments:
|
|||||||
Of course, you need a different kind of "patience" if you give
|
Of course, you need a different kind of "patience" if you give
|
||||||
the argument 127 to this program and want to see it finish!
|
the argument 127 to this program and want to see it finish!
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
WHAT THIS PROGRAM DOES
|
WHAT THIS PROGRAM DOES
|
||||||
======================
|
======================
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
jonth
|
jonth
|
||||||
|
jonth.tmp.c
|
||||||
+582
-127
@@ -1,147 +1,602 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - jonth
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-error -Wno-implicit-function-declaration \
|
||||||
|
-Wno-incompatible-pointer-types -Wno-int-conversion
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
#CDEFINE=
|
||||||
|
CDEFINE= -DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
||||||
|
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1'
|
||||||
|
|
||||||
|
# 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-cast-align -Wno-comma -Wno-missing-prototypes \
|
||||||
|
-Wno-missing-variable-declarations -Wno-poison-system-directories \
|
||||||
|
-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= jonth
|
||||||
|
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
|
||||||
|
@echo "NOTE: This entry may not compile when using modern compilers."
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
|
${PROG}.tmp.c: ${PROG}.c
|
||||||
|
${SED} -e 's/\^\ /#define/' -e 's/@/Window(D,/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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f jonth.tmp.c
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+10
-5
@@ -1,4 +1,4 @@
|
|||||||
Most Obfuscated X Program:
|
# Most Obfuscated X Program:
|
||||||
|
|
||||||
Jon Thingvold
|
Jon Thingvold
|
||||||
University of Oslo
|
University of Oslo
|
||||||
@@ -6,13 +6,18 @@ Most Obfuscated X Program:
|
|||||||
N 0858 Oslo
|
N 0858 Oslo
|
||||||
Norway
|
Norway
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
NOTE: This entry may not compile when using modern compilers.
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To use:
|
|
||||||
make jonth # requires the X11 library
|
|
||||||
./jonth # must be run on an X11 server
|
./jonth # must be run on an X11 server
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
Use 'h' and 'l' to shift objects left or right. Use 'k' to
|
Use 'h' and 'l' to shift objects left or right. Use 'k' to
|
||||||
rotate and press SPACE to drop.
|
rotate and press SPACE to drop.
|
||||||
|
|
||||||
@@ -22,7 +27,7 @@ Judges' comments:
|
|||||||
Yusuke Endoh provided a patch which allows this entry to compile on modern
|
Yusuke Endoh provided a patch which allows this entry to compile on modern
|
||||||
systems. Thank you Yusuke!
|
systems. Thank you Yusuke!
|
||||||
|
|
||||||
Selected notes from the author:
|
## Author's comments
|
||||||
|
|
||||||
This is jonth (jon's t(h)etris) for the X Window System.
|
This is jonth (jon's t(h)etris) for the X Window System.
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
leo
|
leo
|
||||||
|
mind
|
||||||
+580
-127
@@ -1,147 +1,600 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - leo
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-empty-body
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -Wno-implicit-int-conversion -Wno-unknown-warning-option \
|
||||||
|
-Wno-comma -Wno-conditional-uninitialized -Wno-poison-system-directories \
|
||||||
|
-Wno-shorten-64-to-32 -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= leo
|
||||||
|
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}
|
||||||
|
|
||||||
|
mind: ${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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f mind
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+7
-6
@@ -1,4 +1,4 @@
|
|||||||
Best Game:
|
# Best Game:
|
||||||
|
|
||||||
Leonid A. Broukhis
|
Leonid A. Broukhis
|
||||||
Moscow Centre of SPARC Technology
|
Moscow Centre of SPARC Technology
|
||||||
@@ -6,11 +6,11 @@ Best Game:
|
|||||||
89-1-95 Moscow
|
89-1-95 Moscow
|
||||||
Russia
|
Russia
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
To make:
|
### To run
|
||||||
make leo
|
|
||||||
|
|
||||||
To have the computer guess:
|
To have the computer guess:
|
||||||
./leo [colors]
|
./leo [colors]
|
||||||
@@ -20,6 +20,8 @@ Judges' comments:
|
|||||||
|
|
||||||
where:
|
where:
|
||||||
colors number of possible colors (1 to 15) (default: 6)
|
colors number of possible colors (1 to 15) (default: 6)
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
By default, the number of colors if 6. You may specify a
|
By default, the number of colors if 6. You may specify a
|
||||||
value of between 1 and 15 colors. See the author's notes
|
value of between 1 and 15 colors. See the author's notes
|
||||||
@@ -56,8 +58,7 @@ Judges' comments:
|
|||||||
|
|
||||||
to successfully build this entry.
|
to successfully build this entry.
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
This program plays mastermind, if you call it by a name ending by
|
This program plays mastermind, if you call it by a name ending by
|
||||||
'd', otherwise it _solves_ mastermind. Call it without parameters
|
'd', otherwise it _solves_ mastermind. Call it without parameters
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
"*
|
||||||
lmfjyh
|
lmfjyh
|
||||||
+568
-117
@@ -1,147 +1,598 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - lmfjyh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
#
|
||||||
|
# If you 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
# 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/
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
#############################
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
# shell used by this Makefile
|
||||||
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
#######################
|
||||||
-@if [ ! -f life.d ] ; then \
|
# common tool locations
|
||||||
echo "cp dgibson.data1 life.d"; \
|
#######################
|
||||||
cp dgibson.data1 life.d; \
|
#
|
||||||
echo "rm -f data.name"; \
|
A2P= a2p
|
||||||
rm -f data.name; \
|
AR= ar
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
ASA= asa
|
||||||
echo dgibson.data1 > data.name; \
|
AT= at
|
||||||
fi
|
ATQ= atq
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
ATRM= atrm
|
||||||
-${CHMOD} +x dgibson.sh
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
ejb: ejb.c
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
jonth: jonth.c
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
${RM} -f jonth.tmp.c
|
#
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
${CC} ${CFLAGS} \
|
#X11_INCDIR= /usr/X11/include
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
X11_INCDIR= /opt/X11/include
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
# Common C compiler warnings to silence
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
#
|
||||||
|
CSILENCE=
|
||||||
|
#CSILENCE= -Wno-implicit-int
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
#CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
CWARN+= -Weverything
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Specific add-ons or replacements for gcc only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= lmfjyh
|
||||||
|
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."
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
||||||
${CC} ${CFLAGS} \
|
${CC} ${CFLAGS} \
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c -o $@ ${LIBS}
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
# alternative executable
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
alt: data ${ALT_TARGET}
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
@${TRUE}
|
||||||
|
|
||||||
schnitzi: schnitzi.c
|
# data files
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
data: ${DATA}
|
||||||
$(RM) -f ag
|
@${TRUE}
|
||||||
$(LN) ant ag
|
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# both all and alt
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
everything: all alt
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
|
||||||
$(RM) -f mind
|
|
||||||
$(LN) leo mind
|
|
||||||
|
|
||||||
jkb: rince
|
|
||||||
$(RM) -f jkb
|
|
||||||
$(LN) rince jkb
|
|
||||||
|
|
||||||
tidy:
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
|
|
||||||
|
###############
|
||||||
|
# utility rules
|
||||||
|
###############
|
||||||
|
#
|
||||||
clean:
|
clean:
|
||||||
$(RM) -f *.o a.out core
|
${RM} -f ${OBJ} ${ALT_OBJ}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+10
-14
@@ -1,16 +1,21 @@
|
|||||||
Most Versatile Source:
|
# Most Versatile Source:
|
||||||
|
|
||||||
Jyrki Holopainen
|
Jyrki Holopainen
|
||||||
Oy LM Ericsson Ab
|
Oy LM Ericsson Ab
|
||||||
SF-02420 Jorvas
|
SF-02420 Jorvas
|
||||||
Finland
|
Finland
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
NOTE: This entry may not compile when using modern compilers.
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To use:
|
|
||||||
make lmfjyh
|
|
||||||
./lmfjyh
|
./lmfjyh
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
See the makefile for details.
|
See the makefile for details.
|
||||||
|
|
||||||
@@ -20,16 +25,7 @@ Judges' comments:
|
|||||||
relies on a compiler bug which was fixed in gcc 2.3.3 (a very
|
relies on a compiler bug which was fixed in gcc 2.3.3 (a very
|
||||||
long time ago now).
|
long time ago now).
|
||||||
|
|
||||||
The make command:
|
## Author's comments
|
||||||
|
|
||||||
make tidy
|
|
||||||
|
|
||||||
will remove the "special" file that is created during the
|
|
||||||
make of lmfjyh.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
"Practical and efficient method of compressing source code"
|
"Practical and efficient method of compressing source code"
|
||||||
|
|
||||||
|
|||||||
+574
-127
@@ -1,147 +1,594 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - plummer
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi -include stdio.h
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-format-security
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -Wno-comma -Wno-implicit-int-conversion -Wno-missing-variable-declarations \
|
||||||
|
-Wno-pedantic -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= plummer
|
||||||
|
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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+12
-9
@@ -1,26 +1,29 @@
|
|||||||
Best One Liner:
|
# Best One Liner:
|
||||||
|
|
||||||
Mark Plummer
|
Mark Plummer
|
||||||
2901 Reckord Road
|
2901 Reckord Road
|
||||||
Fallston, MD, 21047
|
Fallston, MD, 21047
|
||||||
USA
|
USA
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To run:
|
|
||||||
make plummer
|
|
||||||
./plummer number arg
|
./plummer number arg
|
||||||
|
|
||||||
where:
|
where:
|
||||||
number a number (try 21701)
|
|
||||||
arg any argument
|
number a number (try 21701)
|
||||||
|
arg any argument
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
For extra credit: What happens when 'number' contains non-numeric
|
For extra credit: What happens when 'number' contains non-numeric
|
||||||
characters, and why?
|
characters, and why?
|
||||||
|
|
||||||
|
## Author's comments
|
||||||
Selected notes from the author:
|
|
||||||
|
|
||||||
This program prints out all numbers up to a given number of digits
|
This program prints out all numbers up to a given number of digits
|
||||||
on a single line. When the largest number is reached, the program
|
on a single line. When the largest number is reached, the program
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
jkb
|
||||||
rince
|
rince
|
||||||
+582
-127
@@ -1,147 +1,602 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - rince
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-c99-extensions -Wno-char-subscripts -Wno-dangling-else \
|
||||||
|
-Wno-incompatible-pointer-types -Wno-unused-value
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
#LIBS=
|
||||||
|
LIBS= -lcurses -ltermcap
|
||||||
|
#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-padded \
|
||||||
|
-Wno-poison-system-directories -Wno-shadow -Wno-sign-conversion \
|
||||||
|
-Wno-unreachable-code-loop-increment
|
||||||
|
#
|
||||||
|
CWARN+= -Weverything
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Specific add-ons or replacements for gcc only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),gcc)
|
||||||
|
#
|
||||||
|
#CSILENCE+=
|
||||||
|
#
|
||||||
|
#CWARN+=
|
||||||
|
#
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
##############################
|
||||||
|
# Special flags for this entry
|
||||||
|
##############################
|
||||||
|
#
|
||||||
|
ENTRY= rince
|
||||||
|
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}
|
||||||
|
|
||||||
|
jkb: ${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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
${RM} -f jkb
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
@-if [ -e sandwich ]; then \
|
||||||
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+574
-127
@@ -1,147 +1,594 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - schnitzi
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi -include stdlib.h -include string.h -include ctype.h
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
#CSILENCE=
|
||||||
|
CSILENCE= -Wno-deprecated-declarations -Wno-pedantic
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
CDEFINE=
|
||||||
|
#CDEFINE= -DIOCCC
|
||||||
|
|
||||||
|
# Include files that are needed to compile
|
||||||
|
#
|
||||||
|
CINCLUDE=
|
||||||
|
#CINCLUDE= -include stdlib.h
|
||||||
|
#CINCLUDE= -include stdio.h
|
||||||
|
#CINCLUDE= -include stdlib.h -include stdio.h
|
||||||
|
#CINCLUDE= -I ${X11_INCDIR}
|
||||||
|
#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2
|
||||||
|
|
||||||
|
# Optimization
|
||||||
|
#
|
||||||
|
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||||
|
# A few compilers have broken optimizers or this entry make break
|
||||||
|
# under those buggy optimizers and thus you may not want anything.
|
||||||
|
# Reasonable compilers will allow for -O3.
|
||||||
|
#
|
||||||
|
#OPT=
|
||||||
|
#OPT= -O
|
||||||
|
#OPT= -O1
|
||||||
|
#OPT= -O2
|
||||||
|
OPT= -O3
|
||||||
|
|
||||||
|
# Default flags for ANSI C compilation
|
||||||
|
#
|
||||||
|
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
||||||
|
|
||||||
|
# Libraries needed to build
|
||||||
|
#
|
||||||
|
LIBS=
|
||||||
|
#LIBS= -lm
|
||||||
|
#LIBS= -L ${X11_LIBDIR} -lX11
|
||||||
|
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
|
||||||
|
|
||||||
|
# C compiler to use
|
||||||
|
#
|
||||||
|
CC= cc
|
||||||
|
#CC=clang
|
||||||
|
#CC=gcc
|
||||||
|
|
||||||
|
# Compiler add-ons or replacements for clang only
|
||||||
|
#
|
||||||
|
ifeq ($(CC),clang)
|
||||||
|
#
|
||||||
|
CSILENCE+= -Wno-implicit-int-conversion -Wno-missing-prototypes \
|
||||||
|
-Wno-poison-system-directories -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= schnitzi
|
||||||
|
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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
||||||
+11
-8
@@ -1,19 +1,22 @@
|
|||||||
Obfuscated Intelligence Award:
|
# Obfuscated Intelligence Award:
|
||||||
|
|
||||||
Mark Schnitzius
|
Mark Schnitzius
|
||||||
1700 Woodbury Rd. #1208
|
1700 Woodbury Rd. #1208
|
||||||
Orlando, FL 32828
|
Orlando, FL 32828
|
||||||
USA
|
USA
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To run:
|
|
||||||
make schnitzi
|
|
||||||
./schnitzi file
|
./schnitzi file
|
||||||
|
|
||||||
where:
|
where:
|
||||||
file a file containing some text
|
file a file containing some text
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
After this program prints the contents of 'file', ask it
|
After this program prints the contents of 'file', ask it
|
||||||
some questions related to the text.
|
some questions related to the text.
|
||||||
@@ -42,7 +45,7 @@ Judges' comments:
|
|||||||
|
|
||||||
NOTE: The author may also be contacted at: marks@aldrin.ksc.nasa.gov
|
NOTE: The author may also be contacted at: marks@aldrin.ksc.nasa.gov
|
||||||
|
|
||||||
Selected notes from the author:
|
## Author's comments
|
||||||
|
|
||||||
I wanted to write a program that would read in a text file in
|
I wanted to write a program that would read in a text file in
|
||||||
natural language (such as English) and answer questions about that
|
natural language (such as English) and answer questions about that
|
||||||
|
|||||||
+574
-127
@@ -1,147 +1,594 @@
|
|||||||
# %W% %G% %U%
|
#!/usr/bin/env make
|
||||||
#
|
#
|
||||||
# 1993 makefile
|
# IOCCC 1993 winning entry - vanb
|
||||||
|
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# Copyright (c) 1993, 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
|
|
||||||
|
|
||||||
# flags for ANSI compiles
|
|
||||||
#
|
#
|
||||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
# The orig.Makefile, if it exits, is the original Makefile before this IOCCC
|
||||||
# others such as gcc may want -ansi, others may want nothing
|
# year directory was reworked so that entries are in separate directories.
|
||||||
# at all. Adjust the CFLAGS line as needed.
|
# This also applies to any orig.ansi.mk and orig.common.mk files.
|
||||||
#
|
#
|
||||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
# Several Makefiles were modified / formed in 2022, and as such it may have
|
||||||
# entries incorrectly. You might want need to turn on -O
|
# elements that are not historically compatible with way entries were built.
|
||||||
# to see if your compiler can handle them.
|
# The orig.Makefile, if it exits, is a copy of the pre-modified Makefile.
|
||||||
#
|
#
|
||||||
#CFLAGS=-O -Xa
|
# Regarding individual entries:
|
||||||
#CFLAGS=-Xa
|
|
||||||
CFLAGS= -ansi
|
|
||||||
#CFLAGS=
|
|
||||||
|
|
||||||
# ANSI compiler
|
|
||||||
#
|
#
|
||||||
# Set CC to the name of your ANSI compiler.
|
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||||
#CC=cc
|
# conditions and build environments change, especially when it comes to more
|
||||||
CC=gcc
|
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||||
|
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||||
# misc shell babble
|
# later IOCCC years.
|
||||||
#
|
#
|
||||||
NOINCLUDE=$(SED) -e 's/^.\([ ]*\)include/%include/'
|
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||||
SPACECLEAN=$(SED) -e 's/\([^ ]\)\([ ]\)[ ][ ]*/\1\2/g'
|
|
||||||
CPPCLEAN=$(GREP) -v '^. [0-9][0-9]*'
|
|
||||||
|
|
||||||
# winners that compile under ANSI C
|
|
||||||
#
|
#
|
||||||
WINNERS= ant cmills dgibson ejb jonth leo lmfjyh plummer rince schnitzi vanb
|
# GitHub pull requests are welcome:
|
||||||
ALT_NAMES= ag ag.txt chris mind jkb
|
|
||||||
|
|
||||||
all: $(WINNERS) $(ALT_NAMES)
|
|
||||||
|
|
||||||
ant: ant.c
|
|
||||||
${CC} ${CFLAGS} ant.c -o ant
|
|
||||||
|
|
||||||
cmills: cmills.c
|
|
||||||
${CC} ${CFLAGS} cmills.c -o cmills -lX11
|
|
||||||
|
|
||||||
dgibson: dgibson.c dgibson.sh dgibson.data1
|
|
||||||
-@if [ ! -f life.d ] ; then \
|
|
||||||
echo "cp dgibson.data1 life.d"; \
|
|
||||||
cp dgibson.data1 life.d; \
|
|
||||||
echo "rm -f data.name"; \
|
|
||||||
rm -f data.name; \
|
|
||||||
echo "echo dgibson.data1 > data.name"; \
|
|
||||||
echo dgibson.data1 > data.name; \
|
|
||||||
fi
|
|
||||||
${CC} ${CFLAGS} dgibson.c -o dgibson
|
|
||||||
-${CHMOD} +x dgibson.sh
|
|
||||||
|
|
||||||
ejb: ejb.c
|
|
||||||
${CC} ${CFLAGS} ejb.c -o ejb
|
|
||||||
|
|
||||||
jonth: jonth.c
|
|
||||||
${RM} -f jonth.tmp.c
|
|
||||||
${SED} -e s/\^\ /#define/ -e 's/@/Window(D,/g' jonth.c > jonth.tmp.c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
-DXX1='H 19;}M(J,4)}N H 20;}M(T,4)}q(m,w,' \
|
|
||||||
-DXX='XKeycodeToKeysym(D,o[13],0);K 12:Y();}R;}d XX1' \
|
|
||||||
jonth.tmp.c -o jonth -lX11
|
|
||||||
|
|
||||||
leo: leo.c
|
|
||||||
${CC} ${CFLAGS} leo.c -o leo
|
|
||||||
|
|
||||||
lmfjyh: lmfjyh.c
|
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CP} lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
|
||||||
${CC} ${CFLAGS} \
|
|
||||||
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c \
|
|
||||||
-o lmfjyh
|
|
||||||
|
|
||||||
plummer: plummer.c
|
|
||||||
${CC} ${CFLAGS} plummer.c -o plummer
|
|
||||||
|
|
||||||
rince: rince.c
|
|
||||||
${CC} ${CFLAGS} rince.c -lcurses -ltermcap -o rince
|
|
||||||
|
|
||||||
# NOTE: this is the original source that won
|
|
||||||
#
|
#
|
||||||
rince.orig: rince.orig.c
|
# If you have a patch that might make running an entry work in modern Unix-like
|
||||||
$(CC) $(CFLAGS) rince.orig.c -lcurses -ltermcap -o rince.orig
|
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||||
|
# consider.
|
||||||
schnitzi: schnitzi.c
|
|
||||||
${CC} ${CFLAGS} schnitzi.c -o schnitzi
|
|
||||||
|
|
||||||
vanb: vanb.c
|
|
||||||
${CC} ${CFLAGS} -DO5=main vanb.c -o vanb
|
|
||||||
|
|
||||||
|
|
||||||
# alternate names for selected entries
|
|
||||||
#
|
#
|
||||||
ag: ant
|
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||||
$(RM) -f ag
|
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||||
$(LN) ant ag
|
# issue or 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
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
ag.txt: ant.txt
|
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||||
$(RM) -f ag.txt
|
#
|
||||||
$(LN) ant.txt ag.txt
|
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||||
|
#
|
||||||
|
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
chris: cmills
|
|
||||||
$(RM) -f chris
|
|
||||||
$(LN) cmills chris
|
|
||||||
|
|
||||||
mind: leo
|
#############################
|
||||||
$(RM) -f mind
|
# shell used by this Makefile
|
||||||
$(LN) leo mind
|
#############################
|
||||||
|
#
|
||||||
|
SHELL= bash
|
||||||
|
|
||||||
jkb: rince
|
#######################
|
||||||
$(RM) -f jkb
|
# common tool locations
|
||||||
$(LN) rince jkb
|
#######################
|
||||||
|
#
|
||||||
|
A2P= a2p
|
||||||
|
AR= ar
|
||||||
|
ASA= asa
|
||||||
|
AT= at
|
||||||
|
ATQ= atq
|
||||||
|
ATRM= atrm
|
||||||
|
AWK= awk
|
||||||
|
BANNER= banner
|
||||||
|
BASE64= base64
|
||||||
|
BASENAME= basename
|
||||||
|
BATCH= batch
|
||||||
|
BC= bc
|
||||||
|
BINHEX= binhex
|
||||||
|
BISON= bison
|
||||||
|
BUNZIP2= bunzip2
|
||||||
|
BZCAT= bzcat
|
||||||
|
BZCMP= bzcmp
|
||||||
|
BZDIFF= bzdiff
|
||||||
|
BZEGREP= bzegrep
|
||||||
|
BZFGREP= bzfgrep
|
||||||
|
BZGREP= bzgrep
|
||||||
|
BZIP2= bzip2
|
||||||
|
BZLESS= bzless
|
||||||
|
BZMORE= bzmore
|
||||||
|
C2PH= c2ph
|
||||||
|
C89= c89
|
||||||
|
C99= c99
|
||||||
|
CAL= cal
|
||||||
|
CALC= calc
|
||||||
|
CAT= cat
|
||||||
|
CD= cd
|
||||||
|
CHFLAGS= chflags
|
||||||
|
CHGRP= chgrp
|
||||||
|
CHMOD= chmod
|
||||||
|
CKSUM= cksum
|
||||||
|
CLANG= clang
|
||||||
|
CLANG_PLUSPLUS= clang++
|
||||||
|
CLEAR= clear
|
||||||
|
CMP= cmp
|
||||||
|
COL= col
|
||||||
|
COLLDEF= colldef
|
||||||
|
COLRM= colrm
|
||||||
|
COLUMN= column
|
||||||
|
COMPRESS= compress
|
||||||
|
CP= cp
|
||||||
|
CPIO= cpio
|
||||||
|
CPP= cpp
|
||||||
|
CRC32= crc32
|
||||||
|
CSH= csh
|
||||||
|
CSPLIT= csplit
|
||||||
|
CURL= curl
|
||||||
|
CUT= cut
|
||||||
|
C_PLUSPLUS= c++
|
||||||
|
C_PLUSPLUS_FILT= c++filt
|
||||||
|
DATE= date
|
||||||
|
DC= dc
|
||||||
|
DD= dd
|
||||||
|
DF= df
|
||||||
|
DIFF3= diff3
|
||||||
|
DIFF= diff
|
||||||
|
DIG= dig
|
||||||
|
DIRNAME= dirname
|
||||||
|
ED= ed
|
||||||
|
EGREP= egrep
|
||||||
|
ENV= env
|
||||||
|
EQN= eqn
|
||||||
|
ETAGS= etags
|
||||||
|
EXPECT= expect
|
||||||
|
EXPR= expr
|
||||||
|
FALSE= false
|
||||||
|
FGREP= fgrep
|
||||||
|
FILE= file
|
||||||
|
FIND2PERL= find2perl
|
||||||
|
FIND= find
|
||||||
|
FLEX= flex
|
||||||
|
FLEX_PLUSPLUS= flex++
|
||||||
|
FMT= fmt
|
||||||
|
FOLD= fold
|
||||||
|
FS_USAGE= fs_usage
|
||||||
|
FUNZIP= funzip
|
||||||
|
FUSER= fuser
|
||||||
|
GCC= gcc
|
||||||
|
GDIFFMK= gdiffmk
|
||||||
|
GENCAT= gencat
|
||||||
|
GENSTRINGS= genstrings
|
||||||
|
GETOPT= getopt
|
||||||
|
GETOPTS= getopts
|
||||||
|
GINDENT= gindent
|
||||||
|
GNUMAKE= gnumake
|
||||||
|
GREP= grep
|
||||||
|
GROFF= groff
|
||||||
|
GROFFER= groffer
|
||||||
|
GROG= grog
|
||||||
|
GROPS= grops
|
||||||
|
GROTTY= grotty
|
||||||
|
GUNZIP= gunzip
|
||||||
|
GVIM= gvim
|
||||||
|
GZCAT= gzcat
|
||||||
|
GZEXE= gzexe
|
||||||
|
GZIP_PROG= gzip
|
||||||
|
G_PLUSPLUS= g++
|
||||||
|
H2PH= h2ph
|
||||||
|
H2XS= h2xs
|
||||||
|
HASH= hash
|
||||||
|
HEAD= head
|
||||||
|
HOSTNAME_PROG= hostname
|
||||||
|
ICONV= iconv
|
||||||
|
ID= id
|
||||||
|
INDENT= indent
|
||||||
|
INFO= info
|
||||||
|
JOT= jot
|
||||||
|
KILL= kill
|
||||||
|
KSH= ksh
|
||||||
|
LAST= last
|
||||||
|
LD= ld
|
||||||
|
LESSECHO= lessecho
|
||||||
|
LEX= len
|
||||||
|
LINK= link
|
||||||
|
LN= ln
|
||||||
|
LS= ls
|
||||||
|
M4= m4
|
||||||
|
MAKE= make
|
||||||
|
MAN= man
|
||||||
|
MKDIR= mkdir
|
||||||
|
MKFIFO= mkfifo
|
||||||
|
MKTEMP= mktemp
|
||||||
|
MV= mv
|
||||||
|
NANO= nano
|
||||||
|
NASM= nasm
|
||||||
|
NEQN= neqn
|
||||||
|
NICE= nice
|
||||||
|
NL= nl
|
||||||
|
NM= nm
|
||||||
|
NOHUP= nohup
|
||||||
|
NROFF= nroff
|
||||||
|
NSLOOKUP= nslookup
|
||||||
|
OD= od
|
||||||
|
OPENSSL= openssl
|
||||||
|
PASTE= paste
|
||||||
|
PATCH= patch
|
||||||
|
PATHCHK= pathchk
|
||||||
|
PAX= pax
|
||||||
|
PERL= perl
|
||||||
|
PICO= pico
|
||||||
|
PR= pr
|
||||||
|
PRINTENV= printenv
|
||||||
|
PS= ps
|
||||||
|
PTAR= ptar
|
||||||
|
PTARDIFF= ptardiff
|
||||||
|
PTARGREP= ptargrep
|
||||||
|
PWD= pwd
|
||||||
|
PYDOC= pydoc
|
||||||
|
PYTHON= python
|
||||||
|
PYTHONW= pythonw
|
||||||
|
READLINK= readlink
|
||||||
|
RENICE= renice
|
||||||
|
RESET= reset
|
||||||
|
REV= rev
|
||||||
|
RI= ri
|
||||||
|
RM= rm
|
||||||
|
RMDIR= rmdir
|
||||||
|
RSYNC= rsync
|
||||||
|
RUBY= ruby
|
||||||
|
RVIM= rvim
|
||||||
|
SAY= say
|
||||||
|
SCP= scp
|
||||||
|
SCREEN= screen
|
||||||
|
SCRIPT= script
|
||||||
|
SDIFF= sdiff
|
||||||
|
SED= sed
|
||||||
|
SEQ= seq
|
||||||
|
SFTP= sftp
|
||||||
|
SH= sh
|
||||||
|
SHA1= sha1
|
||||||
|
SHA= sha
|
||||||
|
SHAR= shar
|
||||||
|
SHASUM5_18= shasum5.18
|
||||||
|
SHASUM= shasum
|
||||||
|
SIZE= size
|
||||||
|
SLEEP= sleep
|
||||||
|
SORT= sort
|
||||||
|
SSH= ssh
|
||||||
|
STAT= stat
|
||||||
|
STRIP= strip
|
||||||
|
STTY= stty
|
||||||
|
SUM= sum
|
||||||
|
SYNC= sync
|
||||||
|
TABS= tabs
|
||||||
|
TAIL= tail
|
||||||
|
TAR= tar
|
||||||
|
TEE= tee
|
||||||
|
TEST= test
|
||||||
|
TFTP= tftp
|
||||||
|
TIDY= tidy
|
||||||
|
TIME= time
|
||||||
|
TOP= top
|
||||||
|
TOUCH= touch
|
||||||
|
TPUT= tout
|
||||||
|
TPUT= tput
|
||||||
|
TR= tr
|
||||||
|
TROFF= troff
|
||||||
|
TRUE= true
|
||||||
|
TSET= tset
|
||||||
|
TSORT= tsort
|
||||||
|
UL= ul
|
||||||
|
UNAME= uname
|
||||||
|
UNCOMPRESS= uncompress
|
||||||
|
UNEXPAND= unexpand
|
||||||
|
UNIFDEF= unifdef
|
||||||
|
UNIFDEFALL= unifdefall
|
||||||
|
UNIQ= uniq
|
||||||
|
UNITS= units
|
||||||
|
UNLINK= unlink
|
||||||
|
UNZIP= unzip
|
||||||
|
UNZIPSFX= unzipsfx
|
||||||
|
UPTIME= uptime
|
||||||
|
UUDECODE= uudecode
|
||||||
|
UUENCODE= uuencode
|
||||||
|
UUIDGEN= uuidgen
|
||||||
|
VI= vi
|
||||||
|
VIEW= view
|
||||||
|
VIM= vim
|
||||||
|
VIMDIFF= vimdiff
|
||||||
|
W= w
|
||||||
|
WAIT4PATH= wait4path
|
||||||
|
WAIT= wait
|
||||||
|
WC= wc
|
||||||
|
WGET= wget
|
||||||
|
WHAT= what
|
||||||
|
WHATIS= whatis
|
||||||
|
WHICH= which
|
||||||
|
WHO= who
|
||||||
|
WHOAMI= whoami
|
||||||
|
WHOIS= whois
|
||||||
|
1WRTIE= write
|
||||||
|
XAR= xar
|
||||||
|
XARGS= xargs
|
||||||
|
XATTR= xattr
|
||||||
|
XXD= xxd
|
||||||
|
YACC= yacc
|
||||||
|
YES= yes
|
||||||
|
ZCAT= zcat
|
||||||
|
ZCMP= zcmp
|
||||||
|
ZDIFF= zdiff
|
||||||
|
ZEGREP= zegrep
|
||||||
|
ZFGREP= zfgrep
|
||||||
|
ZFORCE= zforce
|
||||||
|
ZGREP= zgrep
|
||||||
|
ZIP= zip
|
||||||
|
ZIPCLOAK= zipcloak
|
||||||
|
ZIPGREp= zipgrep
|
||||||
|
ZIPINFo= zipinfo
|
||||||
|
ZIPNOTE= zipnote
|
||||||
|
ZIPSPLIT= zipsplit
|
||||||
|
ZLESS= zless
|
||||||
|
ZMORE= zmore
|
||||||
|
ZNEW= znew
|
||||||
|
ZPRINT= zprint
|
||||||
|
ZSH= zsh
|
||||||
|
|
||||||
tidy:
|
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||||
${RM} -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
#
|
||||||
|
#X11_LIBDIR= /usr/X11R6/lib
|
||||||
|
#X11_LIBDIR= /usr/X11/lib
|
||||||
|
X11_LIBDIR= /opt/X11/lib
|
||||||
|
|
||||||
|
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
|
||||||
|
#
|
||||||
|
#X11_INCDIR= /usr/X11R6/include
|
||||||
|
#X11_INCDIR= /usr/X11/include
|
||||||
|
X11_INCDIR= /opt/X11/include
|
||||||
|
|
||||||
|
# Common C compiler warnings to silence
|
||||||
|
#
|
||||||
|
CSILENCE=
|
||||||
|
#CSILENCE= -Wno-implicit-int
|
||||||
|
|
||||||
|
# Common C compiler warning flags
|
||||||
|
#
|
||||||
|
#CWARN= ${CSILENCE}
|
||||||
|
#CWARN= -Wall ${CSILENCE}
|
||||||
|
CWARN= -Wall -Wextra ${CSILENCE}
|
||||||
|
#CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||||
|
|
||||||
|
# Compiler standard
|
||||||
|
#
|
||||||
|
#CSTD=
|
||||||
|
#CSTD= -ansi
|
||||||
|
CSTD= -std=gnu90
|
||||||
|
|
||||||
|
# Compiler bit architecture
|
||||||
|
#
|
||||||
|
# Some entries require 32-bitness:
|
||||||
|
# ARCH= -m32
|
||||||
|
#
|
||||||
|
# Some entries require 64-bitness:
|
||||||
|
# ARCH= -m64
|
||||||
|
#
|
||||||
|
# By default we assume nothing:
|
||||||
|
#
|
||||||
|
ARCH=
|
||||||
|
|
||||||
|
# Defines that are needed to compile
|
||||||
|
#
|
||||||
|
#CDEFINE=
|
||||||
|
CDEFINE= -DO5=main
|
||||||
|
|
||||||
|
# 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-pedantic -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= vanb
|
||||||
|
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}
|
||||||
|
|
||||||
|
# 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}
|
||||||
|
@-if [ -f indent.c ]; then \
|
||||||
|
echo ${RM} -f indent.c; \
|
||||||
|
${RM} -f indent.c; \
|
||||||
|
fi
|
||||||
|
|
||||||
clobber: clean tidy
|
clobber: clean
|
||||||
$(RM) -f $(WINNERS)
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
$(RM) -f $(ALT_NAMES)
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f jonth.tmp.c life.d rince.orig data.name data.name2
|
${RM} -f sandwich; \
|
||||||
|
echo 'ate sandwich'; \
|
||||||
|
fi
|
||||||
|
|
||||||
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
-8
@@ -1,4 +1,4 @@
|
|||||||
Most Irregular Expression:
|
# Most Irregular Expression:
|
||||||
|
|
||||||
David Van Brackle
|
David Van Brackle
|
||||||
ISX Corporation
|
ISX Corporation
|
||||||
@@ -6,15 +6,20 @@ Most Irregular Expression:
|
|||||||
Marietta, GA 30067
|
Marietta, GA 30067
|
||||||
USA
|
USA
|
||||||
|
|
||||||
|
## To build:
|
||||||
|
|
||||||
Judges' comments:
|
make all
|
||||||
|
|
||||||
|
NOTE: This entry may not compile when using modern compilers.
|
||||||
|
|
||||||
|
### To run
|
||||||
|
|
||||||
To run:
|
|
||||||
make vanb
|
|
||||||
./vanb 'exp'
|
./vanb 'exp'
|
||||||
|
|
||||||
where:
|
where:
|
||||||
'exp' an octal expression
|
'exp' an octal expression
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
The octal expression may contain:
|
The octal expression may contain:
|
||||||
|
|
||||||
@@ -37,7 +42,7 @@ Judges' comments:
|
|||||||
argument of main(). If you have gcc under macOS it might work just as well.
|
argument of main(). If you have gcc under macOS it might work just as well.
|
||||||
We did not test other systems.
|
We did not test other systems.
|
||||||
|
|
||||||
Selected notes from the author:
|
## Author's comments
|
||||||
|
|
||||||
The program does no error checking - erroneous expressions will
|
The program does no error checking - erroneous expressions will
|
||||||
produce spurious results. Note that unary '-' is an operator. Thus,
|
produce spurious results. Note that unary '-' is an operator. Thus,
|
||||||
|
|||||||
Reference in new issue
Block a user