From bf168779a624b486eac036c707c0940e3158ea1b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 28 May 2015 23:51:38 -0400 Subject: [PATCH] Make sure targets we use node to build actually get built. --- Makefile | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index a43441053..0e98eb405 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,46 @@ # See the README for installation instructions. all: \ + $(MAKI_TARGETS) \ + $(BUILDJS_TARGETS) \ dist/iD.css \ dist/iD.js \ dist/iD.min.js \ - dist/presets.js \ - dist/imagery.js \ dist/img/line-presets.png \ dist/img/relation-presets.png -DATA_FILES = $(shell find data -type f -name '*.json' -o -name '*.md') -data/data.js: $(DATA_FILES) dist/locales/en.json dist/img/maki-sprite.png - node build.js +MAKI_TARGETS = \ + css/feature-icons.css \ + data/feature-icons.json -dist/locales/en.json: data/core.yaml data/presets.yaml +MAKI_SOURCES = \ + data/line-icons.json \ + data/relation-icons.json \ + node_modules/maki/www/maki-sprite.json \ + dist/img/maki-sprite.png + +$(MAKI_TARGETS): $(MAKI_SOURCES) + node data/maki_sprite.js + +dist/img/maki-sprite.png: ./node_modules/maki/www/images/maki-sprite.png + cp $< $@ + +BUILDJS_TARGETS = \ + data/presets/categories.json \ + data/presets/fields.json \ + data/presets/presets.json \ + data/presets.yaml \ + data/taginfo.json \ + data/data.js \ + dist/locales/en.js \ + dist/presets.js \ + dist/imagery.js + +BUILDJS_SOURCES = \ + $(filter-out $(BUILDJS_TARGETS), $(shell find data -type f -name '*.json')) \ + data/core.yaml + +$(BUILDJS_TARGETS): $(BUILDJS_SOURCES) node build.js dist/iD.js: \ @@ -77,14 +104,14 @@ dist/iD.min.js: dist/iD.js Makefile @rm -f $@ node_modules/.bin/uglifyjs $< -c -m -o $@ -dist/iD.css: css/*.css +dist/iD.css: $(MAKI_TARGETS) css/*.css cat css/reset.css css/map.css css/app.css css/feature-icons.css > $@ node_modules/.install: package.json npm install && touch node_modules/.install clean: - rm -f dist/iD*.js dist/iD.css + rm -f $(MAKI_TARGETS) $(BUILDJS_TARGETS) dist/iD*.js dist/iD.css translations: node data/update_locales @@ -104,10 +131,6 @@ dist/img/line-presets.png: svg/line-presets.svg dist/img/relation-presets.png: svg/relation-presets.svg if [ `which inkscape` ]; then $(SPRITE) --export-png=$@ $<; else echo "Inkscape is not installed"; fi; -dist/img/maki-sprite.png: ./node_modules/maki/www/images/maki-sprite.png - cp $< $@ - node data/maki_sprite - D3_FILES = \ node_modules/d3/src/start.js \ node_modules/d3/src/arrays/index.js \