From 1ce40b273d58ad17700a936aae1093d7f5c1aa3d Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 26 Mar 2023 21:48:48 -0700 Subject: [PATCH] fix alt rules in Makefiles For Makefiles that have alt related rules, moved the related rules under the alt rule section. In some cases where there is no alt code, removed alt rules and/or targets. --- 1985/shapiro/Makefile | 3 +++ 1986/hague/Makefile | 4 ++++ 1986/stein/Makefile | 11 ++++++++--- 1987/heckbert/Makefile | 4 ++-- 1987/westley/Makefile | 3 +++ 1990/tbr/Makefile | 3 +++ 1992/albert/Makefile | 6 +++--- 1992/buzzard.2/Makefile | 6 +++--- 1994/horton/Makefile | 6 +++--- 1994/tvr/Makefile | 6 +++--- 1994/weisberg/Makefile | 6 +++--- 1996/westley/Makefile | 3 +++ 1998/chaos/Makefile | 10 +++++----- 1998/dlowe/Makefile | 6 +++--- 1998/schweikh1/Makefile | 3 +++ 1998/schweikh2/Makefile | 6 +++--- 2001/westley/Makefile | 6 +++--- 2004/hoyle/Makefile | 6 +++--- 2004/kopczynski/Makefile | 6 +++--- 2012/endoh2/Makefile | 10 +++++----- 2012/tromp/Makefile | 6 +++--- 2012/zeitak/Makefile | 6 +++--- 2015/duble/Makefile | 6 +++--- 2015/endoh4/Makefile | 3 +++ 2015/howe/Makefile | 12 ++++++------ 2018/bellard/Makefile | 7 ++----- 2019/ciura/Makefile | 6 +++--- 2020/burton/Makefile | 21 ++++++++++----------- 28 files changed, 102 insertions(+), 79 deletions(-) diff --git a/1985/shapiro/Makefile b/1985/shapiro/Makefile index fefb7cdf9..276a7212a 100644 --- a/1985/shapiro/Makefile +++ b/1985/shapiro/Makefile @@ -145,6 +145,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1986/hague/Makefile b/1986/hague/Makefile index 77a92befb..3b070629d 100644 --- a/1986/hague/Makefile +++ b/1986/hague/Makefile @@ -143,6 +143,10 @@ ${PROG}: ${PROG}.c @echo " when compiling and running this program with some systems." ${CC} ${CFLAGS} $< -o $@ ${LIBS} +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} # data files # diff --git a/1986/stein/Makefile b/1986/stein/Makefile index eec931eb3..b1918d429 100644 --- a/1986/stein/Makefile +++ b/1986/stein/Makefile @@ -133,15 +133,20 @@ ALT_TARGET= all: data ${TARGET} @${TRUE} -.PHONY: data everything clean clobber nuke dist_clean \ - install build love haste waste make easter_egg \ +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c - -${RM} -f a.out ${CC} ${CFLAGS} $< -o $@ ${LIBS} + -${RM} -f a.out -${LN} $@ a.out +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + # data files # data: ${DATA} diff --git a/1987/heckbert/Makefile b/1987/heckbert/Makefile index 1098c5650..204da35fc 100644 --- a/1987/heckbert/Makefile +++ b/1987/heckbert/Makefile @@ -134,8 +134,8 @@ ALT_TARGET= all: data ${TARGET} @${TRUE} -.PHONY: data everything clean clobber nuke dist_clean \ - install build love haste waste make easter_egg \ +.PHONY: all alt data everything clean clobber install \ + love haste waste maker easter_egg sandwich \ supernova deep_magic magic charon pluto ${PROG}: ${PROG}.c diff --git a/1987/westley/Makefile b/1987/westley/Makefile index 93b4df903..1debe3a2b 100644 --- a/1987/westley/Makefile +++ b/1987/westley/Makefile @@ -145,6 +145,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1990/tbr/Makefile b/1990/tbr/Makefile index c7ff0577d..6cb08941b 100644 --- a/1990/tbr/Makefile +++ b/1990/tbr/Makefile @@ -147,6 +147,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1992/albert/Makefile b/1992/albert/Makefile index b186f3003..713bea5aa 100644 --- a/1992/albert/Makefile +++ b/1992/albert/Makefile @@ -139,14 +139,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1992/buzzard.2/Makefile b/1992/buzzard.2/Makefile index aa390de6f..e93665610 100644 --- a/1992/buzzard.2/Makefile +++ b/1992/buzzard.2/Makefile @@ -141,9 +141,6 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - first: ${PROG} ${RM} -f $@ ${LN} $< $@ @@ -153,6 +150,9 @@ first: ${PROG} alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1994/horton/Makefile b/1994/horton/Makefile index b5dd136a0..7c060b424 100644 --- a/1994/horton/Makefile +++ b/1994/horton/Makefile @@ -147,14 +147,14 @@ ${PROG}: ${PROG}.c gtface: gtface.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1994/tvr/Makefile b/1994/tvr/Makefile index f283ac96f..c27545fd2 100644 --- a/1994/tvr/Makefile +++ b/1994/tvr/Makefile @@ -144,14 +144,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1994/weisberg/Makefile b/1994/weisberg/Makefile index afd6098c1..c4aad65a4 100644 --- a/1994/weisberg/Makefile +++ b/1994/weisberg/Makefile @@ -146,14 +146,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${C_SMALL} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.c - ${CC} ${C_LARGE} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.c + ${CC} ${C_LARGE} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1996/westley/Makefile b/1996/westley/Makefile index b96d58b9a..f4f0ab5d7 100644 --- a/1996/westley/Makefile +++ b/1996/westley/Makefile @@ -145,6 +145,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1998/chaos/Makefile b/1998/chaos/Makefile index fbb91cc31..419b83df1 100644 --- a/1998/chaos/Makefile +++ b/1998/chaos/Makefile @@ -142,6 +142,11 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + ${PROG}_nohalf: ${PROG}_nohalf.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} @@ -149,11 +154,6 @@ ${PROG}_nohalf.c: ${PROG}.c ${RM} -f $@ ${SED} -e 's/halfdelay([^)]*);//' < $? > $@ -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} - # data files # data: ${DATA} diff --git a/1998/dlowe/Makefile b/1998/dlowe/Makefile index 5659f10b1..fbe2db41a 100644 --- a/1998/dlowe/Makefile +++ b/1998/dlowe/Makefile @@ -139,14 +139,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1998/schweikh1/Makefile b/1998/schweikh1/Makefile index 0b1a27d0a..4e89812f1 100644 --- a/1998/schweikh1/Makefile +++ b/1998/schweikh1/Makefile @@ -144,6 +144,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/1998/schweikh2/Makefile b/1998/schweikh2/Makefile index 7668e9a0e..d672a04b4 100644 --- a/1998/schweikh2/Makefile +++ b/1998/schweikh2/Makefile @@ -142,14 +142,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2001/westley/Makefile b/2001/westley/Makefile index 576279c80..18fb4bb81 100644 --- a/2001/westley/Makefile +++ b/2001/westley/Makefile @@ -147,9 +147,6 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - westley2: westley2.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} @@ -161,6 +158,9 @@ westley3: westley3.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2004/hoyle/Makefile b/2004/hoyle/Makefile index 6d5569f76..e811c72b5 100644 --- a/2004/hoyle/Makefile +++ b/2004/hoyle/Makefile @@ -140,14 +140,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2004/kopczynski/Makefile b/2004/kopczynski/Makefile index 733f85f39..4d0110550 100644 --- a/2004/kopczynski/Makefile +++ b/2004/kopczynski/Makefile @@ -141,14 +141,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2012/endoh2/Makefile b/2012/endoh2/Makefile index b4342e7f9..891af83bc 100644 --- a/2012/endoh2/Makefile +++ b/2012/endoh2/Makefile @@ -151,6 +151,11 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} +# alternative executable +# +alt: data ${ALT_TARGET} + @${TRUE} + pi.c: ${PROG} ${RM} -f $@ ./$< > $@ @@ -300,11 +305,6 @@ e: e.c 271828182845: 271828182845.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -# alternative executable -# -alt: data ${ALT_TARGET} - @${TRUE} - # data files # data: ${DATA} diff --git a/2012/tromp/Makefile b/2012/tromp/Makefile index f687c1721..35ae76598 100644 --- a/2012/tromp/Makefile +++ b/2012/tromp/Makefile @@ -149,14 +149,14 @@ ${PROG}64: ${PROG} ${RM} -f $@ ${CP} -v $< $@ -${PROG}32: ${PROG}.c - ${CC} ${CFLAGS} -m32 -DInt=int -DX=4 $< -o $@ - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}32: ${PROG}.c + ${CC} ${CFLAGS} -m32 -DInt=int -DX=4 $< -o $@ + # data files # data: ${DATA} diff --git a/2012/zeitak/Makefile b/2012/zeitak/Makefile index a997bd161..955e58215 100644 --- a/2012/zeitak/Makefile +++ b/2012/zeitak/Makefile @@ -144,14 +144,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2015/duble/Makefile b/2015/duble/Makefile index e2b54d61e..64e2d1675 100644 --- a/2015/duble/Makefile +++ b/2015/duble/Makefile @@ -145,14 +145,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2015/endoh4/Makefile b/2015/endoh4/Makefile index cf209fc87..571e3f2f9 100644 --- a/2015/endoh4/Makefile +++ b/2015/endoh4/Makefile @@ -146,6 +146,9 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2015/howe/Makefile b/2015/howe/Makefile index ab3221191..147a3efb0 100644 --- a/2015/howe/Makefile +++ b/2015/howe/Makefile @@ -142,6 +142,12 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} +test: makeholes prog-test.sh ${TARGET} + ${SHELL} ./prog-test.sh + +makeholes: makeholes.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # alternative executable # alt: data ${ALT_TARGET} @@ -150,12 +156,6 @@ alt: data ${ALT_TARGET} ${PROG}.alt: ${PROG}.alt.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -test: makeholes prog-test.sh ${TARGET} - ${SHELL} ./prog-test.sh - -makeholes: makeholes.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # data files # data: ${DATA} diff --git a/2018/bellard/Makefile b/2018/bellard/Makefile index c2a3ad23e..aa4e71421 100644 --- a/2018/bellard/Makefile +++ b/2018/bellard/Makefile @@ -125,8 +125,8 @@ OBJ= ${PROG}.o DATA= fruits.bin lena512.bin vintage_cars.bin Lenna.png TARGET= ${PROG} # -ALT_OBJ= ${PROG}.alt.o -ALT_TARGET= ${PROG}.alt +ALT_OBJ= +ALT_TARGET= ################# @@ -143,9 +143,6 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} diff --git a/2019/ciura/Makefile b/2019/ciura/Makefile index 3cbe168fc..7f225f764 100644 --- a/2019/ciura/Makefile +++ b/2019/ciura/Makefile @@ -140,14 +140,14 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} $< -o $@ ${LIBS} -${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LIBS} - # alternative executable # alt: data ${ALT_TARGET} @${TRUE} +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LIBS} + # data files # data: ${DATA} diff --git a/2020/burton/Makefile b/2020/burton/Makefile index 5e9153363..6125cb35d 100644 --- a/2020/burton/Makefile +++ b/2020/burton/Makefile @@ -117,12 +117,12 @@ endif ENTRY= burton PROG= prog # -OBJ= ${PROG}.o +OBJ= ${PROG}.o ${PROG}_le.o ${PROG}_be.o DATA= correct -TARGET= ${PROG} +TARGET= ${PROG} ${PROG}_le ${PROG}_be # -ALT_OBJ= ${PROG}_le.o -ALT_TARGET= ${PROG}_le +ALT_OBJ= +ALT_TARGET= # magic define parameters for Little Endian machines # @@ -153,9 +153,11 @@ all: data ${TARGET} ${PROG}: ${PROG}.c ${CC} ${CFLAGS} -DB=${B} -DI=${I} -DT=${T} -DS=${S} $< -o $@ ${LIBS} -${PROG}_le: ${PROG} - ${RM} -f $@ - ${CP} -f $< $@ +${PROG}_le: ${PROG}.c + ${CC} ${CFLAGS} -DB=${B} -DI=${I} -DT=${T} -DS=${S} $< -o $@ ${LIBS} + +${PROG}_be: ${PROG}.c + ${CC} ${CFLAGS} -DB=${_B} -DI=${_I} -DT=${_T} -DS=${_S} $< -o $@ ${LIBS} test: check_le.sh check_be.sh prog_le prog_be correct ./check_le.sh ./prog_le | ${DIFF} -bw - correct @@ -166,15 +168,12 @@ test: check_le.sh check_be.sh prog_le prog_be correct alt: data ${ALT_TARGET} @${TRUE} -${PROG}_be: ${PROG}.c - ${CC} ${CFLAGS} -DB=${_B} -DI=${_I} -DT=${_T} -DS=${_S} $< -o $@ ${LIBS} - # data files # data: ${DATA} @${TRUE} -# both all and alt + # everything: all alt @${TRUE}