不是Makefile语法
target: require_files
cmd...
为什么我遇到这个问题?
生成文件
MXMLC = /opt/flex/bin/mxmlc
MXMLC_RELEASE = $(MXMLC) -debug=false -compiler.optimize=true
release: bin-release/Wrapper.swf, bin-release/Application.swf
bin-release/Application.swf: src/**/*.as, lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Application.swf src/Application.as
@@-rm ../server/public/game/Application.swf
$(CP) bin-release/Application.swf ../server/public/game/Application.swf
bin-release/Wrapper.swf: src/*.as, src/engine/**/*.as, lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Wrapper.swf src/Wrapper.as
@@-rm ../server/public/game/Wrapper.swf
$(CP) bin-release/Wrapper.swf ../server/public/game/Wrapper.swf
$:make bin-release / Application.swf
〜/ workspace / project / src / flash [2] 19:20 make: * 没有规则要做 target
src/constant/*.as,', needed by
bin-release / Application.swf'。 停止。
答案 0 :(得分:6)
删除逗号
MXMLC = /opt/flex/bin/mxmlc
MXMLC_RELEASE = $(MXMLC) -debug=false -compiler.optimize=true
release: bin-release/Wrapper.swf bin-release/Application.swf
bin-release/Application.swf: src/**/*.as lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Application.swf src/Application.as
@@-rm ../server/public/game/Application.swf
$(CP) bin-release/Application.swf ../server/public/game/Application.swf
bin-release/Wrapper.swf: src/*.as src/engine/**/*.as lib/*.swc
$(MXMLC_RELEASE) -output bin-release/Wrapper.swf src/Wrapper.as
@@-rm ../server/public/game/Wrapper.swf
$(CP) bin-release/Wrapper.swf ../server/public/game/Wrapper.swf
答案 1 :(得分:2)
您可以使用find
找到文件,例如:
ASFILES = $(shell find src -name "*.as")
SWCFILES = $(shell find lib -name "*.swc")
然后使用规则中的列表:
bin-release/Application.swf: $(ASFILES) $(SWCFILES)
$(MXMLC_RELEASE) etc
我想你会使用配方中的.as
和.swc
文件(即$(MXMLC_RELEASE)
位),尽管你当前没有。