没有制定目标的规则,.elf 需要
No rule to make target, needed by .elf
我是新手,在构建我为 arduino 编写的代码时遇到问题。当我尝试构建版本时,它完成了构建,但尽管出现了错误:
make: *** No rule to make target `/home/jonas/Dokumente/Studium/7.', needed by `test123.elf'.
我完全不知道我能做些什么来修复这个错误
这就是我的 makefile 的样子
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include arduino/core/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_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
endif
-include ../makefile.defs`enter code here`
# Add inputs and outputs from these tool invocations to the build variables
AR += \
/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar \
ELF += \
test123.elf \
EEP += \
test123.eep \
FLASH_IMAGE += \
test123.hex \
# All Target
all: test123
# Tool invocations
test123: $(FLASH_IMAGE)
@echo 'Building target: $@'
@echo 'Printing size:'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-size" -A "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building target: $@'
@echo ' '
/home/jonas/Dokumente/Studium/7.\ Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar: $(AR_OBJ)
@echo 'Starting archiver'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-ar" rcs "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" $(AR_OBJ)
@echo 'Finished building: $@'
@echo ' '
test123.elf: $(LINK_OBJ) $(AR)
@echo 'Starting combiner'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-gcc" -Os -Wl,--gc-sections -mmcu=atmega328p -o "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" $(LINK_OBJ) $(AR) "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" "-L/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release" -lm
@echo 'Finished building: $@'
@echo ' '
test123.eep: $(ELF)
@echo 'Create eeprom image'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/home/jonas/Dokumente/Studium/7. Semester/Projekt /Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.eep"
@echo 'Finished building: $@'
@echo ' '
test123.hex: $(EEP)
@echo 'Create Flash image (ihex format)'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(ELF)$(C++_DEPS)$(AR)$(C_DEPS)$(CC_DEPS)$(FLASH_IMAGE)$(AR_OBJ)$(CPP_DEPS)$(LINK_OBJ)$(EEP)$(CXX_DEPS)$(C_UPPER_DEPS)$(SIZEDUMMY) test123
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include arduino/core/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_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
endif
-include ../makefile.defs`enter code here`
# Add inputs and outputs from these tool invocations to the build variables
AR += \
/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar \
ELF += \
test123.elf \
EEP += \
test123.eep \
FLASH_IMAGE += \
test123.hex \
# All Target
all: test123
# Tool invocations
test123: $(FLASH_IMAGE)
@echo 'Building target: $@'
@echo 'Printing size:'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-size" -A "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building target: $@'
@echo ' '
/home/jonas/Dokumente/Studium/7.\ Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar: $(AR_OBJ)
@echo 'Starting archiver'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-ar" rcs "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" $(AR_OBJ)
@echo 'Finished building: $@'
@echo ' '
test123.elf: $(LINK_OBJ) $(AR)
@echo 'Starting combiner'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-gcc" -Os -Wl,--gc-sections -mmcu=atmega328p -o "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" $(LINK_OBJ) $(AR) "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" "-L/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release" -lm
@echo 'Finished building: $@'
@echo ' '
test123.eep: $(ELF)
@echo 'Create eeprom image'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/home/jonas/Dokumente/Studium/7. Semester/Projekt /Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123 /Release/test123.eep"
@echo 'Finished building: $@'
@echo ' '
test123.hex: $(EEP)
@echo 'Create Flash image (ihex format)'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk /Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(ELF)$(C++_DEPS)$(AR)$(C_DEPS)$(CC_DEPS)$(FLASH_IMAGE)$(AR_OBJ)$(CPP_DEPS)$(L INK_OBJ)$(EEP)$(CXX_DEPS)$(C_UPPER_DEPS)$(SIZEDUMMY) test123
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
非常感谢您的帮助。
您不能在 makefile 中正确使用带有 space 的路径。它不会起作用。
你试图逃离 space 并没有如你所愿。
您通常也不应该使用这样的文件的完整路径。
这使得移动 makefile/directory(或在其他机器上使用它)变得不必要地困难。
只使用相对于当前目录的路径。
我是新手,在构建我为 arduino 编写的代码时遇到问题。当我尝试构建版本时,它完成了构建,但尽管出现了错误:
make: *** No rule to make target `/home/jonas/Dokumente/Studium/7.', needed by `test123.elf'.
我完全不知道我能做些什么来修复这个错误
这就是我的 makefile 的样子
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include arduino/core/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_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
endif
-include ../makefile.defs`enter code here`
# Add inputs and outputs from these tool invocations to the build variables
AR += \
/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar \
ELF += \
test123.elf \
EEP += \
test123.eep \
FLASH_IMAGE += \
test123.hex \
# All Target
all: test123
# Tool invocations
test123: $(FLASH_IMAGE)
@echo 'Building target: $@'
@echo 'Printing size:'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-size" -A "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building target: $@'
@echo ' '
/home/jonas/Dokumente/Studium/7.\ Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar: $(AR_OBJ)
@echo 'Starting archiver'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-ar" rcs "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" $(AR_OBJ)
@echo 'Finished building: $@'
@echo ' '
test123.elf: $(LINK_OBJ) $(AR)
@echo 'Starting combiner'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-gcc" -Os -Wl,--gc-sections -mmcu=atmega328p -o "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" $(LINK_OBJ) $(AR) "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" "-L/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release" -lm
@echo 'Finished building: $@'
@echo ' '
test123.eep: $(ELF)
@echo 'Create eeprom image'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/home/jonas/Dokumente/Studium/7. Semester/Projekt /Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.eep"
@echo 'Finished building: $@'
@echo ' '
test123.hex: $(EEP)
@echo 'Create Flash image (ihex format)'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(ELF)$(C++_DEPS)$(AR)$(C_DEPS)$(CC_DEPS)$(FLASH_IMAGE)$(AR_OBJ)$(CPP_DEPS)$(LINK_OBJ)$(EEP)$(CXX_DEPS)$(C_UPPER_DEPS)$(SIZEDUMMY) test123
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include arduino/core/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_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
endif
-include ../makefile.defs`enter code here`
# Add inputs and outputs from these tool invocations to the build variables
AR += \
/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar \
ELF += \
test123.elf \
EEP += \
test123.eep \
FLASH_IMAGE += \
test123.hex \
# All Target
all: test123
# Tool invocations
test123: $(FLASH_IMAGE)
@echo 'Building target: $@'
@echo 'Printing size:'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-size" -A "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building target: $@'
@echo ' '
/home/jonas/Dokumente/Studium/7.\ Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar: $(AR_OBJ)
@echo 'Starting archiver'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-ar" rcs "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" $(AR_OBJ)
@echo 'Finished building: $@'
@echo ' '
test123.elf: $(LINK_OBJ) $(AR)
@echo 'Starting combiner'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-gcc" -Os -Wl,--gc-sections -mmcu=atmega328p -o "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" $(LINK_OBJ) $(AR) "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/arduino.ar" "-L/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release" -lm
@echo 'Finished building: $@'
@echo ' '
test123.eep: $(ELF)
@echo 'Create eeprom image'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "/home/jonas/Dokumente/Studium/7. Semester/Projekt /Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123 /Release/test123.eep"
@echo 'Finished building: $@'
@echo ' '
test123.hex: $(EEP)
@echo 'Create Flash image (ihex format)'
"/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk /Software/arduino-1.5.2/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.elf" "/home/jonas/Dokumente/Studium/7. Semester/Projekt/Autopilotwc/trunk/Software/test123/Release/test123.hex"
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(ELF)$(C++_DEPS)$(AR)$(C_DEPS)$(CC_DEPS)$(FLASH_IMAGE)$(AR_OBJ)$(CPP_DEPS)$(L INK_OBJ)$(EEP)$(CXX_DEPS)$(C_UPPER_DEPS)$(SIZEDUMMY) test123
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
非常感谢您的帮助。
您不能在 makefile 中正确使用带有 space 的路径。它不会起作用。
你试图逃离 space 并没有如你所愿。
您通常也不应该使用这样的文件的完整路径。
这使得移动 makefile/directory(或在其他机器上使用它)变得不必要地困难。
只使用相对于当前目录的路径。