2

全部,

我正在尝试修改 Makefile 以使用嵌入式交叉编译器而不是 PC 的编译器。Makfile 没有正常的 CC 或 CXX 变量。事实上,它似乎调用了另一个带有变量'@${MAKE}'的makefile。如何覆盖“@${MAKE}”变量以强制 makefile 使用不同的编译器?

提前致谢,

# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help

ifndef config
config=debug
endif
export config

    PROJECTS := json openjaus

.PHONY: all clean help $(PROJECTS)

all: $(PROJECTS)

json: 
@echo "==== Building json ($(config)) ===="
@${MAKE} --no-print-directory -C .build -f json.make

openjaus: json
    @echo "==== Building openjaus ($(config)) ===="
    @${MAKE} --no-print-directory -C .build -f openjaus.make

我根据 Rob 的评论编辑了 Makefile,现在我收到以下消息,不知道该怎么办?

make[1]: Nothing to be done for `/home/botbear/openwrt/trunk/staging_dir/toolchain-arm_v6k_gcc-linaro_uClibc-0.9.32_eabi/bin/arm-openwrt-linux-uclibcgnueabi-g++'.
4

1 回答 1

2

You'd have to look inside json.make and openjaus.make to see how they build programs. If they use the conventional variables, you might be able to do something like:

${MAKE} CC=/usr/bin/gcc-arm CXX=/usr/bin/g++-arm --no-parent-directory ...
于 2012-05-10T20:04:31.520 回答