Author Topic: Using the "Command Line Macro"  (Read 8780 times)


  • Guest
Using the "Command Line Macro"
« on: July 10, 2008, 08:32:45 pm »

I am currently having trouble in making Code:Blocks use the information I have put in for the command line macro for compiling source code for the MSP430.  The tool chain I am using is the latest version of MSPGCC.

The heart of the problem lies in that no matter what I put into the command line macro box, be it the correct method for calling the compiler or complete trash, Code:Blacks seems to ignore it.  The "command" drop down box is set as "compile single file to object file" and no source extension is specified - it is blank.

Upon executing the build command, the following output occurs in the build log:
-------------- Build: Release in Test ---------------

msp430-gcc.exe     -IC:\mspgcc  -c test1.c -o obj\Release\test1.o
msp430-gcc.exe -LC:\mspgcc\lib  -o bin\Release\Test.exe obj\Release\test1.o   
Output size is 2.85 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings

My goal is to get Code:Blocks to issue something such as the following to the compiler: "msp430-gcc -Os -mmcu=msp430x1121 -o test1.elf test1.c".  Is there an option that I have to use for Code:Blocks to be able to carry out such a function?

I appreciate any help.

Offline mariocup

  • Moderator
  • Lives here!
  • *****
  • Posts: 586
Re: Using the "Command Line Macro"
« Reply #1 on: July 10, 2008, 11:07:59 pm »
Hi chinsu,

do the following steps:
1. Set the build options -Os (optimization) and -mmcu=msp430x1121 in the project properties.
2. Select the "Build targets" tab of the Project Properties and enable the following options:
Type: Console application
Output filename: test.elf
Checkbox enabled: Auto-generate filename prefix
Checkbox disabled: Auto-generate filename extension

Since I am using the MSP430 also in a different project, perhaps I will make some wizards as soon as I have some time.




  • Guest
Re: Using the "Command Line Macro"
« Reply #2 on: July 11, 2008, 12:07:07 am »
Thank you for the quick reply Mario.  It works perfectly. :)