From c137b0274dba5f91a03fab94d60d252338e0fd47 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 11 Nov 2022 19:37:05 -0500 Subject: Embed version number in dla2img.sh. --- Makefile | 5 ++++- d2iver.pl | 4 ++++ dla2img.sh | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 d2iver.pl diff --git a/Makefile b/Makefile index 15a4ac9..ae406f0 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,16 @@ PERL=perl CC=cc CFLAGS=-O2 -Wall -all: dla.xex dla2csv dla2csv.xex +all: dla.xex dla2csv dla2csv.xex dla2img.sh dla.xex: dla.s io.s dlatbl.s xex.inc printint.s render.s drunkwalk.s dlaver.h $(CL65) $(CL65FLAGS) -l dla.list -Ln dla.labels -t none -o dla.xex dla.s dla2csv.xex: dla2csv.c dlaver.h +dla2img.sh: VERSION + $(PERL) d2iver.pl dla2img.sh + dlatbl.s: mkdlatbl.pl $(PERL) mkdlatbl.pl > dlatbl.s diff --git a/d2iver.pl b/d2iver.pl new file mode 100644 index 0000000..b6cc951 --- /dev/null +++ b/d2iver.pl @@ -0,0 +1,4 @@ +#!/usr/bin/perl -w -i -p + +BEGIN { chomp($v=`cat VERSION`) } +/^VERSION=/ && s,=.*,=$v,; diff --git a/dla2img.sh b/dla2img.sh index 4258947..808f688 100755 --- a/dla2img.sh +++ b/dla2img.sh @@ -15,6 +15,9 @@ SELF="`basename $0`" +# This line may get changed by the Makefile (do not hand-edit): +VERSION=0.2.1 + # allow overriding magick path via environment. if [ "$MAGICK" = "" ]; then MAGICK="magick" @@ -31,7 +34,7 @@ OUTFILE="$2" if [ -z "$INFILE" -o -z "$OUTFILE" -o "$INFILE" = "-h" -o "$INFILE" = "--help" ]; then cat < -- cgit v1.2.3