From 2ef3c9c39ce0b88a6c36711be72efb60e7737110 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 31 May 2023 03:30:24 -0700 Subject: [PATCH] Fix how 1988/applin/zsmall.c is built To match the rest of the repository with alternate code (where possible) the file is now applin.alt.c. However the rule in the Makefile copies the file to zsmall.c and builds it accordingly, compiling into applin.alt. .gitignore has had applin.alt added to it. --- 1988/applin/.gitignore | 1 + 1988/applin/Makefile | 8 ++++++-- 1988/applin/README.md | 19 ++++++++++++++++--- 1988/applin/{zsmall.c => applin.alt.c} | 0 4 files changed, 23 insertions(+), 5 deletions(-) rename 1988/applin/{zsmall.c => applin.alt.c} (100%) diff --git a/1988/applin/.gitignore b/1988/applin/.gitignore index a612d2239..ee1f628c6 100644 --- a/1988/applin/.gitignore +++ b/1988/applin/.gitignore @@ -1,3 +1,4 @@ applin large.c zsmall +applin.alt diff --git a/1988/applin/Makefile b/1988/applin/Makefile index d95d493bb..67be2771f 100644 --- a/1988/applin/Makefile +++ b/1988/applin/Makefile @@ -111,8 +111,8 @@ OBJ= ${PROG}.o DATA= TARGET= ${PROG} # -ALT_OBJ= zsmall.o -ALT_TARGET= zsmall +ALT_OBJ= applin.alt.o +ALT_TARGET= applin.alt ################# @@ -147,6 +147,10 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +${ALT_TARGET}: ${PROG}.alt.c + ${CP} -f ${PROG}.alt.c zsmall.c + ${CC} ${CFLAGS} zsmall.c -o $@ + # not an official entry # # The 'zsmall.c' program was obtained from 'applin.c' by reducing its recursion diff --git a/1988/applin/README.md b/1988/applin/README.md index a9b7c1f1f..187729cdf 100644 --- a/1988/applin/README.md +++ b/1988/applin/README.md @@ -10,12 +10,28 @@ US make all ``` +A smaller version, originally called `zsmall.c`, of [applin.c](applin.c) can be +found in [applin.alt.c](applin.alt.c). Your machine may have an easier time +with this program. See the Alternate code section below for details. + ## Try: ```sh ./applin ``` +### Alternate code: + +As noted above a smaller version can be used in case your cpp has a hard time +with this entry. To use: + +```sh +make alt +``` + +Use `applin.alt` as you would `applin` above. + + ## Judges' remarks: This entry is by far the most unusual abuse of the C preprocessor that @@ -34,9 +50,6 @@ on the Amdahl 5890-300E. But due to the ANSI-likeness of GNU cpp (v. 1-21), it was not able to cleanly substitute a symbol that began with a '#'. Clearly the GNU C preprocessor is faster. -A smaller version of [applin.c](applin.c) can be found in [zsmall.c](zsmall.c). -Your machine may have an easier time with this program. See the Makefile for -details. ## Author's remarks: diff --git a/1988/applin/zsmall.c b/1988/applin/applin.alt.c similarity index 100% rename from 1988/applin/zsmall.c rename to 1988/applin/applin.alt.c