Makefile
branchtrunk
changeset 21 bc68e23ad6d5
parent 20 bc64e11172f5
child 23 3c10fdd8ccce
     1.1 --- a/Makefile	Sat Dec 29 13:19:16 2007 +0100
     1.2 +++ b/Makefile	Mon Jan 28 17:21:58 2008 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  #
     1.5  # PremiereEpg plugin to VDR
     1.6  #
     1.7 -# (C) 2005-2007 Stefan Huelswitt <s.huelswitt@gmx.de>
     1.8 +# (C) 2005-2008 Stefan Huelswitt <s.huelswitt@gmx.de>
     1.9  #
    1.10  # This code is free software; you can redistribute it and/or
    1.11  # modify it under the terms of the GNU General Public License
    1.12 @@ -26,8 +26,14 @@
    1.13  
    1.14  ### The version number of this plugin:
    1.15  
    1.16 +HGARCHIVE = .hg_archival.txt
    1.17  RELEASE := $(shell grep 'define PLUGIN_RELEASE' version.h | awk '{ print $$3 }' | sed -e 's/[";]//g')
    1.18 -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)
    1.19 +RELSTR  := $(shell if test -d .hg; then \
    1.20 +                     echo -n "-"; (hg identify 2>/dev/null || echo -n "Unknown") | sed -e 's/ .*//'; \
    1.21 +                   elif test -r $(HGARCHIVE); then \
    1.22 +                     echo -n "-"; grep "^node" $(HGARCHIVE) | awk '{ printf "%.12s",$$2 }'; \
    1.23 +                   fi)
    1.24 +VERSION := $(RELEASE)$(RELSTR)
    1.25  
    1.26  ### The C++ compiler and options:
    1.27  
    1.28 @@ -55,7 +61,7 @@
    1.29  
    1.30  ### The name of the distribution archive:
    1.31  
    1.32 -ARCHIVE = $(PLUGIN)-$(VERSION)
    1.33 +ARCHIVE = $(PLUGIN)-$(RELEASE)
    1.34  PACKAGE = vdr-$(ARCHIVE)
    1.35  
    1.36  ### Includes and Defines (add further entries here):
    1.37 @@ -79,6 +85,16 @@
    1.38  I18Nmsgs  = $(addprefix $(LOCALEDIR)/,$(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo,$(notdir $(foreach file, $(wildcard $(PODIR)/*.po), $(basename $(file))))))
    1.39  LOCALEDIR = $(VDRDIR)/locale
    1.40  
    1.41 +### Targets:
    1.42 +
    1.43 +TARGETS = libvdr-$(PLUGIN).so
    1.44 +ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c)
    1.45 +TARGETS += i18n
    1.46 +endif
    1.47 +
    1.48 +all: $(TARGETS)
    1.49 +.PHONY: i18n
    1.50 +
    1.51  # Dependencies:
    1.52  
    1.53  MAKEDEP = $(CXX) -MM -MG
    1.54 @@ -89,15 +105,7 @@
    1.55  
    1.56  -include $(DEPFILE)
    1.57  
    1.58 -### Targets:
    1.59 -
    1.60 -TARGETS = libvdr-$(PLUGIN).so
    1.61 -ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c)
    1.62 -TARGETS += i18n
    1.63 -endif
    1.64 -
    1.65 -all: $(TARGETS)
    1.66 -.PHONY: i18n
    1.67 +# Rules
    1.68  
    1.69  %.o: %.c
    1.70  	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<