Improve how to redefine macros in 2012/endoh1 alt

Now one can use variables SLEEP, TIMER, GRAVITY, PRESSURE and VISCOSITY,
rather than single letter variables. This is like other commits where
instead of having to redefine CDEFINE one can do something like

    make clobber SLEEP=50 GRAVITY=I TIMER=15 alt

Notice that some can be set to I rather than a number. See the author's
remarks for details.

The try.alt.sh script was updated for this improvement.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-12 05:35:51 -08:00
1 parent 26edb2a70a
commit cca76ebe93
4 files changed
+29 -21

No files matched your search

+11 -6
View File
@@ -57,7 +57,7 @@ ARCH=
# Defines that are needed to compile
#
CDEFINE= -DG="$G" -DP="$P" -DV="$V" -DS=12321 -DA=10
CDEFINE= -DG="${GRAVITY}" -DP="${PRESSURE}" -DV="${VISCOSITY}"
# Include files that are needed to compile
#
@@ -120,15 +120,15 @@ ALT_TARGET= ${PROG}.alt ${PROG}_color.alt
# The factor of gravity
#
G=1
GRAVITY=1
# The factor of pressure
#
P=4
PRESSURE=4
# The factor of viscosity
#
V=8
VISCOSITY=8
#################
@@ -154,13 +154,18 @@ ${PROG}_color: ${PROG}_color.c
alt: data ${ALT_TARGET}
@${TRUE}
# Variables that control the alarm(3) timer and how much to sleep for alt code
#
TIMER= 10
SLEEP= 12321
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
${CC} ${CFLAGS} -DS=${SLEEP} -DA=${TIMER} $< -o $@ ${LDFLAGS}
# this does NOT correspond to endoh1.alt2.c but rather endoh1.alt.c: it is NOT
# deobfuscated.
${PROG}_color.alt: ${PROG}_color.alt.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
${CC} ${CFLAGS} -DS=${SLEEP} -DA=${TIMER} $< -o $@ ${LDFLAGS}
alt2: ${PROG}.alt2
@${TRUE}