File: Makefile.bundles

package info (click to toggle)
openttd-openmsx 0.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 972 kB
  • ctags: 49
  • sloc: python: 124; makefile: 73
file content (92 lines) | stat: -rw-r--r-- 4,358 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# This file is part of the OpenMSX music set for OpenTTD.
# OpenMSX is free content; you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, version 2.
# OpenMSX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of
# the GNU General Public License along with Swedish RailSet. If not, see 
# <http://www.gnu.org/licenses/>.
#

$(DIR_NAME): depend $(BUNDLE_FILES)
	$(_E) "[BUNDLE]"
	$(_E) "[Generating] $@"
	$(_V) if [ -e $@ ]; then rm -rf $@; fi
	$(_V) mkdir $@
	$(_V) -for i in $(BUNDLE_FILES); do cp $(CP_FLAGS) $$i $@; done

%.tar: $(DIR_NAME)
# Create the release bundle with all files in one tar
	$(_E) "[Generating] $@"
	$(_V)$(TAR) $(TAR_FLAGS) $@ $(basename $@)
	$(_E)

bundle: $(DIR_NAME)
bundle_tar: $(TAR_FILENAME)
bundle_zip: $(ZIP_FILENAME)
$(ZIP_FILENAME): $(DIR_NAME)
	$(_E) "[Generating] $@"
	$(_V) $(ZIP) $(ZIP_FLAGS) $@ $<
bundle_bzip: $(BZIP_FILENAME)
$(BZIP_FILENAME): $(TAR_FILENAME)
	$(_E) "[Generating] $@"
	$(_V)$(BZIP) $(BZIP_FLAGS) $^

# Installation process
install: $(INSTALL_DIR) $(DIR_NAME)
	$(_E) "[INSTALL] to $(INSTALL_DIR)"
	$(_V)-cp -Rf $(DIR_NAME)/. $(INSTALL_DIR)
ifdef INSTALLDIR
	$(_E) [Warning] The use of 'INSTALLDIR' is deprecated and may be removed in the future.
	$(_E) [Warning] Use 'INSTALL_DIR' instead.
endif

md5: $(MD5_FILENAME)

# OSX md5 programm generates slightly different output. Aleviate that by throwing some sed on all output:
$(MD5_FILENAME): $(MAIN_TARGET) $(GRF_FILES)
	$(_E) "[Generating] $@"
	$(_V) $(MD5SUM) $(GRF_FILES) $(MAIN_TARGET) | sed "s/  / /;s/ /  /" > $(MD5_FILENAME)

# OSX md5 programm generates slightly different output. Aleviate that by throwing some sed on all output:
check: $(MAIN_TARGET) $(GRF_FILES)
	$(_V) if [ -f $(MD5_FILENAME) ]; then echo "[CHECKING md5sums]"; else echo "Required file '$(MD5_FILENAME)' which to test against not found!"; false; fi
	$(_V) $(MD5SUM) $(GRF_FILES) $(MAIN_TARGET) | sed "s/  / /;s/ /  /" > md5.check
	$(_V) if [ -z "`diff md5.check $(MD5_FILENAME)`" ]; then echo "No differences in md5sums"; else echo "Differences in md5sums:"; echo "`diff md5.check $(MD5_FILENAME)`"; false; fi

bundle_src: $(REV_FILENAME) $(MD5_FILENAME)
	$(_E) "[Preparing] $(DIR_NAME_SRC)"
	$(_V) rm -rf $(DIR_NAME_SRC) $(DIR_NAME_SRC).tar.gz
	$(_V) mkdir -p $(DIR_NAME_SRC)
	$(_V) mkdir -p $(addprefix $(DIR_NAME_SRC)/,$(shell for i in $(REPO_DIRS); do for j in $(MAIN_DIRS); do echo $$i | grep -E "^$$j"; done; done))
	$(_V) for k in `for i in $(REPO_FILES); do for j in $(MAIN_DIRS); do echo "$$i" | grep -E "^$$j" | grep -E -v $(FILES_NOT_PACK_RE); done; done;`; do cp $(CP_FLAGS) $$k $(addprefix $(DIR_NAME_SRC)/,$$k); done
	$(_V) for k in `for i in $(REPO_FILES); do echo "$$i" | grep -v "/" | grep -E -v $(FILES_NOT_PACK_RE); done;`; do cp $(CP_FLAGS) $$k $(DIR_NAME_SRC); done
	$(_V) cp $(MD5_FILENAME) $(DIR_NAME_SRC)
	$(_V) cp Makefile.local.sample $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'REPO_REVISION = $(REPO_REVISION)' >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'REPO_BRANCH = $(REPO_BRANCH)' >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'REPO_MODIFIED = $(REPO_MODIFIED)' >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'REPO_TAGS    = $(REPO_TAGS)'    >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'HG = :' >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'VPATH =' >> $(DIR_NAME_SRC)/$(MAKEFILE_DEF)
	$(_V) echo 'VPATH = $(REPO_DIRS)' >> $(DIR_NAME_SRC)/$(MAKEFILE_DEF)
	$(_V) echo 'REPO_FILES = $(REPO_FILES)' >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) echo 'REPO_DIRS = $(REPO_DIRS)' >> $(DIR_NAME_SRC)/$(MAKEFILE_LOCAL)
	$(_V) $(TAR) $(TAR_FLAGS) $(DIR_NAME_SRC).tar $(DIR_NAME_SRC)
	$(_E) "[Generating] $(DIR_NAME_SRC).tar.gz"
	$(_V) $(SRCZIP) $(SRCZIP_FLAGS) $(DIR_NAME_SRC).tar
	$(_V) rm -rf $(DIR_NAME_SRC)

$(INSTALL_DIR):
	$(_E) "Install dir didn't exist. Creating $@"
	$(_V) mkdir -p $(INSTALL_DIR)

release-install:
	$(_E) "Target is obsolete. Use 'install' instead."
release-source:
	$(_E) "Target is obsolete. Use 'bundle_src' instead."
release_zip:
	$(_E) "Target is obsolete. Use 'bundle_zip' instead."

remake: clean all