# HG changeset patch # User nathan # Date 1201537318 -3600 # Node ID bc68e23ad6d572a5bb7c4f07f57ee5746547dfb9 # Parent bc64e11172f5d331e148a79fc285664c69bfaf2e rework version generation diff -r bc64e11172f5 -r bc68e23ad6d5 Makefile --- a/Makefile Sat Dec 29 13:19:16 2007 +0100 +++ b/Makefile Mon Jan 28 17:21:58 2008 +0100 @@ -1,7 +1,7 @@ # # PremiereEpg plugin to VDR # -# (C) 2005-2007 Stefan Huelswitt +# (C) 2005-2008 Stefan Huelswitt # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -26,8 +26,14 @@ ### The version number of this plugin: +HGARCHIVE = .hg_archival.txt RELEASE := $(shell grep 'define PLUGIN_RELEASE' version.h | awk '{ print $$3 }' | sed -e 's/[";]//g') -VERSION := $(shell if test -d .hg; then echo -n '$(RELEASE)-'; (hg identify 2>/dev/null || echo -n Unknown) | sed -e 's/ .*//'; else echo -n '$(RELEASE)'; fi) +RELSTR := $(shell if test -d .hg; then \ + echo -n "-"; (hg identify 2>/dev/null || echo -n "Unknown") | sed -e 's/ .*//'; \ + elif test -r $(HGARCHIVE); then \ + echo -n "-"; grep "^node" $(HGARCHIVE) | awk '{ printf "%.12s",$$2 }'; \ + fi) +VERSION := $(RELEASE)$(RELSTR) ### The C++ compiler and options: @@ -55,7 +61,7 @@ ### The name of the distribution archive: -ARCHIVE = $(PLUGIN)-$(VERSION) +ARCHIVE = $(PLUGIN)-$(RELEASE) PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): @@ -79,6 +85,16 @@ I18Nmsgs = $(addprefix $(LOCALEDIR)/,$(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo,$(notdir $(foreach file, $(wildcard $(PODIR)/*.po), $(basename $(file)))))) LOCALEDIR = $(VDRDIR)/locale +### Targets: + +TARGETS = libvdr-$(PLUGIN).so +ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c) +TARGETS += i18n +endif + +all: $(TARGETS) +.PHONY: i18n + # Dependencies: MAKEDEP = $(CXX) -MM -MG @@ -89,15 +105,7 @@ -include $(DEPFILE) -### Targets: - -TARGETS = libvdr-$(PLUGIN).so -ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c) -TARGETS += i18n -endif - -all: $(TARGETS) -.PHONY: i18n +# Rules %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<