summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 14:54:05 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:16 +0100
commit2efb134d747f479ba8d523845bad660c5ea16f44 (patch)
tree8ed90b622b7ae0a46bd2ac8b8d8f3a88cdf2d128
parent23bed8ad149d9afc0b3431f42ab12339d361cb10 (diff)
downloadfribid-2efb134d747f479ba8d523845bad660c5ea16f44.tar.gz
fribid-2efb134d747f479ba8d523845bad660c5ea16f44.tar.bz2
fribid-2efb134d747f479ba8d523845bad660c5ea16f44.zip
Makefile rule for setting PACKAGEVERSION
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2b1e9b8..298083a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2009 Samuel Lidén Borell <samuel@slbdata.se>
+# Copyright (c) 2009-2010 Samuel Lidén Borell <samuel@slbdata.se>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -54,11 +54,17 @@ distdebsig: distdeb
for deb in $(DISTDESTDIR)*.deb; do gpg -o $$deb.sig --sign $$deb; done
# Release management
-prepare-release: refresh-release-time
+prepare-release: refresh-release-time set-version
+
+need-version:
+ @[ -n "$$version" ] || (echo "The \`version' environment variable is not set" > /dev/stderr; false)
refresh-release-time:
date=`date '+%s'` && \
sed -ri 's/(#define RELEASE_TIME\s+)([0-9]+)/\1'$$date'/' common/defines.h
+set-version: need-version
+ sed -ri 's/(#define PACKAGEVERSION\s+")([^"]+)(")/\1'$$version'\3/' common/defines.h
+
.PHONY: all clean dist distdeb distdebsig distclean distsig install prepare-release refresh-release-time uninstall $(SUBDIRS)