Loading

Paste #puqda0dcf

  1. diff -r 5a280b359966 Makefile
  2. --- a/Makefile  Sun May 31 16:09:34 2015 +0100
  3. +++ b/Makefile  Sun May 31 20:46:51 2015 +0100
  4. @@ -25,10 +25,10 @@
  5.  BASE_FILENAME       ?= mynewgrf
  6.  
  7.  # Documentation files
  8. -DOC_FILES ?= docs/readme.txt docs/license.txt docs/changelog.txt
  9. +DOC_FILES := docs/readme.txt docs/license.txt docs/changelog.txt
  10.  
  11.  # Directory structure
  12. -SCRIPT_DIR          ?= build-common
  13. +SCRIPT_DIR          := build-common
  14.  
  15.  # Uncomment in order to make use of gimp scripting. See the file
  16.  # for a description of the format
  17. @@ -55,7 +55,7 @@
  18.  # grf file: the above defined grf file, usualls $(GRF_FILE)
  19.  # Add any additional, not usual files here, too, including
  20.  # their relative path to the root of the repository
  21. -BUNDLE_FILES           ?= $(GRF_FILE) $(DOC_FILES)
  22. +BUNDLE_FILES           := $(GRF_FILE) $(DOC_FILES)
  23.  
  24.  # Replacement strings in the source and in the documentation
  25.  # You may only change the values, not add new definitions
  26. @@ -65,12 +65,12 @@
  27.  REPLACE_REVISION    := {{REPO_REVISION}}
  28.  REPLACE_FILENAME    := {{FILENAME}}
  29.  
  30. -GENERATE_GRF  ?= grf
  31. -GENERATE_PNML ?= pnml
  32. -GENERATE_NML  ?= nml
  33. -GENERATE_GFX  ?= gfx
  34. -GENERATE_DOC  ?= doc
  35. -GENERATE_LNG  ?= lng
  36. +GENERATE_GRF  := grf
  37. +GENERATE_PNML := pnml
  38. +GENERATE_NML  := nml
  39. +GENERATE_GFX  := gfx
  40. +GENERATE_DOC  := doc
  41. +GENERATE_LNG  := lng
  42.  
  43.  # target 'all' must be first target
  44.  all: $(GENERATE_GRF) $(GENERATE_DOC) bundle_tar
  45. @@ -91,11 +91,11 @@
  46.  ################################################################
  47.  # Programme definitions / search paths
  48.  ################################################################
  49. -MAKE           ?= make
  50. -MAKE_FLAGS     ?= -r
  51. +MAKE           := make
  52. +MAKE_FLAGS     := -r
  53.  
  54. -NML            ?= $(shell which nmlc 2>/dev/null)
  55. -NML_FLAGS      ?= -c
  56. +NML            := time $(shell which nmlc 2>/dev/null)
  57. +NML_FLAGS      := -c
  58.  ifdef REQUIRED_NML_BRANCH
  59.     NML_BRANCH = $(shell nmlc --version | head -n1 | cut -d. -f1-2)
  60.  endif
  61. @@ -104,20 +104,20 @@
  62.  endif
  63.  
  64.  ifdef MAIN_SRC_FILE
  65. -   CC             ?= $(shell which gcc 2>/dev/null)
  66. -   CC_FLAGS       ?= -C -E -nostdinc -x c-header
  67. +   CC             := $(shell which gcc 2>/dev/null)
  68. +   CC_FLAGS       := -C -E -nostdinc -x c-header
  69.  endif
  70.  
  71. -AWK            ?= awk
  72. +AWK            := awk
  73.  
  74. -GREP           ?= grep
  75. +GREP           := grep
  76.  
  77. -HG             ?= $(shell hg st >/dev/null 2>/dev/null && which hg 2>/dev/null)
  78. +HG             := $(shell hg st >/dev/null 2>/dev/null && which hg 2>/dev/null)
  79.  
  80. -PYTHON         ?= python
  81. +PYTHON         := python
  82.  
  83. -UNIX2DOS       ?= $(shell which unix2dos 2>/dev/null)
  84. -UNIX2DOS_FLAGS ?= $(shell [ -n $(UNIX2DOS) ] && $(UNIX2DOS) -q --version 2>/dev/null && echo "-q" || echo "")
  85. +UNIX2DOS       := $(shell which unix2dos 2>/dev/null)
  86. +UNIX2DOS_FLAGS := $(shell [ -n $(UNIX2DOS) ] && $(UNIX2DOS) -q --version 2>/dev/null && echo "-q" || echo "")
  87.  
  88.  ################################################################
  89.  # Get the Repository revision, tags and the modified status
  90. @@ -133,35 +133,35 @@
  91.  REPO_BRANCH_VERSION ?= 0
  92.  
  93.  # HG revision
  94. -REPO_REVISION  ?= $(shell HGPLAIN= $(HG) id -n | cut -d+ -f1)
  95. +REPO_REVISION  := $(shell HGPLAIN= $(HG) id -n | cut -d+ -f1)
  96.  
  97.  # HG Hash
  98. -REPO_HASH            ?= $(shell HGPLAIN= $(HG) id -i | cut -d+ -f1)
  99. +REPO_HASH            := $(shell HGPLAIN= $(HG) id -i | cut -d+ -f1)
  100.  
  101.  # Days of commit since 2000-1-1 00-00
  102. -REPO_DATE            ?= $(shell HGPLAIN= $(HG) log -r$(REPO_HASH) --template='{time|shortdate}')
  103. -REPO_DAYS_SINCE_2000 ?= $(shell $(PYTHON2) -c "from datetime import date; print (date(`echo "$(REPO_DATE)" | sed s/-/,/g | sed s/,0/,/g`)-date(2000,1,1)).days")
  104. +REPO_DATE            := $(shell HGPLAIN= $(HG) log -r$(REPO_HASH) --template='{time|shortdate}')
  105. +REPO_DAYS_SINCE_2000 := $(shell $(PYTHON2) -c "from datetime import date; print (date(`echo "$(REPO_DATE)" | sed s/-/,/g | sed s/,0/,/g`)-date(2000,1,1)).days")
  106.  
  107.  # Whether there are local changes
  108. -REPO_MODIFIED  ?= $(shell [ "`HGPLAIN= $(HG) id | cut -c13`" = "+" ] && echo "M" || echo "")
  109. +REPO_MODIFIED  := $(shell [ "`HGPLAIN= $(HG) id | cut -c13`" = "+" ] && echo "M" || echo "")
  110.  
  111.  # Branch name
  112. -REPO_BRANCH    ?= $(shell HGPLAIN= $(HG) id -b | sed "s/default/$(DEFAULT_BRANCH_NAME)/")
  113. +REPO_BRANCH    := $(shell HGPLAIN= $(HG) id -b | sed "s/default/$(DEFAULT_BRANCH_NAME)/")
  114.  
  115.  # Any tag which is not 'tip'
  116. -REPO_TAGS      ?= $(shell HGPLAIN= $(HG) id -t | grep -v "tip")
  117. +REPO_TAGS      := $(shell HGPLAIN= $(HG) id -t | grep -v "tip")
  118.  
  119.  # Filename addition, if we're not building the default branch
  120. -REPO_BRANCH_STRING ?= $(shell if [ "$(REPO_BRANCH)" = "$(DEFAULT_BRANCH_NAME)" ]; then echo ""; else echo "-$(REPO_BRANCH)"; fi)
  121. +REPO_BRANCH_STRING := $(shell if [ "$(REPO_BRANCH)" = "$(DEFAULT_BRANCH_NAME)" ]; then echo ""; else echo "-$(REPO_BRANCH)"; fi)
  122.  
  123.  # The version reported to OpenTTD. Usually days since 2000 + branch offset
  124. -NEWGRF_VERSION ?= $(shell let x="$(REPO_DAYS_SINCE_2000) + 65536 * $(REPO_BRANCH_VERSION)"; echo "$$x")
  125. +NEWGRF_VERSION := $(shell let x="$(REPO_DAYS_SINCE_2000) + 65536 * $(REPO_BRANCH_VERSION)"; echo "$$x")
  126.  
  127.  # The shown version is either a tag, or in the absence of a tag the revision.
  128. -REPO_VERSION_STRING ?= $(shell [ -n "$(REPO_TAGS)" ] && echo $(REPO_TAGS)$(REPO_MODIFIED) || echo $(REPO_DATE)$(REPO_BRANCH_STRING) \($(NEWGRF_VERSION):$(REPO_HASH)$(REPO_MODIFIED)\))
  129. +REPO_VERSION_STRING := $(shell [ -n "$(REPO_TAGS)" ] && echo $(REPO_TAGS)$(REPO_MODIFIED) || echo $(REPO_DATE)$(REPO_BRANCH_STRING) \($(NEWGRF_VERSION):$(REPO_HASH)$(REPO_MODIFIED)\))
  130.  
  131.  # The title consists of name and version
  132. -REPO_TITLE     ?= $(REPO_NAME) $(REPO_VERSION_STRING)
  133. +REPO_TITLE     := $(REPO_NAME) $(REPO_VERSION_STRING)
  134.  
  135.  # Remove the @ when you want a more verbose output.
  136.  _V ?= @

Comments