Mercurial > hg > batmud > maputils
annotate world/Makefile @ 2315:1bba63b2d78f
Generate and upload changelog also when doing target 'upload'.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 17 Jan 2021 21:57:53 +0200 |
parents | d0e00cd7b2a5 |
children | f90303eec665 |
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 | 4 ### |
5 ### Main targets | |
6 ### | |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
7 TARGETS=$(addsuffix .html,$(WORLD_MAPS)) \ |
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
8 $(addsuffix .ansi,$(WORLD_MAPS)) \ |
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
9 $(addsuffix .png,$(WORLD_MAPS)) \ |
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
10 $(addsuffix .htm,$(WORLD_MAPS)) \ |
1624 | 11 util.js |
1536
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 | 14 ### |
15 ### If no target specified, show some help | |
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: |
2067 | 18 @echo "Usage: make <target>" |
19 @echo "Available targets are as follows:" | |
20 @echo | |
21 @echo "maps : Build HTML, HTML+JS, PNG image and ANSI format maps." | |
22 @echo "fetch : Fetch latest raw ASCII map data from bat.org." | |
842
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
23 @echo |
2067 | 24 @echo "diff : Do special diff operation between new data (gotten via 'fetch')" |
25 @echo " and update .loc files for each continent with new locations." | |
26 @echo " A diff -u of new and old location files is outputted." | |
27 @echo | |
28 @echo "upload : Uploads map and loc-files via SCP to server specified in" | |
29 @echo " ../config.mak" | |
30 @echo | |
31 @echo "gimp : Execute Gimp with all PNG targets for post-processing." | |
32 @echo "clean : Delete all the generated files." | |
2069
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
33 @echo "changelog : Build changelog for map and location changes only." |
1512 | 34 @echo |
842
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
35 |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
36 |
1547 | 37 ### |
38 ### Maps | |
39 ### | |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
40 maps: $(addsuffix .ppm,$(WORLD_MAPS)) $(TARGETS) |
39 | 41 |
1547 | 42 include Makefile.inc |
346
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
43 |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
44 LOCLIST=$(addsuffix .loc,$(WORLD_MAPS)) special.loc limbo.loc |
99 | 45 |
950 | 46 ### |
47 ### Special targets | |
48 ### | |
49 | |
2069
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
50 changelog.txt: $(addsuffix .map,$(WORLD_MAPS)) $(LOCLIST) |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
51 @( echo '<?xml version="1.0"?>' && echo '<log>' && \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
52 hg log $+ -M -v -f --template \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
53 '<logentry revision="{rev}"><author>{author|escape}</author><date>{date|isodate}</date><paths><path>{files}</path></paths><msg>{desc|escape}</msg></logentry>\n' && \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
54 echo '</log>' ) | \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
55 iconv -f "iso-8859-1" -t "utf-8" | \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
56 xsltproc --stringparam strip-prefix "" \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
57 --stringparam linelen 80 \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
58 --stringparam groupbyday yes \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
59 --stringparam include-rev no \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
60 "svn2cl.xsl" - | \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
61 sed 's/world\///g;s/maps\///g;s/Matti .*/Ggr/g;s/Jarkko .*/Jeskko/g' \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
62 > $@ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
63 |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
64 # Build changelog |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
65 changelog: changelog.txt |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
66 $(RSCP) $? $(UPLOAD_URL) |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
67 @touch $@ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
68 |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
69 |
950 | 70 # Upload changed files to site |
2315
1bba63b2d78f
Generate and upload changelog also when doing target 'upload'.
Matti Hamalainen <ccr@tnsp.org>
parents:
2069
diff
changeset
|
71 upload: $(TARGETS) $(LOCLIST) changelog |
2047
7b18fb64dff1
Use rsync + ssh instead of scp for uploads.
Matti Hamalainen <ccr@tnsp.org>
parents:
1858
diff
changeset
|
72 $(RSCP) $? $(UPLOAD_URL) |
1623 | 73 @touch $@ |
95
0d2b25e342df
Also make PNG images from maps
Matti Hamalainen <ccr@tnsp.org>
parents:
90
diff
changeset
|
74 |
1514
835360392879
Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1512
diff
changeset
|
75 # Open PNG files in Gimp |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
76 gimp: $(addsuffix .png,$(WORLD_MAPS)) |
1621
471fa81c6c67
Improve 'make gimp' target a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
77 -@ls -lt $+ gimp |
471fa81c6c67
Improve 'make gimp' target a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
78 @gimp $+ && touch $@ |
471fa81c6c67
Improve 'make gimp' target a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
79 -@ls -lt $+ gimp |
1514
835360392879
Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1512
diff
changeset
|
80 |
950 | 81 # Upload only *.loc files |
1585
f1c40a6a4019
Fix and improve *.loc file uploads.
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
82 uploc: $(LOCLIST) |
2047
7b18fb64dff1
Use rsync + ssh instead of scp for uploads.
Matti Hamalainen <ccr@tnsp.org>
parents:
1858
diff
changeset
|
83 $(RSCP) $+ $(UPLOAD_URL) |
291
b78d089a0cf4
Upload target for location files only.
Matti Hamalainen <ccr@tnsp.org>
parents:
255
diff
changeset
|
84 |
950 | 85 # Fetch raw ASCII maps from bat.org to *.new |
459 | 86 fetch: |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
87 for i in $(CONT_MAPS); do wget -O "$$i.new" "$(BATMAPURL)$$i.txt"; done |
459 | 88 |
89 | |
950 | 90 # Remove all temporary .diff files |
653
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
91 cleardiff: |
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
92 $(RM) *.diff |
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
93 |
950 | 94 # 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
|
95 # Finally do 'hg diff' to show changes. |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
96 diff: cleardiff $(addsuffix .diff,$(CONT_MAPS)) |
1155
2f7ca3ec98e8
Only 'hg diff' current directory with 'make diff'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1069
diff
changeset
|
97 @hg diff . |
459 | 98 |
1623 | 99 %.js: ../%.js |
100 @ln -s $< $@ | |
101 | |
950 | 102 # Clean temporary and generated targets |
39 | 103 clean: |
937
9342d636bc21
Remove *.script files on clean target.
Matti Hamalainen <ccr@tnsp.org>
parents:
911
diff
changeset
|
104 $(RM) $(TARGETS) *.diff *.ppm *.o *.script |
39 | 105 |
106 srcclean: clean | |
299 | 107 $(RM) *~ |
39 | 108 |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
109 .changelog: update |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
110 @echo "* Making ChangeLog ..." |
1547 | 111 @hg2cl |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
112 @touch $@ |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
113 |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
114 ChangeLog: .changelog |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
115 |