From 05613124ce46f30ea1580ecd7f94839f67366db9 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Hahn Date: Wed, 11 Jan 2012 23:14:24 +0100 Subject: [PATCH] Compute version only once In a make-file the =-assignment is replaced textually each time it is referenced, which leads to the shell fragments to be executed each time. Use the :=-assignment instead, which computes the value only once. Signed-off-by: Andrew McMillan --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e0f560bc..56002fc7 100755 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ #!/usr/bin/make -f # -package=davical -majorversion = $(shell sed -n 's:\([0-9\.]*\)[-a-f0-9-]*:\1:p' VERSION) -gitrev = 0 -version = $(majorversion) -issnapshot = 0 +package := davical +majorversion := $(shell sed -n 's:\([0-9\.]*\)[-a-f0-9-]*:\1:p' VERSION) +gitrev := 0 +version := $(majorversion) +issnapshot := 0 snapshot : gitrev = $(shell git rev-parse --short HEAD) snapshot : version = $(majorversion)-git$(gitrev) snapshot : issnapshot = 1