Sysprogs forums › Forums › VisualGDB › STM32 Makefile add -Wa -adhlns… to create assembler listing.
- This topic has 3 replies, 2 voices, and was last updated 9 years, 4 months ago by support.
-
AuthorPosts
-
July 3, 2015 at 22:15 #6674itisntParticipant
I’ve created a Stand-alone Embedded Project after your tutorial for my STM32F407 project. Everything runs fine so far, but:
In my old Makefile (Commandline project), i have the following entry:
……
CFLAGS += -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align
CFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<))))
# Compiler flags to generate dependency files:
#CFLAGS += -MD -MP -MF $(OUTDIR)/dep/$(@F).d
…….With -Wa -adhlns=… you can create (with -ggdb) a combined listing with assembler and C-Code for each .c file and for the hole target.
How can i add that to a VisualGDB controlled Makefile ?
All my tries ended in a misery 🙂
Regards Daniel
July 3, 2015 at 22:33 #6675supportKeymasterHi,
Please try adding the flags directly to the targets and target templates, e.g.:
$(BINARYDIR)/%.o : %.cpp $(all_make_files) |$(BINARYDIR) $(CXX) $(CXXFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep) <add your flags here>
July 3, 2015 at 22:47 #6676itisntParticipantFirst of all thanks for the quick answer, but please, could you go a little more into the deep 🙂
I’v added the following in the “Makefile”:
$(BINARYDIR)/%.o : %.c $(all_make_files) |$(BINARYDIR)
$(CC) $(CFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep) -Wa -adhlns=$(@:.o=.lst)and got the following back:
1> C:\Users\a239368\Privat\Mikrokontroller\VisualStudio\GCC_4_9_2015q2/bin/arm-none-eabi-gcc.exe -ggdb -ffunction-sections -O0 -mcpu=cortex-m4 -mthumb -ffunction-sections -mapcs-frame -ffunction-sections -fdata-sections -Wextra -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -std=gnu99 -mfloat-abi=soft -I. -IC:/Users/a239368/Privat/Mikrokontroller/Rekolas/VisualGDB_workspace/RLS-15/RLS-15/Daenus_STM32F4xx_StdPeriph_151/cmis -IC:/Users/a239368/Privat/Mikrokontroller/Rekolas/VisualGDB_workspace/RLS-15/RLS-15/Daenus_STM32F4xx_StdPeriph_151/cmsis_boot -IC:/Users/a239368/Privat/Mikrokontroller/Rekolas/VisualGDB_workspace/RLS-15/RLS-15/Daenus_STM32F4xx_StdPeriph_151/cmsis_lib/inc -IC:/Users/a239368/Privat/Mikrokontroller/Rekolas/VisualGDB_workspace/RLS-15/RLS-15/src -IC:/Users/a239368/Privat/Mikrokontroller/Rekolas/VisualGDB_workspace/RLS-15/RLS-15/ub_lib -IC:/Users/a239368/Privat/Mikrokontroller/Rekolas/VisualGDB_workspace/RLS-15/RLS-15/stdio -DDEBUG -DARM_MATH_CM4 -Dstm32_flash_layout -DSTM32F407ZG -DSTM32F40_41xxx -DUSE_STDPERIPH_DRIVER -DUSE_FULL_ASSERT -DUSE_OLIMEX_H407 -DMOD_MTHOMAS_STMLIB -c main.c -o Debug/main.o -MD -MF Debug/main.dep -Wa -adhlns=Debug/main.lst
1>arm-none-eabi-gcc.exe : error : unrecognized command line option ‘-Wa’
1>arm-none-eabi-gcc.exe : error : unrecognized command line option ‘-adhlns=Debug/main.lst’
1> make: *** [Debug/main.o] Error 1Sorry, but i’m not a Makefile crack 🙁
July 6, 2015 at 19:32 #6683supportKeymasterPlease use comma instead of space after the -Wa option, i.e.:
- Modify the .c file rule this way:
$(BINARYDIR)/%.o : %.c $(all_make_files) |$(BINARYDIR) $(CC) $(CFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep) -Wa,-adhlns=$(@:.o=.lst)
- Change the contents of the SOURCEFILES statement (e.g. remove one file) so that VisualGDB regenerates the rules your Makefile.
- Build your project.
- Modify the .c file rule this way:
-
AuthorPosts
- You must be logged in to reply to this topic.