From 1041382f681cc3fb7d825a834e92eb709fc04c3c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:22:51 -0800 Subject: [PATCH] Improve redefining size in 1998/schweikh3 Now one can do make clobber SIZE=55555 alt or whatever size they wish. --- 1998/schweikh3/Makefile | 10 +++++++++- 1998/schweikh3/README.md | 5 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/1998/schweikh3/Makefile b/1998/schweikh3/Makefile index d7e2f2bab..fefa31df9 100644 --- a/1998/schweikh3/Makefile +++ b/1998/schweikh3/Makefile @@ -55,10 +55,13 @@ CSTD= -std=gnu90 # ARCH= +# variable for size, primarily for alt code +# +SIZE=32767 # Defines that are needed to compile # CDEFINE= -DM0=sizeof -DM1=long -DM2=void \ - -DM3=realloc -DM4=calloc -DM5=free -DSZ=32767 + -DM3=realloc -DM4=calloc -DM5=free -DSZ=${SIZE} # Include files that are needed to compile # @@ -138,6 +141,11 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} + +${PROG}.alt: ${PROG}.alt.c + ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${LN} -sf $@ samefile.alt + # data files # data: ${DATA} diff --git a/1998/schweikh3/README.md b/1998/schweikh3/README.md index aac682d00..190aca9ab 100644 --- a/1998/schweikh3/README.md +++ b/1998/schweikh3/README.md @@ -54,11 +54,10 @@ If you wish to change the size to say, 55555: ```sh -make clobber CDEFINE="-DSZ=55555" alt +make clobber SIZE=55555 alt ``` -or whatever you wish to redefine it to. See [alternate code](#alternate-code) -below. +or whatever you wish to redefine it to. ## Judges' remarks: