Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C GNU make在makefile完成之前停止,没有错误_C_Eclipse_Makefile_Arm_Gnu Arm - Fatal编程技术网

C GNU make在makefile完成之前停止,没有错误

C GNU make在makefile完成之前停止,没有错误,c,eclipse,makefile,arm,gnu-arm,C,Eclipse,Makefile,Arm,Gnu Arm,早上好, 我试图在Windows7下使用Eclipse和GNU Arm工具链交叉编译Atmel AT92SAM 我的问题是,构建过程在链接器完成后停止,尽管它还应该创建一个原始二进制文件并打印大小。 以下是eclipse创建的makefile的摘录: # All Target all: main.exe # Tool invocations main.exe: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Inv

早上好, 我试图在Windows7下使用Eclipse和GNU Arm工具链交叉编译Atmel AT92SAM

我的问题是,构建过程在链接器完成后停止,尽管它还应该创建一个原始二进制文件并打印大小。 以下是eclipse创建的makefile的摘录:

# All Target
all: main.exe

# Tool invocations
main.exe: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: Cross ARM C Linker'
    arm-none-eabi-gcc -mcpu=arm7tdmi -mthumb -O0 -fsigned-char -ffunction-sections  -g -Xlinker --gc-sections -Wl,-Map,"main.map" --entry=0x00000000 -o "main.exe" $(OBJS) $(USER_OBJS) $(LIBS)
    @echo 'Finished building target: $@'
    @echo ' '

main.bin: main.exe
    @echo 'Invoking: Cross ARM GNU Create Flash Image'
    arm-none-eabi-objcopy -O binary "main.exe"  "main.bin"
    @echo 'Finished building: $@'
    @echo ' '

main.siz: main.exe
    @echo 'Invoking: Cross ARM GNU Print Size'
    arm-none-eabi-size --format=berkeley "main.exe"
    @echo 'Finished building: $@'
    @echo ' '
但不执行最后两个命令,也不创建.bin。命令行输出为

...
Finished building: ../src/main.c

Building file: ../.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=arm7tdmi -mthumb -O0 -fsigned-char -ffunction-sections  -g -DTRACE_LEVEL=4 -Dflash -Dat91sam7x512  -I"[My includes] -std=gnu99 -MMD -MP -MF".metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.d" -MT".metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.o" -c -o ".metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.o" "../.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.c"
Finished building: ../.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.c

Building file: ../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=arm7tdmi -mthumb -O0 -fsigned-char -ffunction-sections  -g -DTRACE_LEVEL=4 -Dflash -Dat91sam7x512 -I"[my includes]" -std=gnu99 -MMD -MP -MF".metadata/.plugins/org.eclipse.cdt.make.core/specs.d" -MT".metadata/.plugins/org.eclipse.cdt.make.core/specs.o" -c -o ".metadata/.plugins/org.eclipse.cdt.make.core/specs.o" "../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c"
Finished building: ../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c

Building target: main.exe
Invoking: Cross ARM C Linker
arm-none-eabi-gcc -mcpu=arm7tdmi -mthumb -O0 -fsigned-char -ffunction-sections  -g -Xlinker --gc-sections -Wl,-Map,"main.map" --entry=0x00000000 -o "main.exe"  [my object files]  ./.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.o  ./.metadata/.plugins/org.eclipse.cdt.make.core/specs.o   -lm
Finished building target: main.exe


08:31:22 Build Finished (took 10s.91ms)
如您所见,不会调用objcopy和size命令。
有什么想法吗?

您可以直接在
main.exe
配方中添加大小,因为
main.siz
不是真正的输出文件(应该是
.PHONY
):

all:main.bin
main.exe:$(OBJS)$(用户_OBJS)
@echo“构建目标:$@”
@echo“调用:交叉臂C链接器”
arm none eabi gcc-mcpu=arm7tdmi-mthumb-O0-fsigned char-fffunction sections-g-Xlinker-gc sections-Wl,-Map,“main.Map”--entry=0x00000000-o“$@”$(OBJS)$(USER_OBJS)$(LIBS)
arm none eabi大小--格式=伯克利“$@”
@echo“已完成构建目标:$@”
main.bin:main.exe
@echo“调用:跨臂GNU创建闪存映像”

arm none eabi objcopy-O binary“$您可以直接在
main.exe
配方中添加大小,因为
main.siz
不是真正的输出文件(应该是
.PHONY
):

all:main.bin
main.exe:$(OBJS)$(用户_OBJS)
@echo“构建目标:$@”
@echo“调用:交叉臂C链接器”
arm none eabi gcc-mcpu=arm7tdmi-mthumb-O0-fsigned char-fffunction sections-g-Xlinker-gc sections-Wl,-Map,“main.Map”--entry=0x00000000-o“$@”$(OBJS)$(USER_OBJS)$(LIBS)
arm none eabi大小--格式=伯克利“$@”
@echo“已完成构建目标:$@”
main.bin:main.exe
@echo“调用:跨臂GNU创建闪存映像”

arm none eabi objcopy-O二进制文件“$您是在调用“make”还是“make all”?如果是这样的话,它所做的正是您的“所有”目标告诉它的…
all:main.bin main.siz
您是对的。。显然eclipse选项设置不正确。您只是调用“make”还是“makeall”?如果是这样的话,它所做的正是您的“所有”目标告诉它的…
all:main.bin main.siz
您是对的。。显然,eclipse选项设置不正确。
all: main.bin

main.exe: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: Cross ARM C Linker'
    arm-none-eabi-gcc -mcpu=arm7tdmi -mthumb -O0 -fsigned-char -ffunction-sections  -g -Xlinker --gc-sections -Wl,-Map,"main.map" --entry=0x00000000 -o "$@" $(OBJS) $(USER_OBJS) $(LIBS)
    arm-none-eabi-size --format=berkeley "$@"
    @echo 'Finished building target: $@'

main.bin: main.exe
    @echo 'Invoking: Cross ARM GNU Create Flash Image'
    arm-none-eabi-objcopy -O binary "$<" "$@"
    @echo 'Finished building: $@'