annotate maps/Makefile @ 1547:2768b2b396a5

Cosmetics and comments.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Mar 2015 19:07:50 +0200
parents 796cf56a9b0a
children b2920faf3096
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
346
721bfe123726 Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents: 338
diff changeset
1 include ../config.mak
721bfe123726 Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents: 338
diff changeset
2 include config.mak
721bfe123726 Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents: 338
diff changeset
3
1547
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
4 ###
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
5 ### Main targets
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
6 ###
1237
3bbafec29fcb Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1226
diff changeset
7 TARGETS=$(addsuffix .html,$(MAPLIST)) \
3bbafec29fcb Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1226
diff changeset
8 $(addsuffix .ansi,$(MAPLIST)) \
3bbafec29fcb Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1226
diff changeset
9 $(addsuffix .png,$(MAPLIST))
346
721bfe123726 Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents: 338
diff changeset
10
1536
796cf56a9b0a Disable plain HTML (non-javascript enhanced) versions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1515
diff changeset
11 # $(addsuffix .htm,$(MAPLIST)) \
796cf56a9b0a Disable plain HTML (non-javascript enhanced) versions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1515
diff changeset
12
796cf56a9b0a Disable plain HTML (non-javascript enhanced) versions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1515
diff changeset
13
1547
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
14 ###
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
15 ### If no target specified, show some help
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
16 ###
842
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
17 all:
1512
031708e1dcb9 Update help.
Matti Hamalainen <ccr@tnsp.org>
parents: 1237
diff changeset
18 @echo "Usage: make <maps|fetch|diff|upload|clean>"
842
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
19 @echo
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
20 @echo "maps : Build HTML, HTML+JS, PNG image and ANSI format maps."
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
21 @echo "fetch : Fetch latest raw ASCII map data from bat.org."
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
22 @echo "diff : Do special diff operation between new data (gotten via 'fetch')"
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
23 @echo " and update .loc files for each continent with new locations."
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
24 @echo " A diff -u of new and old location files is outputted."
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
25 @echo "upload: Uploads map and loc-files via SCP to server specified in"
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
26 @echo " ../config.mak"
1514
835360392879 Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1512
diff changeset
27 @echo "gimp : Execute Gimp with all PNG targets for post-processing."
1512
031708e1dcb9 Update help.
Matti Hamalainen <ccr@tnsp.org>
parents: 1237
diff changeset
28 @echo "clean : Delete all the generated files."
031708e1dcb9 Update help.
Matti Hamalainen <ccr@tnsp.org>
parents: 1237
diff changeset
29 @echo
842
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
30
f5dda74e6e07 Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents: 807
diff changeset
31
1547
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
32 ###
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
33 ### Maps
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
34 ###
1237
3bbafec29fcb Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1226
diff changeset
35 maps: $(addsuffix .ppm,$(MAPLIST)) $(TARGETS)
39
fa68caaf3c94 New maps
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
1547
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
37 include Makefile.inc
346
721bfe123726 Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents: 338
diff changeset
38
99
140dda7f853d Updates
Matti Hamalainen <ccr@tnsp.org>
parents: 95
diff changeset
39
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
40 ###
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
41 ### Special targets
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
42 ###
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
43
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
44 # Upload changed files to site
1226
bc4e47cf3090 Upload tormentas.map
Matti Hamalainen <ccr@tnsp.org>
parents: 1155
diff changeset
45 upload: $(TARGETS) renardy.map tormentas.map *.loc util.js
432
611b19fba3be Use compression with scp transfers, duh.
Matti Hamalainen <ccr@tnsp.org>
parents: 405
diff changeset
46 scp -C $? $(UPURL)
141
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
47 touch $@
95
0d2b25e342df Also make PNG images from maps
Matti Hamalainen <ccr@tnsp.org>
parents: 90
diff changeset
48
1514
835360392879 Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1512
diff changeset
49 # Open PNG files in Gimp
835360392879 Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1512
diff changeset
50 gimp: $(addsuffix .png,$(MAPLIST))
835360392879 Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1512
diff changeset
51 gimp $+
835360392879 Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1512
diff changeset
52 touch $@
835360392879 Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1512
diff changeset
53
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
54 # Upload only *.loc files
317
7b3b2eb09036 Coder information updates.
Matti Hamalainen <ccr@tnsp.org>
parents: 315
diff changeset
55 uploc: *.loc
800
8fbde52dfdfe Update lots of things.
Matti Hamalainen <ccr@tnsp.org>
parents: 798
diff changeset
56 scp $+ $(UPURL)
291
b78d089a0cf4 Upload target for location files only.
Matti Hamalainen <ccr@tnsp.org>
parents: 255
diff changeset
57
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
58 # Fetch raw ASCII maps from bat.org to *.new
459
30c9f70a554e Foo-bar.
Matti Hamalainen <ccr@tnsp.org>
parents: 436
diff changeset
59 fetch:
1237
3bbafec29fcb Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1226
diff changeset
60 for i in $(MAPMAP); do wget -O "$$i.new" "$(BATMAPURL)$$i.txt"; done
459
30c9f70a554e Foo-bar.
Matti Hamalainen <ccr@tnsp.org>
parents: 436
diff changeset
61
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
62 # Diff target between .map file and .new file. Makes necessary changes in .map and .loc
459
30c9f70a554e Foo-bar.
Matti Hamalainen <ccr@tnsp.org>
parents: 436
diff changeset
63 %.diff: %.map %.new
670
8f16bf5c2f9e Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents: 653
diff changeset
64 @echo DIFFING $< ...
8f16bf5c2f9e Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents: 653
diff changeset
65 @if ! $(DIFFMAP_BIN) $+ -o $@ -a; then \
8f16bf5c2f9e Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents: 653
diff changeset
66 $(MAP2PPM_BIN) $@ -o $@.ppm -d; \
8f16bf5c2f9e Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents: 653
diff changeset
67 $(PATCHMAP_BIN) $< $@ -o $<; \
8f16bf5c2f9e Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents: 653
diff changeset
68 fi
674
02d23acc346d Fix updating of location markers.
Matti Hamalainen <ccr@tnsp.org>
parents: 672
diff changeset
69 @echo UPDATING LOCATIONS ...
798
11e3bed89e35 Use verbosity flag in accordance to changes in mkloc.
Matti Hamalainen <ccr@tnsp.org>
parents: 791
diff changeset
70 @$(MKLOC_BIN) -v -m $(patsubst %.map,%.new,$<) -l $(patsubst %.map,%.loc,$<) -L -g -o $(patsubst %.map,%.nloc,$<)
674
02d23acc346d Fix updating of location markers.
Matti Hamalainen <ccr@tnsp.org>
parents: 672
diff changeset
71 @diff -ubB $(patsubst %.map,%.loc,$<) $(patsubst %.map,%.nloc,$<) | patch
459
30c9f70a554e Foo-bar.
Matti Hamalainen <ccr@tnsp.org>
parents: 436
diff changeset
72
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
73 # Remove all temporary .diff files
653
b5bd0d457481 Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
74 cleardiff:
b5bd0d457481 Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
75 $(RM) *.diff
b5bd0d457481 Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
76
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
77 # Diff target - run diff for each .map and .new (fetched via 'fetch' target).
1069
25cf3cf2acc8 Change to use Mercurial instead of Subversion.
Matti Hamalainen <ccr@tnsp.org>
parents: 950
diff changeset
78 # Finally do 'hg diff' to show changes.
1237
3bbafec29fcb Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents: 1226
diff changeset
79 diff: cleardiff $(addsuffix .diff,$(MAPMAP))
1155
2f7ca3ec98e8 Only 'hg diff' current directory with 'make diff'.
Matti Hamalainen <ccr@tnsp.org>
parents: 1069
diff changeset
80 @hg diff .
459
30c9f70a554e Foo-bar.
Matti Hamalainen <ccr@tnsp.org>
parents: 436
diff changeset
81
950
72e53a705775 Add comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 937
diff changeset
82 # Clean temporary and generated targets
39
fa68caaf3c94 New maps
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 clean:
937
9342d636bc21 Remove *.script files on clean target.
Matti Hamalainen <ccr@tnsp.org>
parents: 911
diff changeset
84 $(RM) $(TARGETS) *.diff *.ppm *.o *.script
39
fa68caaf3c94 New maps
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85
fa68caaf3c94 New maps
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 srcclean: clean
299
ed5dfa77511f Removed '-f' option.
Matti Hamalainen <ccr@tnsp.org>
parents: 297
diff changeset
87 $(RM) *~
39
fa68caaf3c94 New maps
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88
297
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
89 update:
1547
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
90 @echo "* Updating from Mercurial repo ..."
1069
25cf3cf2acc8 Change to use Mercurial instead of Subversion.
Matti Hamalainen <ccr@tnsp.org>
parents: 950
diff changeset
91 @hg fetch
297
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
92
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
93 .changelog: update
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
94 @echo "* Making ChangeLog ..."
1547
2768b2b396a5 Cosmetics and comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1536
diff changeset
95 @hg2cl
297
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
96 @touch $@
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
97
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
98 ChangeLog: .changelog
5482736f3913 ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
99