Skip to content

Commit 606d332

Browse files
committed
mkarchive.sh: Default to current version
Add a conditionally defined target to version.mk that just prints the target, and use that from mkarchive.sh to default to the current version if none is supplied on the command line. Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent 2236e8d commit 606d332

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mkarchive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
VERSION="$1"
43
WORKDIR=$(dirname "${BASH_SOURCE[0]}")
4+
VERSION="${1:-$(make -f $WORKDIR/version.mk)}"
55
OUTFILE="$WORKDIR/xdp-tools-$VERSION.tar.gz"
66
PREFIX=xdp-tools-$VERSION
77
TMPDIR=$(mktemp -d)

version.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
TOOLS_VERSION := "1.4.1"
22

3+
# Conditionally defined make target makes it possible to print the version
4+
# defined above by running 'make -f version.mk'
5+
ifeq ($(MAKEFILE_LIST),version.mk)
6+
print_version:
7+
@echo $(TOOLS_VERSION)
8+
endif

0 commit comments

Comments
 (0)