forked from aburch/simutrans-pak128.britain
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·213 lines (178 loc) · 5.12 KB
/
Makefile
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Just run
# make clean all archives
# to get fresh and ready to deploy .tbz2 and .zip archives
#
# Change THIS to change the version string encoded in the pak file
# VERSION_STRING = "pak128.Britain-Ex-0.9.4"
#
#
#
MAKEOBJ ?= ./makeobj-extended
DESTDIR ?= .
PAKDIR ?= $(DESTDIR)/pak128.Britain-Ex
DESTFILE ?= simupak128.Britain-Ex
# Dirs for simutranslator
TR_DIRS :=
OUTSIDE :=
OUTSIDE += pak1file/128
TR_DIRS += pak1file/128
DIRS32 :=
DIRS32 += boats/holds
TR_DIRS += boats/holds
DIRS64 :=
DIRS64 += gui/gui64
TR_DIRS += gui
DIRS128 :=
DIRS128 += air
TR_DIRS += air
DIRS128 += attractions
TR_DIRS += attractions
DIRS128 += boats
TR_DIRS += boats
DIRS128 += bus
TR_DIRS += bus
DIRS128 += citybuildings
TR_DIRS += citybuildings
DIRS128 += citycars
TR_DIRS += citycars
DIRS128 += depots
TR_DIRS += depots
DIRS128 += goods
TR_DIRS += goods
DIRS128 += grounds
TR_DIRS += grounds
DIRS128 += gui/gui128
DIRS128 += hq
TR_DIRS += hq
DIRS128 += industry
TR_DIRS += industry
DIRS128 += london-underground
TR_DIRS += london-underground
DIRS128 += maglev
TR_DIRS += maglev
DIRS128 += narrowgauge
TR_DIRS += narrowgauge
DIRS128 += pedestrians
TR_DIRS += pedestrians
DIRS128 += smokes
TR_DIRS += smokes
DIRS128 += stations
TR_DIRS += stations
DIRS128 += signalboxes
TR_DIRS += signalboxes
DIRS128 += townhall
TR_DIRS += townhall
DIRS128 += trains
TR_DIRS += trains
DIRS128 += trams
TR_DIRS += trams
DIRS128 += trees
TR_DIRS += trees
DIRS128 += ways
TR_DIRS += ways
DIRS128 += piers
TR_DIRS += piers
DIRS192 :=
DIRS192 += boats/boats192
DIRS192 += air/air192
DIRS224 :=
DIRS224 += boats/boats224
DIRS256 :=
DIRS256 += air/air256
DIRS := $(OUTSIDE) $(DIRS32) $(DIRS64) $(DIRS128) $(DIRS192) $(DIRS224) $(DIRS256)
#generating filenames
#with this function the filenames are assembled, by removing the dir
make_name = $(subst /,.,$1).pak
.PHONY: $(DIRS) copy tar zip simutranslator
all: copy $(DIRS)
archives: tar zip
tar: $(DESTFILE).tbz2
zip: $(DESTFILE).zip
$(DESTFILE).tbz2: $(PAKDIR)
@echo "===> TAR $@"
@tar cjf $@ $(DESTDIR)
$(DESTFILE).zip: $(PAKDIR)
@echo "===> ZIP $@"
@zip -rq $@ $(DESTDIR)
copy:
@echo "===> COPY"
@mkdir -p $(PAKDIR)/config
@cp -p config/* $(PAKDIR)/config
@mkdir -p $(PAKDIR)/text
@cp -p text/*.* $(PAKDIR)/text
# @mkdir -p $(PAKDIR)/text/citylists
@mkdir -p $(PAKDIR)/sound
@cp -p sound/* $(PAKDIR)/sound
# @mkdir -p $(PAKDIR)/scenario
# @cp -p scenario/* $(PAKDIR)/scenario
@cp -p demo.sve $(PAKDIR)
@cp -p licence.txt $(PAKDIR)
@cp -p compat.tab $(PAKDIR)
@cp -p symbol.BigLogo.pak $(PAKDIR)
$(DIRS32):
@echo "===> PAK32 $@"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK32 $(PAKDIR)/$(call make_name,$@) $@/ > /dev/null
$(DIRS64):
@echo "===> PAK64 $@"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK $(PAKDIR)/$(call make_name,$@) $@/ > /dev/null
$(DIRS128):
@echo "===> PAK128 $@"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK128 $(PAKDIR)/$(call make_name,$@) $@/ > /dev/null
$(DIRS192):
@echo "===> PAK192 $@"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK192 $(PAKDIR)/$(call make_name,$@) $@/ > /dev/null
$(DIRS224):
@echo "===> PAK224 $@"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK224 $(PAKDIR)/$(call make_name,$@) $@/ > /dev/null
$(DIRS256):
@echo "===> PAK256 $@"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK256 $(PAKDIR)/$(call make_name,$@) $@/ > /dev/null
$(OUTSIDE):
@echo "===> OUTSIDE with REVISION and grounds"
@mkdir -p $(PAKDIR)
@$(MAKEOBJ) quiet PAK128 $(PAKDIR)/ $@/ > /dev/null
clean:
@echo "===> CLEAN"
@rm -fr $(PAKDIR) $(DESTFILE).tbz2 $(DESTFILE).zip simutranslator/*.zip
# -----------
# Everything after this point in the Makefile is designed for
# the generation of zip files to upload to simutranslator
# written by Nathanael Nerode
# -----------
# The following image files are too large for simutranslator.
OVERSIZE_IMAGES :=
OVERSIZE_IMAGES += attractions/images/cur/football-ground-lg.png
OVERSIZE_IMAGES += attractions/images/cur/cricket-ground-sm.png
OVERSIZE_IMAGES += boats/images/clan-line-steamer.png
OVERSIZE_IMAGES += boats/images/handysize.png
# For each zip file to generate,
# (1) Use 'find' to get everything under the directory;
# (2) But exclude everything in 'blends';
# (3) And only collect files with .dat and .png endings;
# (4) Then use zip, but exclude "known bad" image files.
simutranslator/%.zip:
FILE_LIST=`find -path ./$*/\* \! -path ./$*/blends/\* \( -name \*.dat -o -name \*.png \)` ; \
zip -r $@ $$FILE_LIST -x $(OVERSIZE_IMAGES)
# Special case: Program texts
simutranslator/program_texts.zip:
zip $@ simutranslator/*.dat
# Convert the list of TR_DIRS to a list of TR_ZIPFILES
TR_ZIPFILES := $(patsubst %,simutranslator/%.zip, $(TR_DIRS) )
# Finally, depend on all the individual zipfiles.
simutranslator: $(TR_ZIPFILES)
# Potential problems.
# - The entire attractions folder may be too big to do in one go.
# - separate out the stone attractions?
STONE_ATTRACTIONS :=
STONE_ATTRACTIONS += attractions/stone-attractions.dat
STONE_ATTRACTIONS += attractions/images/cur/stone-attractions.png
STONE_ATTRACTIONS += attractions/images/cur/stone-attractions-snow.png
# - The entire boats folder may also be too big
# - separate out the large boats?
# - The entire trains folder may ALSO be too big