3

不是 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

$: 制作 bin-release/Application.swf

~/workspace/project/src/flash [2]19:20 make: *没有规则来制作目标src/constant/*.as,', needed bybin-release/Application.swf'。停止。

4

2 回答 2

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
于 2012-04-05T11:28:11.783 回答
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)

于 2012-04-05T15:07:19.457 回答