planet-maps
Version:
Custom builds of OpenLayers 3
32 lines (24 loc) • 699 B
Plain Text
.DELETE_ON_ERROR:
export PATH := ./node_modules/.bin:$(PATH)
BUILD_DIR = ./dist
CONFIG_DIR = ./config
OL_DIR = ./node_modules/openlayers
CONFIGS := $(shell find $(CONFIG_DIR) -name '*.json')
BUILDS := $(patsubst $(CONFIG_DIR)/%.json,$(BUILD_DIR)/%.js,$(CONFIGS))
build-all: $(BUILDS) $(BUILD_DIR)/ol.css
clean:
@rm -rf $(BUILD_DIR)
$(BUILD_DIR)/%.js: $(CONFIG_DIR)/%.json node_modules/.install
@echo "Building $@"
@mkdir -p $(BUILD_DIR)
@node $(OL_DIR)/tasks/build.js $< $@
$(BUILD_DIR)/ol.css: node_modules/.install
@mkdir -p $(BUILD_DIR)
@cp $(OL_DIR)/css/ol.css $@
node_modules/.install: package.json
@npm prune
@npm install
@npm dedupe
@touch $@