Skip to content
This repository was archived by the owner on Dec 21, 2025. It is now read-only.

Commit c260ca8

Browse files
authored
Use two variables to shorten a code line
1 parent ad4b34a commit c260ca8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Makefile.nw

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,17 @@ Importantly also, \texttt{include} causes Make to restart from scratch after one
324324
\subsubsection{Linking and fixing the ROM}\label{sec:linking}
325325

326326
Once all of the object files are generated, we can link them all together (notice the use of \texttt{\$\^{}}!), and fix the ROM.
327+
Two variables are used here (\texttt{SYMFILE} and \texttt{MAPFILE}), purely for readability's sake.
327328

328-
Notice that this also unconditionally assembles the build date file.
329-
That ensures that the build date is always refreshed.
329+
Notice that this recipe unconditionally assembles the build date file: that ensures that the build date is always refreshed.
330330

331331
<<Assembly rules>>=
332+
SYMFILE := $(basename ${ROM}).sym
333+
MAPFILE := $(basename ${ROM}).map
332334
${ROM}: $(patsubst src/%.asm,obj/%.o,${SRCS})
333335
@mkdir -p "${@D}"
334336
${RGBASM} ${ASFLAGS} -o obj/build_date.o src/assets/build_date.asm
335-
${RGBLINK} ${LDFLAGS} -m$(basename ${ROM}).map -n $(basename ${ROM}).sym -o $@ $^ \
337+
${RGBLINK} ${LDFLAGS} -m ${MAPFILE} -n ${SYMFILE} -o $@ $^ \
336338
&& ${RGBFIX} -v ${FIXFLAGS} $@
337339
@
338340

0 commit comments

Comments
 (0)