Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Adding printf causes auto makefile to yield 'recipe for target' Error(Adding printf causes auto makefile to yield 'recipe for target' Error)
Adding printf causes auto makefile to yield 'recipe for target' Error [message #1753532] Tue, 07 February 2017 14:47 Go to next message
Clive Palmer is currently offline Clive PalmerFriend
Messages: 4
Registered: February 2017
Junior Member
Hopefully someone can help me.
I am trying to get my UART working on a STM32F107. My code compiles and runs fine until I add a 'printf'. As soon as I do this I seem to have link issues and my makefile ( that is automatically generated ) produces a 'recipe for target' Error at the '@echo 'Building target: $@' line.
I have reached the limit of my current knowledge trying to identify the cause.
Is there anyone who can help? The makefile is:-


# All Target
all: UART1.elf secondary-outputs

# Tool invocations
UART1.elf: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross ARM GNU C++ Linker'
arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"UART1.map" --specs=nano.specs -u _printf_float -o "UART1.elf" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '

UART1.hex: UART1.elf
@echo 'Invoking: Cross ARM GNU Create Flash Image'
arm-none-eabi-objcopy -O ihex "UART1.elf" "UART1.hex"
@echo 'Finished building: $@'
@echo ' '

UART1.siz: UART1.elf
@echo 'Invoking: Cross ARM GNU Print Size'
arm-none-eabi-size --format=berkeley "UART1.elf"
@echo 'Finished building: $@'
@echo ' '

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

secondary-outputs: $(SECONDARY_FLASH) $(SECONDARY_SIZE)

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets
Re: Adding printf causes auto makefile to yield 'recipe for target' Error [message #1753582 is a reply to message #1753532] Tue, 07 February 2017 21:24 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The recipe for make returned an error. Mae is merely telling you where the recipe starts.
https://www.gnu.org/software/make/manual/html_node/Errors.html
There likely was an error generated by the compiler or linker that you need to address.
You will find it in the build log preceding the make error.

Re: Adding printf causes auto makefile to yield 'recipe for target' Error [message #1753602 is a reply to message #1753582] Wed, 08 February 2017 07:17 Go to previous messageGo to next message
Clive Palmer is currently offline Clive PalmerFriend
Messages: 4
Registered: February 2017
Junior Member
Hi David,
Thanks for taking the time to reply. Sorry about the duplicate posting. I thought I messed it up first time around.
Maybe Im being dumb, but the only log I can see is the one in Eclipse that tells me that I have a recipe error. There appears to be no log in my debug file directory to give me any clues. The compiler error only manifests itself when I add a printf and compiles fine if I comment it out, so it cant be a compiler error. I was assuming there was some setting somewhere in Eclipse that is used to generate the makefile that was set incorrectly and I was hoping someone could throw some light onto it as I had come to a blank.
Re: Adding printf causes auto makefile to yield 'recipe for target' Error [message #1753607 is a reply to message #1753602] Wed, 08 February 2017 07:50 Go to previous messageGo to next message
Clive Palmer is currently offline Clive PalmerFriend
Messages: 4
Registered: February 2017
Junior Member
Ok I fixed it by adding the following linker option. I must admit I dont fully understand all the linker options, so Im going to require to do some reading. Thanks.

-specs=nosys.specs
Re: Adding printf causes auto makefile to yield 'recipe for target' Error [message #1753665 is a reply to message #1753607] Wed, 08 February 2017 16:11 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
g++ (or rather its cousin arm-none-eabi-g++) can be used to both compile and link. Some error occurred during its invocation. I would have expected g++ to have produced an error message which should be in the log displayed in the build console and also in the file described at Project-->Properties-->C/C++ Build-->Logging.

You can lookup -specs=file here: https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#Overall-Options
The contents of file: https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html#Spec-Files

A summary of all GCC options: https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html
Previous Topic:Debugging problems with lldb & gdb on Mac with Neon
Next Topic:Eclipse C++ IDE for Arduino (Neon) - problems with build
Goto Forum:
  


Current Time: Tue Mar 19 08:27:33 GMT 2024

Powered by FUDForum. Page generated in 0.02735 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top