use the make automatic variable @D for the target directory name

This commit is contained in:
Brian Gough 2018-02-23 11:43:10 +00:00
parent d364bfc353
commit 42b701fd34

View file

@ -26,31 +26,32 @@ SHAREJS_COFFEE_FILES := \
LESS_FILES := $(shell find public/stylesheets -name '*.less') LESS_FILES := $(shell find public/stylesheets -name '*.less')
CSS_FILES := public/stylesheets/style.css public/stylesheets/ol-style.css CSS_FILES := public/stylesheets/style.css public/stylesheets/ol-style.css
# The automatic variable $(@D) is the target directory name
app.js: app.coffee app.js: app.coffee
$(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $< $(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $<
app/js/%.js: app/coffee/%.coffee app/js/%.js: app/coffee/%.coffee
@mkdir -p $(dir $@) @mkdir -p $(@D)
$(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $< $(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $<
public/js/%.js: public/coffee/%.coffee public/js/%.js: public/coffee/%.coffee
@mkdir -p $(dir $@) @mkdir -p $(@D)
$(COFFEE) $(COFFEE_OPTIONS) --output $(dir $@) --map --compile $< $(COFFEE) $(COFFEE_OPTIONS) --output $(@D) --map --compile $<
test/unit/js/%.js: test/unit/coffee/%.coffee test/unit/js/%.js: test/unit/coffee/%.coffee
@mkdir -p $(dir $@) @mkdir -p $(@D)
$(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $< $(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $<
test/acceptance/js/%.js: test/acceptance/coffee/%.coffee test/acceptance/js/%.js: test/acceptance/coffee/%.coffee
@mkdir -p $(dir $@) @mkdir -p $(@D)
$(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $< $(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $<
test/unit_frontend/js/%.js: test/unit_frontend/coffee/%.coffee test/unit_frontend/js/%.js: test/unit_frontend/coffee/%.coffee
@mkdir -p $(dir $@) @mkdir -p $(@D)
$(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $< $(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $<
test/smoke/js/%.js: test/smoke/coffee/%.coffee test/smoke/js/%.js: test/smoke/coffee/%.coffee
@mkdir -p $(dir $@) @mkdir -p $(@D)
$(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $< $(COFFEE) $(COFFEE_OPTIONS) --compile -o $(@D) $<
public/js/libs/sharejs.js: $(SHAREJS_COFFEE_FILES) public/js/libs/sharejs.js: $(SHAREJS_COFFEE_FILES)
@ -95,7 +96,6 @@ $(CSS_FILES): $(LESS_FILES)
minify: $(CSS_FILES) $(JS_FILES) minify: $(CSS_FILES) $(JS_FILES)
$(GRUNT) compile:minify $(GRUNT) compile:minify
css: $(CSS_FILES) css: $(CSS_FILES)
compile: $(JS_FILES) css public/js/libs/sharejs.js public/js/main.js public/js/ide.js compile: $(JS_FILES) css public/js/libs/sharejs.js public/js/main.js public/js/ide.js