]> www.vanbest.org Git - sasc-ng.git/commitdiff
Makefile: fix versioning
authorleslie <unknown>
Tue, 1 Jan 2008 14:51:36 +0000 (15:51 +0100)
committerleslie <unknown>
Tue, 1 Jan 2008 14:51:36 +0000 (15:51 +0100)
.release [deleted file]
Makefile
version.h

diff --git a/.release b/.release
deleted file mode 100644 (file)
index 120f532..0000000
--- a/.release
+++ /dev/null
@@ -1 +0,0 @@
-0.8.6
\ No newline at end of file
index e865dfcd44c5cea8dc583ef1c64aa2800b8a4afb..f8e37d2b1d210e2809dec42b7e57ebd5953b6723 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,8 +24,10 @@ PLUGIN = sc
 
 ### The version number of this plugin
 
-VERSION := $(shell if test -d .hg; then cat .release; echo -n '-'; (hg identify 2>/dev/null || echo -n Unknown) | sed -e 's/ .*//'; else cat .release; fi)
-RELEASE := $(shell cat .release)
+DISTFILE = .distvers
+RELEASE := $(shell grep 'define SC_RELEASE' version.h | awk '{ print $$3 }' | sed -e 's/[";]//g')
+SUBREL  := $(shell if test -d .hg; then echo -n "HG-"; (hg identify 2>/dev/null || echo -n Unknown) | sed -e 's/ .*//'; else cat $(DISTFILE); fi)
+VERSION := $(RELEASE)-$(SUBREL)
 SCAPIVERS := $(shell sed -ne '/define SCAPIVERS/ s/^.[a-zA-Z ]*\([0-9]*\).*$$/\1/p' $(PLUGIN).c)
 
 ### The directory environment:
@@ -217,7 +219,7 @@ clean-core:
        @-rm -f $(PODIR)/*.mo
 
 clean-pre:
-       @-find "$(PREDIR)" -type f -not -iname "*-$(SCAPIVERS).so.*" | xargs rm -f
+       @-find "$(PREDIR)" -type f -not -name ".empty" -not -iname "*-$(SCAPIVERS).so.*" | xargs rm -f
 
 clean: clean-core clean-systems
 
@@ -226,7 +228,8 @@ dist: clean-core
        @for i in `ls -A -I ".*" $(SYSDIR)`; do $(MAKE) -f ../../Makefile.system -C "$(SYSDIR)/$$i" dist; done
        @-rm -rf $(TMPDIR)/$(ARCHIVE)
        @mkdir $(TMPDIR)/$(ARCHIVE)
-       @cp -a .release * $(TMPDIR)/$(ARCHIVE)
+       @cp -a * $(TMPDIR)/$(ARCHIVE)
+       @echo -n "release" >$(TMPDIR)/$(ARCHIVE)/$(DISTFILE)
        @path="$(TMPDIR)/$(ARCHIVE)/$(notdir $(SYSDIR))";\
         for i in `ls -A -I ".*" $$path`; do if [ -f "$$path/$$i/nonpublic.mk" ]; then rm -rf "$$path/$$i"; fi; if [ -f "$$path/$$i/nonpublic.sh" ]; then (cd $$path/$$i ; source ./nonpublic.sh ; rm ./nonpublic.sh); fi; done
        @strip --strip-unneeded --preserve-dates $(TMPDIR)/$(ARCHIVE)/$(notdir $(PREDIR))/*
@@ -238,7 +241,8 @@ copy: ARCHIVE := $(PLUGIN)-$(VERSION)
 copy: clean clean-pre
        @-rm -rf $(TMPDIR)/$(ARCHIVE)
        @mkdir $(TMPDIR)/$(ARCHIVE)
-       @cp -a .release * $(TMPDIR)/$(ARCHIVE)
+       @cp -a .hgtags .hgignore * $(TMPDIR)/$(ARCHIVE)
+       @echo -n $(SUBREL) | sed -e 's/HG-/CP-/' >$(TMPDIR)/$(ARCHIVE)/$(DISTFILE)
        @tar czf vdr-$(ARCHIVE).tar.gz -C $(TMPDIR) $(ARCHIVE)
        @-rm -rf $(TMPDIR)/$(ARCHIVE)
        @echo Full copy package created as vdr-$(ARCHIVE).tar.gz
index 5ad25116a20c3da0d5b21110f1bbad1b03f593f4..a3a4b2d167a105b6c553cc180140f24bece3da7d 100644 (file)
--- a/version.h
+++ b/version.h
@@ -20,6 +20,8 @@
 #ifndef ___VERSION_H
 #define ___VERSION_H
 
+#define SC_RELEASE "0.8.6"
+
 extern const char *ScVersion;
 
 #endif