Makefile: lookup VERSION local variable once

This was more a clarity matter as relocatable autoconf makes all
references to the path look longer and more unweildly making it
a variable makes shorter and easier to read work through.

Especially when related to risks with RM arguments using the output
of a shell call in the argument list.  What could go wrong ?
This commit is contained in:
Darryl L. Miles 2024-10-17 21:15:30 +01:00 committed by R. Timothy Edwards
parent 394a01e0d4
commit f0ade2fc55
1 changed files with 11 additions and 8 deletions

View File

@ -10,6 +10,9 @@ MODULES = bplane cmwind commands database dbwind debug drc extflat \
extract graphics netmenu plow resis select sim textio tiles \
utils windows wiring
# This was `cat VERSION`
VERSION := $(shell cat ${MAGICDIR}/VERSION)
MAKEFLAGS =
INSTALL_CAD_DIRS = windows doc ${TECH}
@ -121,18 +124,18 @@ distclean:
${RM} defs.mak old.defs.mak ${MAGICDIR}/scripts/defs.mak
${RM} ${MAGICDIR}/scripts/default.conf
${RM} ${MAGICDIR}/scripts/config.log ${MAGICDIR}/scripts/config.status
${RM} scripts/magic.spec magic-`cat VERSION` magic-`cat VERSION`.tgz
${RM} scripts/magic.spec magic-${VERSION} magic-${VERSION}.tgz
${RM} *.log
dist:
${RM} scripts/magic.spec magic-`cat VERSION` magic-`cat VERSION`.tgz
sed -e /@VERSION@/s%@VERSION@%`cat VERSION`% \
${RM} scripts/magic.spec magic-${VERSION} magic-${VERSION}.tgz
sed -e /@VERSION@/s%@VERSION@%${VERSION}% \
scripts/magic.spec.in > scripts/magic.spec
ln -nsf . magic-`cat VERSION`
tar zchvf magic-`cat VERSION`.tgz --exclude CVS \
--exclude magic-`cat VERSION`/magic-`cat VERSION` \
--exclude magic-`cat VERSION`/magic-`cat VERSION`.tgz \
magic-`cat VERSION`
ln -nsf . magic-${VERSION}
tar zchvf magic-${VERSION}.tgz --exclude CVS \
--exclude magic-${VERSION}/magic-${VERSION} \
--exclude magic-${VERSION}/magic-${VERSION}.tgz \
magic-${VERSION}
clean-mains:
for dir in ${PROGRAMS}; do \