changeset 1707:f3f7fd0d4a20

Move %.diff target to Makefile.inc
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 12 Oct 2017 11:29:21 +0300
parents bb741baa6081
children 9a124fdb6dab
files world/Makefile world/Makefile.inc
diffstat 2 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/world/Makefile	Thu Oct 12 10:58:20 2017 +0300
+++ b/world/Makefile	Thu Oct 12 11:29:21 2017 +0300
@@ -61,16 +61,6 @@
 fetch:
 	for i in $(MAPMAP); do wget -O "$$i.new" "$(BATMAPURL)$$i.txt"; done
 
-# Diff target between .map file and .new file. Makes necessary changes in .map and .loc
-%.diff: %.map %.new
-	@echo DIFFING $< ...
-	@if ! $(DIFFMAP_BIN) $+ -o $@ -a; then \
-		$(MAP2PPM_BIN) $@ -o $@.ppm -d; \
-		$(PATCHMAP_BIN) $< $@ -o $<; \
-	fi
-	@echo UPDATING LOCATIONS ...
-	@$(MKLOC_BIN) -v -m $(patsubst %.map,%.new,$<) -l $(patsubst %.map,%.loc,$<) -L -g -o $(patsubst %.map,%.nloc,$<)
-	@diff -ubB $(patsubst %.map,%.loc,$<) $(patsubst %.map,%.nloc,$<) | patch
 
 # Remove all temporary .diff files
 cleardiff:
--- a/world/Makefile.inc	Thu Oct 12 10:58:20 2017 +0300
+++ b/world/Makefile.inc	Thu Oct 12 11:29:21 2017 +0300
@@ -56,3 +56,17 @@
 
 %.png: %.ppm %.script %.desc
 	/bin/sh $(patsubst %.ppm,%.script,$<) $< $@
+
+
+###
+### Diff target between .map file and .new file. Makes necessary changes in .map and .loc
+###
+%.diff: %.map %.new
+	@echo DIFFING $< ...
+	@if ! $(DIFFMAP_BIN) $+ -o $@ -a; then \
+		$(MAP2PPM_BIN) $@ -o $@.ppm -d; \
+		$(PATCHMAP_BIN) $< $@ -o $<; \
+	fi
+	@echo UPDATING LOCATIONS ...
+	@$(MKLOC_BIN) -v -m $(patsubst %.map,%.new,$<) -l $(patsubst %.map,%.loc,$<) -L -g -o $(patsubst %.map,%.nloc,$<)
+	@diff -ubB $(patsubst %.map,%.loc,$<) $(patsubst %.map,%.nloc,$<) | patch