我在PHP项目中获得了这个Makefile(这是从完整的Makefile中删除的)。如何更改此设置,以便automake检测到public/assets/styles/main.scss
已更改&重新运行sass?
all: public/assets/styles/styles.css
public/assets/styles/styles.css:
sass public/assets/styles/main.scss > public/assets/styles/styles.css
答案 0 :(得分:1)
Simply make the .scss
file a prerequisite of your .css
target. As a bonus, avoid repetition of your base path and use automatic variables to make the recipe less redundant:
STYLEDIR := public/assets/styles
all: $(STYLEDIR)/styles.css
$(STYLEDIR)/styles.css: $(STYLEDIR)/main.scss
sass $< > $@