使用make“无法制定目标”的原因?

时间:2012-04-05 11:26:11

标签: makefile

不是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'。   停止。

2 个答案:

答案 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)位),尽管你当前没有。