Eclipse没有正确调用子makefile

时间:2015-01-09 12:10:46

标签: c++ eclipse makefile arm

我正在尝试将单个makefile项目重构为层次结构。该项目在Eclipse中导入为“带有makefile的外部C / C ++项目”。

带有单独makefile的新文件夹包含源文件和带有以下配方的makefile:

.PHONY: test
test:
    echo "test"

顶级目录包含顶级makefile,其中包含以下配方:

clean:
    @ echo ...cleaning
    cd CppAudioPeriphs && make test
    rm -f $(OBJECTS) $(NAME).lst $(NAME).elf $(NAME).bin $(NAME).s19 $(NAME).map $(NAME).dmp

当我从Eclipse Clean project打电话时,最后一个收件人的最后一行显然正确完成。但是,要求转到子目录并执行make clean的行返回以下消息:

make[1]: `build/PeriphPhysical.o' is up to date.

这是声明的第一个目标文件,即使配方test不存在,消息也是相同的。

另一方面,从命令行开始,一切正常。 Id est open cmd.exe,转到项目文件夹,输入make clean - > “echo test”命令被执行。

我正在使用为Windows编译的gcc和binutils,用于arm的交叉编译。哪里可能是我的问题。


编辑:回应 jimmy

这些可能是额外的线索。

1)如果我更换

    cd CppAudioPeriphs && "make test"

    cd CppAudioPeriphs && C:\arm_tools\tools\bin\make.exe test

,结果是:

/usr/bin/sh: C:arm_toolstoolsbinmake.exe: command not found

如果我将斜杠更改为正斜杠,则“build / PeriphPhysical.o”的旧消息是最新的。弹回。

1 个答案:

答案 0 :(得分:0)

代替

cd CppAudioPeriphs && C:\arm_tools\tools\bin\make.exe test

make -C CppAudioPeriphs test

作为一种解决方法,现在一切都在编译。