我有這個makefile:生成文件的源文件的更新不會傳播到目標
jade = ./node_modules/.bin/jade
nlz = ./node_modules/.bin/nlz
build: build/index.js build/index.css build/index.html build/docs.html
build/index.js: $(find client/*.js)
$(nlz) build client/index.js
build/index.css: $(find client/*.css)
$(nlz) build client/index.css
build/index.html: pages/home.jade pages/layout.jade
$(jade) --path pages/home.jade <pages/home.jade> build/index.html
build/docs.html: pages/docs.jade pages/layout.jade
$(jade) --path pages/docs.jade <pages/docs.jade> build/docs.html
node_modules:
npm install
clean:
rm -rf build
.PHONY: clean
然而,當我更新.js
或.css
文件之一,打字make build
給我make: Nothing to be done for
build'.`。我究竟做錯了什麼?
你應該加上'build'到'.PHONY'目標清單。 – arkascha
然後我失去了makefile的好處。絕對可怕的建議 –