~ubuntu-branches/ubuntu/oneiric/openttd-opensfx/oneiric

« back to all changes in this revision

Viewing changes to scripts/Makefile.def

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman, Matthijs Kooijman
  • Date: 2010-04-02 15:45:39 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100402154539-3dbha95ba81wbqtd
Tags: 0.2.3-1
[ Matthijs Kooijman ]
* [9f4d281] New upstream release 0.2.3.
* [5801386] Don't use "free" or "open source" to descripe OpenSFX.
  (Closes: #573952)
* [487e4a1] Remove install-mkdir.patch, the issue was fixed upstream.
* [bf7b68e] Enable md5 sum checking after build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
shell = /bin/sh
 
2
 
 
3
# We want to disable the default rules. It's not c/c++ anyway
 
4
.SUFFIXES:
 
5
 
 
6
################################################################
 
7
# Programme definitions / search paths
 
8
################################################################
 
9
# Build parameters and programmes
 
10
NFORENUM_FLAGS ?=
 
11
GRFCODEC_FLAGS ?= -e -p 2
 
12
TAR_FLAGS      ?= -cf
 
13
ZIP_FLAGS      ?= -r
 
14
SRCZIP_FLAGS   ?=
 
15
BZIP_FLAGS     ?= -k9f
 
16
CC_FLAGS       ?= -C -E - <
 
17
MAKE_FLAGS     ?=
 
18
UNIX2DOS_FLAGS ?= -q
 
19
 
 
20
NFORENUM       ?= renum
 
21
GRFCODEC       ?= grfcodec
 
22
TAR            ?= tar
 
23
ZIP            ?= zip
 
24
SRCZIP         ?= gzip
 
25
BZIP           ?= bzip2
 
26
CC             ?= gcc
 
27
AWK            ?= awk
 
28
HG             ?= hg
 
29
MAKE           ?= make
 
30
UNIX2DOS       ?= $(shell [ `which unix2dos 2>/dev/null` ] && echo "unix2dos" || echo "")
 
31
# Macs have a different md5 command than linux or mingw envirnoment:
 
32
MD5SUM         ?= $(shell [ "$(OSTYPE)" = "Darwin" ] && echo "md5 -r" || echo "md5sum")
 
33
 
 
34
SCRIPT_DIR     ?= scripts
 
35
SRC_DIR        ?= sprites
 
36
NFO_DIR        ?= $(SRC_DIR)/nfo
 
37
DOC_DIR        ?= docs
 
38
 
 
39
# Add some OS detection and guess an install path (use the system's default)
 
40
OSTYPE:=$(shell uname -s)
 
41
ifeq ($(OSTYPE),Linux)
 
42
INSTALL_DIR?=$(HOME)/.openttd/data
 
43
else
 
44
ifeq ($(OSTYPE),Darwin)
 
45
INSTALL_DIR?=$(HOME)/Documents/OpenTTD/data
 
46
else
 
47
ifeq ($(shell echo "$(OSTYPE)" | cut -d_ -f1),MINGW32)
 
48
INSTALL_DIR?=C:\Documents and Settings\$(USERNAME)\My Documents\OpenTTD\data
 
49
else
 
50
INSTALL_DIR?=
 
51
endif
 
52
endif
 
53
endif
 
54
 
 
55
# Previous versions used INSTALLDIR instead of INSTALL_DIR. Use the previous version,
 
56
# if supplied via command line parameter:
 
57
 
 
58
ifdef INSTALLDIR
 
59
INSTALL_DIR = $(INSTALLDIR)
 
60
endif
 
61
 
 
62
################################################################
 
63
# Get the Repository revision, tags and the modified status
 
64
# The displayed name within OpenTTD / TTDPatch
 
65
# Looks like either
 
66
# a nightly build:                 GRF's Name nightly-r51
 
67
# a release build (taged version): GRF's Name 0.1
 
68
################################################################
 
69
REPO_REVISION ?= $(shell $(HG) id -n | cut -d+ -f1)
 
70
REPO_MODIFIED ?= $(shell [ "`$(HG) id | cut -c13`" = "+" ] && echo "M" || echo "")
 
71
REPO_TAGS     ?= $(shell $(HG) id -t | grep -v "tip")
 
72
REPO_FILES_CMD := $(HG) st -A | grep -v  "^I" | grep -v "^?" | grep -v "^\!" | cut -d\  -f2
 
73
REPO_FILES    ?= $(shell $(REPO_FILES_CMD))
 
74
REPO_DIRS     ?= $(shell for i in $(REPO_FILES); do dirname $$i; done | sort | uniq)
 
75
REPO_TITLE    := $(REPO_NAME) $(shell [ -n "$(REPO_TAGS)" ] && echo $(REPO_TAGS)$(REPO_MODIFIED) || echo nightly-r$(REPO_REVISION)$(REPO_MODIFIED))
 
76
 
 
77
################################################################
 
78
# Rules on how to generate filenames. Usually no need to change
 
79
################################################################
 
80
# Define how the displayed name and the filename of the bundled grf shall look like:
 
81
# The result will either be
 
82
# nightly build:                   mynewgrf-nightly-r51
 
83
# a release build (tagged version): mynewgrf-0.1
 
84
# followed by an M, if the source repository is not a clean version.
 
85
 
 
86
VPATH =
 
87
VPATH = $(REPO_DIRS)
 
88
 
 
89
FILENAME_STUB      := $(basename $(MAIN_TARGET))
 
90
DIR_BASE           := $(FILENAME_STUB)-
 
91
VERSION_STRING     := $(shell [ -n "$(REPO_TAGS)" ] && echo $(REPO_TAGS)$(REPO_MODIFIED) || echo nightly-r$(REPO_REVISION)$(REPO_MODIFIED))
 
92
DIR_NAME           := $(shell [ -n "$(REPO_TAGS)" ] && echo $(DIR_BASE)$(VERSION_STRING) || echo $(DIR_BASE)nightly)
 
93
VERSIONED_FILENAME := $(DIR_BASE)$(VERSION_STRING)
 
94
DIR_NAME_SRC       := $(VERSIONED_FILENAME)-source
 
95
 
 
96
TAR_FILENAME       := $(DIR_NAME).tar
 
97
BZIP_FILENAME      := $(TAR_FILENAME).bz2
 
98
ZIP_FILENAME       := $(VERSIONED_FILENAME).zip
 
99
REV_EXTENSION      ?= REV
 
100
MD5_FILENAME       := $(DIR_NAME).md5
 
101
REV_FILENAME       := $(VERSIONED_FILENAME).$(REV_EXTENSION)
 
102
 
 
103
DOC_FILES_SRC      := $(LICENSE_FILENAME_SRC) $(README_FILENAME_SRC) $(CHANGELOG_FILENAME_SRC)
 
104
DOC_FILES          := $(addsuffix .txt,$(basename $(DOC_FILES_SRC)))
 
105
 
 
106
# Directories which to remember when creating a source release
 
107
MAIN_DIRS           = $(SRC_DIR) $(DOC_DIR) $(SCRIPT_DIR) $(TEMPLATE_DIR) $(EXTRA_DIRS)
 
108
 
 
109
FILE_SRC_RE        := $(shell echo $(FILE_SRC_EXTENSIONS) | tr -s "[:space:]" "|")
 
110
FILE_INC_RE        := $(shell echo $(FILE_INC_EXTENSIONS) | tr -s "[:space:]" "|")
 
111
 
 
112
# Remove the @ when you want a more verbose output.
 
113
_V ?= @
 
114
_E ?= @echo
 
115
VPATH =
 
116
VPATH = . docs extra/os/rpm scripts src src/wav