Mercurial > hg > batmud > maputils
annotate maps/Makefile @ 1237:3bbafec29fcb
Change internal handling of some Makefile settings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 23 Aug 2011 16:21:57 +0300 |
parents | bc4e47cf3090 |
children | 031708e1dcb9 |
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 |
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
4 # |
347 | 5 # Mangles and targets |
346
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
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 .htm,$(MAPLIST)) \ |
3bbafec29fcb
Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1226
diff
changeset
|
9 $(addsuffix .ansi,$(MAPLIST)) \ |
3bbafec29fcb
Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1226
diff
changeset
|
10 $(addsuffix .png,$(MAPLIST)) |
346
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
11 |
842
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
12 all: |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
13 @echo "Usage: make <maps|fetch|diff|upload>" |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
14 @echo |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
15 @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
|
16 @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
|
17 @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
|
18 @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
|
19 @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
|
20 @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
|
21 @echo " ../config.mak" |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
22 |
f5dda74e6e07
Print help if no target is given. Remove generation of worldmap.
Matti Hamalainen <ccr@tnsp.org>
parents:
807
diff
changeset
|
23 |
1237
3bbafec29fcb
Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1226
diff
changeset
|
24 maps: $(addsuffix .ppm,$(MAPLIST)) $(TARGETS) |
39 | 25 |
346
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
26 |
307 | 27 #laenor.map: |
28 # cat ~/mapping.log | grep -v "^$$" > tmp | |
29 # $(MKSPECIAL_BIN) -v -o $@ -r 100 -R 65 -m 40 tmp -a -d -I $(patsubst %.map,%.initial,$@) | |
215 | 30 |
346
721bfe123726
Minor refactoring of the build files.
Matti Hamalainen <ccr@tnsp.org>
parents:
338
diff
changeset
|
31 include Makefile.inc |
99 | 32 |
950 | 33 ### |
34 ### Special targets | |
35 ### | |
36 | |
37 # Upload changed files to site | |
1226 | 38 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
|
39 scp -C $? $(UPURL) |
141 | 40 touch $@ |
95
0d2b25e342df
Also make PNG images from maps
Matti Hamalainen <ccr@tnsp.org>
parents:
90
diff
changeset
|
41 |
950 | 42 # Upload only *.loc files |
317 | 43 uploc: *.loc |
800 | 44 scp $+ $(UPURL) |
291
b78d089a0cf4
Upload target for location files only.
Matti Hamalainen <ccr@tnsp.org>
parents:
255
diff
changeset
|
45 |
950 | 46 # Fetch raw ASCII maps from bat.org to *.new |
459 | 47 fetch: |
1237
3bbafec29fcb
Change internal handling of some Makefile settings.
Matti Hamalainen <ccr@tnsp.org>
parents:
1226
diff
changeset
|
48 for i in $(MAPMAP); do wget -O "$$i.new" "$(BATMAPURL)$$i.txt"; done |
459 | 49 |
950 | 50 # Diff target between .map file and .new file. Makes necessary changes in .map and .loc |
459 | 51 %.diff: %.map %.new |
670
8f16bf5c2f9e
Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
52 @echo DIFFING $< ... |
8f16bf5c2f9e
Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
53 @if ! $(DIFFMAP_BIN) $+ -o $@ -a; then \ |
8f16bf5c2f9e
Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
54 $(MAP2PPM_BIN) $@ -o $@.ppm -d; \ |
8f16bf5c2f9e
Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
55 $(PATCHMAP_BIN) $< $@ -o $<; \ |
8f16bf5c2f9e
Do the diffs more intelligently.
Matti Hamalainen <ccr@tnsp.org>
parents:
653
diff
changeset
|
56 fi |
674
02d23acc346d
Fix updating of location markers.
Matti Hamalainen <ccr@tnsp.org>
parents:
672
diff
changeset
|
57 @echo UPDATING LOCATIONS ... |
798
11e3bed89e35
Use verbosity flag in accordance to changes in mkloc.
Matti Hamalainen <ccr@tnsp.org>
parents:
791
diff
changeset
|
58 @$(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
|
59 @diff -ubB $(patsubst %.map,%.loc,$<) $(patsubst %.map,%.nloc,$<) | patch |
459 | 60 |
950 | 61 # Remove all temporary .diff files |
653
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
62 cleardiff: |
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
63 $(RM) *.diff |
b5bd0d457481
Improved 'make diff' target.
Matti Hamalainen <ccr@tnsp.org>
parents:
605
diff
changeset
|
64 |
950 | 65 # 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
|
66 # 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
|
67 diff: cleardiff $(addsuffix .diff,$(MAPMAP)) |
1155
2f7ca3ec98e8
Only 'hg diff' current directory with 'make diff'.
Matti Hamalainen <ccr@tnsp.org>
parents:
1069
diff
changeset
|
68 @hg diff . |
459 | 69 |
950 | 70 # Clean temporary and generated targets |
39 | 71 clean: |
937
9342d636bc21
Remove *.script files on clean target.
Matti Hamalainen <ccr@tnsp.org>
parents:
911
diff
changeset
|
72 $(RM) $(TARGETS) *.diff *.ppm *.o *.script |
39 | 73 |
74 srcclean: clean | |
299 | 75 $(RM) *~ |
39 | 76 |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
77 update: |
1069
25cf3cf2acc8
Change to use Mercurial instead of Subversion.
Matti Hamalainen <ccr@tnsp.org>
parents:
950
diff
changeset
|
78 @echo "* Updating from HG ..." |
25cf3cf2acc8
Change to use Mercurial instead of Subversion.
Matti Hamalainen <ccr@tnsp.org>
parents:
950
diff
changeset
|
79 @hg fetch |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
80 |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
81 .changelog: update |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
82 @echo "* Making ChangeLog ..." |
1069
25cf3cf2acc8
Change to use Mercurial instead of Subversion.
Matti Hamalainen <ccr@tnsp.org>
parents:
950
diff
changeset
|
83 @hg2cl --strip-prefix "maputils/trunk/maps/" |
297
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
84 @touch $@ |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
85 |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
86 ChangeLog: .changelog |
5482736f3913
ChangeLog generation target added.
Matti Hamalainen <ccr@tnsp.org>
parents:
291
diff
changeset
|
87 |