【发布时间】:2018-06-17 23:29:24
【问题描述】:
我正在尝试使用 ARM (RVCT 3.1) 编译器编译文件。
makefile 看起来像这样(粘贴提取)
AS = armasm
LD = armlink
CC = armcc
TCC = armcc
#TCC = tcc
CPP = armcpp
TCPP = tcpp
AR = armar
NM = nm
ifeq ($(TERM),cygwin)
RM = rm
RM_OPT = -rf
else
RM = del
RM_OPT =
endif
# Standard CFLAGS
ENDIAN := --li
CFLAGS := -g -O2 -Otime --forceinline --cpu ARM7EJ-S $(ENDIAN) \
--apcs /interwork --fpu softvfp --fpmode ieee_fixed \
--bss_threshold=0 --split_sections \
--md --no_depend_system_headers --depend_format=unix
ASFLAGS := --keep -g --cpu ARM7EJ-S $(ENDIAN) \
--apcs /interwork \
--md
LINKFLAGS := --debug --remove --scatter $(BUILD).mem \
--map --symdefs $(BUILD).sym --keep SDK_Callback.o\(*\) \
--list linker.txt --info sizes,totals,veneers,unused \
--errors output.txt --entry SDK_Main \
--elf --output
ARFLAGS := -ru
当我运行 make 命令时,我得到一个这样的错误
Assembling SDK_Callback.s......
armasm --keep -g --cpu ARM7EJ-S --li --apcs /interwork --md -o SDK_Callback.o SDK_Callback.s
make: *** No rule to make target `C:/Program', needed by `xxx_SDK.o'. Stop.
Generating scatter loading file.
make: del: Command not found
make: [makefile:140: clean] Error 127 (ignored)
我的编译器位于“C:\Program Files\ARM” 我什至可以看到它已正确安装。
$ armcc --vsn
ARM/Thumb C/C++ Compiler, RVCT3.1 [Build 1055]
For support see http://www.arm.com/support/
Software supplied by: ARM Limited
基于 ifeq ($(TERM),cygwin) 条件,它应该检测到 shell 为 cygwin(我正在使用)并使用 rm-rf 进行删除操作,并遵循 unix 路径和行结尾。但是查看错误看起来 makefile 仍在 windows shell 下运行(使用 del 而不是 rm -rf)
cygwin 下是否有一些配置已更改或需要启用才能作为 unix shell 工作?
我已经下载了 cygwin 的整个 'devel' 部分,只是为了确保包括 'make' 和 'g++' 选项。
我还在环境变量中包含了 cygwin 路径。
我得到的另一个线索是,它曾经在我的旧系统上运行良好,但在我切换到新系统并再次安装所有东西(cygwin、编译器)后,我开始看到问题。
这是一个 cygwin 问题吗?还是makefile?
感谢任何帮助!
【问题讨论】:
-
$(info TERM = $(TERM))告诉你什么? -
更新:我将 ifeq ($(TERM),cygwin) 更改为 ifeq ($(TERM),xterm) 并且它有效,看起来终端名称在 cygwin 更新的某个时间点发生了更改。
标签: c windows makefile arm cygwin