1
這裏是我的Makefile中,我試圖用make來連接/運行如下我的JS腳本:模式規則似乎被忽略
all: myproject.js
JS_TARGETS = file1.js file2.js
JS_MINIFIED = $(JS_TARGETS:.js=.min.js)
# I use addprefix because my files are in a js/ directory
myproject.js: $(addprefix js/, $(JS_MINIFIED)) $(addprefix js/, $(JS_TARGETS))
cat $^ >[email protected]
# Minification + new line
%.min.js: %.js
uglifyjs -o $< [email protected]
echo >> $<
clean:
rm -f myproject.js
.PHONY: clean