rework version generation trunk
authornathan
Mon, 28 Jan 2008 17:14:53 +0100
branchtrunk
changeset 141d78b544c9de
parent 13 12e31826c483
child 15 710f847b02af
rework version generation
Makefile
     1.1 --- a/Makefile	Fri Jan 25 20:53:00 2008 +0100
     1.2 +++ b/Makefile	Mon Jan 28 17:14:53 2008 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  #
     1.5  # MP3/MPlayer plugin to VDR
     1.6  #
     1.7 -# (C) 2001-2007 Stefan Huelswitt <s.huelswitt@gmx.de>
     1.8 +# (C) 2001-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 @@ -69,8 +69,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 version number of VDR (taken from VDR's "config.h"):
    1.27  
    1.28 @@ -87,7 +93,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 @@ -153,6 +159,24 @@
    1.38    COM_OBJS += i18n.o
    1.39  endif
    1.40  
    1.41 +### Targets:
    1.42 +
    1.43 +ifndef WITHOUT_MP3
    1.44 +  ALL += libvdr-$(PLUGIN).so
    1.45 +  ifneq ($(strip $(HASLOCALE)),)
    1.46 +    ALL += i18n-$(PLUGIN)
    1.47 +  endif
    1.48 +endif
    1.49 +ifndef WITHOUT_MPLAYER
    1.50 +  ALL += libvdr-$(PLUGIN2).so
    1.51 +  ifneq ($(strip $(HASLOCALE)),)
    1.52 +    ALL += i18n-$(PLUGIN2)
    1.53 +  endif
    1.54 +endif
    1.55 +
    1.56 +all: $(ALL)
    1.57 +.PHONY: i18n-$(PLUGIN) i18n-$(PLUGIN2)
    1.58 +
    1.59  # Dependencies:
    1.60  
    1.61  MAKEDEP = g++ -MM -MG
    1.62 @@ -163,23 +187,7 @@
    1.63  
    1.64  -include $(DEPFILE)
    1.65  
    1.66 -### Targets:
    1.67 -
    1.68 -ifndef WITHOUT_MP3
    1.69 -  ALL += libvdr-$(PLUGIN).so
    1.70 -  ifneq ($(strip $(HASLOCALE)),)
    1.71 -    ALL += i18n-$(PLUGIN)
    1.72 -  endif
    1.73 -endif
    1.74 -ifndef WITHOUT_MPLAYER
    1.75 -  ALL += libvdr-$(PLUGIN2).so
    1.76 -  ifneq ($(strip $(HASLOCALE)),)
    1.77 -    ALL += i18n-$(PLUGIN2)
    1.78 -  endif
    1.79 -endif
    1.80 -
    1.81 -all: $(ALL)
    1.82 -.PHONY: i18n-$(PLUGIN) i18n-$(PLUGIN2)
    1.83 +# Rules
    1.84  
    1.85  %.o: %.c
    1.86  	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<