From dd98bfe5ce035bb7ff07a6bd4a704b52c88e88b8 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:55:45 -0800 Subject: [PATCH] Improve how to set number of arrows 1994/dodsond2 Using a Makefile variable one can now do make clobber ARROWS=5 alt or whatever they wish to set it to. The code already checked the range. --- 1994/dodsond2/Makefile | 7 +++++-- 1994/dodsond2/README.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/1994/dodsond2/Makefile b/1994/dodsond2/Makefile index d93a70cab..2c276590a 100644 --- a/1994/dodsond2/Makefile +++ b/1994/dodsond2/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # -CDEFINE= -DW=3 +CDEFINE= -DW=${ARROWS} # Include files that are needed to compile # @@ -138,8 +138,11 @@ ${PROG}: ${PROG}.c alt: data ${ALT_TARGET} @${TRUE} +# variable to allow overriding how many arrows to start with +ARROWS= 3 + ${PROG}.alt: ${PROG}.alt.c - ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} + ${CC} ${CFLAGS} -DW=${ARROWS} $< -o $@ ${LDFLAGS} # data files # diff --git a/1994/dodsond2/README.md b/1994/dodsond2/README.md index 5c86b55e4..dcfd713d2 100644 --- a/1994/dodsond2/README.md +++ b/1994/dodsond2/README.md @@ -46,7 +46,7 @@ The default number of arrows in this version is 3 but if you want to change it, say to 5, try: ```sh -make clobber CDEFINE="-DW=5" alt +make clobber ARROWS=5 alt ```