0

我正在尝试使用 Eclipse 和 Arduino Due 在 Ubuntu 12.04 上构建代码。每次我在控制台中收到错误时 -

做所有

make: *** 没有规则来制作目标ArduinoLib5.a,需要all. 停止。

我的makefile如下:请看一下,让我知道如何修复错误。

ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 
EXECUTABLES += \
USER_OBJS \

SECONDARY_FLASH += \
ArduinoLib5.hex \

SECONDARY_LIST += \
ArduinoLib5.lst \

SECONDARY_SIZE += \
ArduinoLib5.siz \


    # All Target
    all: ArduinoLib5.a

    # Tool invocations
        @echo 'No tool found that can build the extension specified with the build artifact name $@'
    USER_OBJS: $(OBJS) $(USER_OBJS)
        @echo 'Invoking: ARM Sourcery Linux GCC C++ Linker'
        arm-none-eabi-g++ -Wl,-Map,ArduinoLib5.map -mcpu=cortex-m3 -mthumb -g -ggdb -o "USER_OBJS" $(OBJS) $(USER_OBJS) $(LIBS)
        @echo 'Finished building: $@'
        @echo ' '

    ArduinoLib5.hex: ArduinoLib5.a
        @echo 'Invoking: ARM Sourcery Linux GNU Create Flash Image'
        arm-none-eabi-objcopy -O ihex ArduinoLib5.a  "ArduinoLib5.hex"
        @echo 'Finished building: $@'
        @echo ' '

    ArduinoLib5.lst: ArduinoLib5.a
        @echo 'Invoking: ARM Sourcery Linux GNU Create Listing'
        arm-none-eabi-objdump -h -S ArduinoLib5.a > "ArduinoLib5.lst"
        @echo 'Finished building: $@'
        @echo ' '

    ArduinoLib5.siz: ArduinoLib5.a
        @echo 'Invoking: ARM Sourcery Linux GNU Print Size'
        arm-none-eabi-size  --format=berkeley ArduinoLib5.a
        @echo 'Finished building: $@'
        @echo ' '

    # Other Targets
    clean:
        -$(RM) $(OBJS)$(C_DEPS)$(SECONDARY_FLASH)$(CXX_DEPS)$(S_UPPER_DEPS)$(SECONDARY_LIST)$(C++_DEPS)$(SECONDARY_SIZE)$(ASM_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS) ArduinoLib5.a
        -@echo ' '

    .PHONY: all clean dependents
    .SECONDARY:

    -include ../makefile.targets 
4

1 回答 1

0

您确实缺少名称是ArduinoLib5.a:或当前目录中的 ArduinoLib5.a 文件的规则。

我不明白你的all规则。如果它依赖于已经存在的ArduinoLib5.a文件,它将什么都不做。如果它依赖于生成的缺失规则ArduinoLib5.a,那么它不会执行“全部”(即不通过.hex//规则) .lst.siz而只会执行该文件。此外,看看all规则的作用,我不明白$(OBJS)/$(USER_OBJS)是什么......但也许它们是 env 由 eclipse 给出的!

总的来说,你的 Makefile 在我看来完全错误。

于 2013-06-18T15:49:02.430 回答