How do you get CB, to invoke compiler on group of srcfiles and object copy, rather than individually compile each and then link.
I am trying to compile a simple STM32F4 project from a net example. The guts of the makefile is only two lines yet I cannot seem to be able to replicate this natively in CB and get linker error.
I think the different compile sequences is at the root cause.
####################################
codeblocks sequence:-
((compile individually))
arm-none-eabi-gcc .....flags..... -c firstsrcfile.c -o firstsrcfile.o
.
.
arm-none-eabi-gcc .....flags..... -c an-asm-file.s -o lastsrcfile.o
((link))
arm-none-eabi-ld list-of-source-objectfilesfrom above -s -Tstm32_flash.ld ....libraries
((resultingerror))
main.o uses VFP register arguments, cbjh does not
((note: in CB compiler toolchain executables settings arm-none-eabi-ld is not set (arm-none-eabi-objcopy is set for static linker) yet somehow CB invokes ld and its this part that is causing the grief))
##################################
makefile sequence:-
((compile combined))
arm-none-eabi-gcc .....flags..... the-list-of-c-source-objectfiles -o main.elf ....libraries
arm-none-eabi-objcopy -O binary main.elf main.bin
((successfully links))
((relevant makefile command which does this firstline is arm-none-eabi-gcc $(CFLAGS) $^ -o $@ ...libraries
($^ being a list of source files, $@ corresponding objectfile )))
How does one achieve the second method sequence in Codeblocks?
I suspect an answer might be to point to a script, but should this be necessary for a simple project? If anyone cares to answer are there any aailable general methods that one can adapt a makefile into the CB environment? As a noobie I have noted advice to avoid using the makefile approach. I cannot agree more after observing the cumbersome inpenetratable makefile code, but?
PS I started another topic on this (with 15 reads) but deleted it as I now suspect the cause of the problem was the above.
the example code I'm trying to compile is from git clone git://github.com/jeremyherbert/stm32-templates.git
http://jeremyherbert.net/get/stm32f4_getting_started