Mercurial > hg > batmud > maputils
annotate world/Makefile @ 2408:f2e639d72f6f
Rename batclient.xml to markers.xml
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Nov 2021 11:02:23 +0200 |
parents | b76c25ad1b99 |
children | d682dfca2ca9 |
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 ### |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
5 ### Detect if we have some things |
2388 | 6 ### |
7 HAVE_CURL ?= $(shell curl --version > /dev/null && echo "yes") | |
8 HAVE_WGET ?= $(shell wget --version > /dev/null && echo "yes") | |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
9 HAVE_PHP ?= $(shell php --version > /dev/null && echo "yes") |
2388 | 10 |
11 ifeq ($(HAVE_CURL),yes) | |
12 HTTPGET ?= curl -o | |
13 else | |
14 ifeq ($(HAVE_WGET),yes) | |
15 HTTPGET ?= wget -O | |
16 else | |
17 ifeq ($(HTTPGET),) | |
18 $(error Required utility 'curl' or 'wget' not found in PATH. You can configure HTTPGET variable in config.mak.) | |
19 endif | |
20 endif | |
21 endif | |
22 | |
23 | |
24 ### | |
1547 | 25 ### Main targets |
26 ### | |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
27 TARGETS = \ |
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
28 $(addsuffix .html,$(WORLD_MAPS)) \ |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
29 $(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
|
30 $(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
|
31 $(addsuffix .htm,$(WORLD_MAPS)) \ |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
32 util.js changelog.txt |
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
33 |
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
34 LOCFILES = $(addsuffix .loc,$(WORLD_MAPS)) special.loc limbo.loc |
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
35 |
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
36 ifeq ($(HAVE_PHP),yes) |
2408
f2e639d72f6f
Rename batclient.xml to markers.xml
Matti Hamalainen <ccr@tnsp.org>
parents:
2397
diff
changeset
|
37 TARGETS += markers.xml |
f2e639d72f6f
Rename batclient.xml to markers.xml
Matti Hamalainen <ccr@tnsp.org>
parents:
2397
diff
changeset
|
38 EXTRA_UPLOAD += markers.xml |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
39 endif |
1536
796cf56a9b0a
Disable plain HTML (non-javascript enhanced) versions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1515
diff
changeset
|
40 |
796cf56a9b0a
Disable plain HTML (non-javascript enhanced) versions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1515
diff
changeset
|
41 |
1547 | 42 ### |
43 ### If no target specified, show some help | |
44 ### | |
842
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
45 all: |
2067 | 46 @echo "Usage: make <target>" |
47 @echo "Available targets are as follows:" | |
48 @echo | |
49 @echo "maps : Build HTML, HTML+JS, PNG image and ANSI format maps." | |
50 @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
|
51 @echo |
2067 | 52 @echo "diff : Do special diff operation between new data (gotten via 'fetch')" |
53 @echo " and update .loc files for each continent with new locations." | |
54 @echo " A diff -u of new and old location files is outputted." | |
55 @echo | |
56 @echo "upload : Uploads map and loc-files via SCP to server specified in" | |
57 @echo " ../config.mak" | |
58 @echo | |
59 @echo "gimp : Execute Gimp with all PNG targets for post-processing." | |
60 @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
|
61 @echo "changelog : Build changelog for map and location changes only." |
1512 | 62 @echo |
842
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
63 |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
64 |
1547 | 65 ### |
66 ### Maps | |
67 ### | |
1708
9a124fdb6dab
Rename various Makefile variables and improve + modularize hcbat-related things better.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
68 maps: $(addsuffix .ppm,$(WORLD_MAPS)) $(TARGETS) |
39 | 69 |
1547 | 70 include Makefile.inc |
346
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
71 |
2317
f90303eec665
Include misc maps in generated changelog as well.
Matti Hamalainen <ccr@tnsp.org>
parents:
2315
diff
changeset
|
72 |
950 | 73 ### |
74 ### Special targets | |
75 ### | |
2317
f90303eec665
Include misc maps in generated changelog as well.
Matti Hamalainen <ccr@tnsp.org>
parents:
2315
diff
changeset
|
76 changelog.txt: $(addsuffix .map,$(WORLD_MAPS)) \ |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
77 $(LOCFILES) \ |
2317
f90303eec665
Include misc maps in generated changelog as well.
Matti Hamalainen <ccr@tnsp.org>
parents:
2315
diff
changeset
|
78 $(addprefix ../$(MISC_MAPS_PATH),$(addsuffix .map,$(MISC_MAPS))) \ |
f90303eec665
Include misc maps in generated changelog as well.
Matti Hamalainen <ccr@tnsp.org>
parents:
2315
diff
changeset
|
79 $(addprefix ../$(MISC_MAPS_PATH),$(addsuffix .loc,$(MISC_MAPS))) |
2069
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
80 @( 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
|
81 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
|
82 '<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
|
83 echo '</log>' ) | \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
84 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
|
85 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
|
86 --stringparam linelen 80 \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
87 --stringparam groupbyday yes \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
88 --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
|
89 "svn2cl.xsl" - | \ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
90 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
|
91 > $@ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
92 |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
93 # Build changelog |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
94 changelog: changelog.txt |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
95 @touch $@ |
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
96 |
2408
f2e639d72f6f
Rename batclient.xml to markers.xml
Matti Hamalainen <ccr@tnsp.org>
parents:
2397
diff
changeset
|
97 # Build Batclient markers.xml |
f2e639d72f6f
Rename batclient.xml to markers.xml
Matti Hamalainen <ccr@tnsp.org>
parents:
2397
diff
changeset
|
98 markers.xml: $(addsuffix .loc,$(WORLD_MAPS)) $(MKLOC_BIN) ../www/world.inc.php |
2395
42ee2079a69d
Rename generate_batclient_xml.php to genbcxml.php
Matti Hamalainen <ccr@tnsp.org>
parents:
2388
diff
changeset
|
99 php ../src/genbcxml.php $(MKLOC_BIN) ./ ../www/world.inc.php $@ |
2387
53c34aaf4515
Add PHP kludge for generating batclient.xml and necessary Makefile rules for
Matti Hamalainen <ccr@tnsp.org>
parents:
2369
diff
changeset
|
100 |
2069
d0e00cd7b2a5
Add make target for building changelog.txt, that contains cleaned up
Matti Hamalainen <ccr@tnsp.org>
parents:
2067
diff
changeset
|
101 |
950 | 102 # Upload changed files to site |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
103 upload: $(TARGETS) $(LOCFILES) $(EXTRA_UPLOAD) |
2047
7b18fb64dff1
Use rsync + ssh instead of scp for uploads.
Matti Hamalainen <ccr@tnsp.org>
parents:
1858
diff
changeset
|
104 $(RSCP) $? $(UPLOAD_URL) |
1623 | 105 @touch $@ |
95
0d2b25e342df
Also make PNG images from maps
Matti Hamalainen <ccr@tnsp.org>
parents:
90
diff
changeset
|
106 |
1514
835360392879
Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1512
diff
changeset
|
107 # 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
|
108 gimp: $(addsuffix .png,$(WORLD_MAPS)) |
1621
471fa81c6c67
Improve 'make gimp' target a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
109 -@ls -lt $+ gimp |
471fa81c6c67
Improve 'make gimp' target a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
110 @gimp $+ && touch $@ |
471fa81c6c67
Improve 'make gimp' target a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
111 -@ls -lt $+ gimp |
1514
835360392879
Add target for automatically running Gimp for PNG post-processing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1512
diff
changeset
|
112 |
950 | 113 # Upload only *.loc files |
2397
b76c25ad1b99
Change how batclient.xml is uploaded. Some improvements to the build rules.
Matti Hamalainen <ccr@tnsp.org>
parents:
2395
diff
changeset
|
114 uploc: $(LOCFILES) $(EXTRA_UPLOAD) |
2047
7b18fb64dff1
Use rsync + ssh instead of scp for uploads.
Matti Hamalainen <ccr@tnsp.org>
parents:
1858
diff
changeset
|
115 $(RSCP) $+ $(UPLOAD_URL) |
291
b78d089a0cf4
Upload target for location files only.
Matti Hamalainen <ccr@tnsp.org>
parents:
255
diff
changeset
|
116 |
950 | 117 # Fetch raw ASCII maps from bat.org to *.new |
459 | 118 fetch: |
2369 | 119 @for AMAP in $(CONT_MAPS); do echo "Fetching $${AMAP}.new"; $(HTTPGET) "$${AMAP}.new" "$(BATMAPURL)$${AMAP}.txt"; done |
459 | 120 |
121 | |
950 | 122 # Remove all temporary .diff files |
653
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
123 cleardiff: |
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
124 $(RM) *.diff |
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
125 |
950 | 126 # 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
|
127 # 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
|
128 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
|
129 @hg diff . |
459 | 130 |
2348
6ef9445390d2
Move Javascript files under src/ too.
Matti Hamalainen <ccr@tnsp.org>
parents:
2318
diff
changeset
|
131 %.js:: ../src/%.js |
1623 | 132 @ln -s $< $@ |
133 | |
950 | 134 # Clean temporary and generated targets |
39 | 135 clean: |
937
9342d636bc21
Remove *.script files on clean target.
Matti Hamalainen <ccr@tnsp.org>
parents:
911
diff
changeset
|
136 $(RM) $(TARGETS) *.diff *.ppm *.o *.script |
39 | 137 |
138 srcclean: clean | |
299 | 139 $(RM) *~ |
39 | 140 |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
141 .changelog: update |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
142 @echo "* Making ChangeLog ..." |
1547 | 143 @hg2cl |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
144 @touch $@ |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
145 |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
146 ChangeLog: .changelog |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
147 |