From feedf2133f29c84102cb06940881f78f250f8af1 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:17:09 -0800 Subject: [PATCH] Improve how to define sleep time in 1985/lycklama With Makefile variables one can just do for instance: make SLEEP=700 clobber alt which will set the macro Z to 700. --- 1985/lycklama/Makefile | 8 +++++++- 1985/lycklama/README.md | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/1985/lycklama/Makefile b/1985/lycklama/Makefile index a5565d8f3..d25eca3e9 100644 --- a/1985/lycklama/Makefile +++ b/1985/lycklama/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DZ=500 +CDEFINE= -DZ=${SLEEP} # Include files that are needed to compile # @@ -137,6 +137,12 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +SLEEP=500 + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} -DZ=${SLEEP} $< -o $@ ${LDFLAGS} + + # data files # data: ${DATA} diff --git a/1985/lycklama/README.md b/1985/lycklama/README.md index 984b319fd..1cfb41ccb 100644 --- a/1985/lycklama/README.md +++ b/1985/lycklama/README.md @@ -12,7 +12,7 @@ make alt ``` To see why we recommend the alternate version instead of the original version, -see below and the [original code](#original-code) section. +see below and the [Original code](#original-code) section. ### Try: @@ -25,7 +25,7 @@ reconfigure it like: ```sh -make CDEFINE+="-DZ=700" clobber alt +make SLEEP=700 clobber alt ``` which would set it at 700. Then, whether you use the default value or not, try: