Page 1 of 1

CodeLite for armgcc

Posted: Wed May 27, 2020 1:22 pm
by Ampfing
Hi all,

I am trying to use CodeLite to develop software for an STM32 controller compiling with armgcc and struggle to add a custom compiler to CodeLite.

Here's the command line to compile one file (Timer.c) that I have so far in the Makefile generated by CodeLite:

Code: Select all

$(CC) $(CFLAGS_ENV) $(CFLAGS_PROJ) $(Preprocessors) -isystemC:/Software/SeggerEmbeddedStudio/include $(IncludePath) -MD "D:/Daten/FMC/Software/Spielwiese/Output/blink_LED Debug/Obj/Timer.d" -MQ "Output/blink_LED Debug/Obj/Timer.o" -quiet -std=gnu99 -g3 -gpubnames -fomit-frame-pointer -fno-dwarf2-cfi-asm -fno-builtin -ffunction-sections -fdata-sections -fshort-enums -fno-common "D:/Daten/FMC/Software/CodeLite/Test/Test/Timer.c" $(ObjectSwitch)"$(IntermediateDirectory)/Timer.cTimer.asm"
The command I am trying to immitate in the Makefile is taken from a different IDE that successfully compiles the file.

As you can see I need to include the name of the current file (Timer) in the output command to generate the .o and the .d file. Does CodeLite somehow provide the name of the current build target when generating the Makefile? I tried using $(CurrentFileName) and $(CurrentFilePath) but both variables are empty.

Thanks in advance for helpful answers and best regards

Re: CodeLite for armgcc

Posted: Sat May 30, 2020 1:30 pm
by eranif
Select your compiler under:

Settings -> Build Settings -> Compilers

Next, under the "Templates" tab you should be able to change the compile line
The default entry (for c++ file) is:

Code: Select all

$(CXX) $(SourceSwitch) "$(FileFullPath)" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
You can use the following macros:

Code: Select all

$(FileName)  // just the name "Timer"
$(FileFullName) // with extension "Timer.c"
$(FileFullPath) // "C:\..\Timer.c"
$(FilePath) // C:\...