script or plugin to run a program per file?

cancel
Showing results for 
Search instead for 
Did you mean: 

script or plugin to run a program per file?

2,924 Views
BrendanDoonan
Contributor III

I'm using Freescale CodeWarrior 8.7 PA.

 

I have this program that processes a source file and adds some code for debug purposes.  The way I use it is through the command line; I pass it the name of the code warrior command line compiler and its arguments, per file.  This program processes the source code, then calls the command line compiler with that processed-source and generates an object file.  It does this internally; i can generate the processed-source code if necessary, but the program really just wants to generate an object file.

 

Can I configure this process to occur through the Code Warrior IDE?  Can I add logic to the generation of the object code, per source file?

Labels (1)
0 Kudos
9 Replies

77 Views
BrendanDoonan
Contributor III

alright, perhaps i'm over complicating this.  Basically, I want to specify what to use as the compiler and linker.  Technically I want to still use the command line compiler, mwcceppc, but I want to preface it with my program "att".  so I want to change from using "mwcceppc" for compilation to "att mwcceppc".

 

I've read that this can be done pretty easily via makefile, ie the makefile lets you specify what command-line to use for the compiler.  But the Codewarrior IDE does a great job hiding these options.  So how can I do it in the IDE?

0 Kudos

77 Views
J2MEJediMaster
Specialist I

Do a search of these forums using the string "automation". There are several threads that talk about batch processing and automating IDE operation. There might be information in them to answer your question.

 

---Tom

 

0 Kudos

77 Views
BrendanDoonan
Contributor III

Alright I've gotten into automation a little bit, this is actually pretty cool.  I chose to use COM automation through Visual Basic, as its pretty straightfoward, like:

 

Dim oCW, oProj, oTarg

Set oCW = CreateObject("CodeWarrior.CodeWarriorApp")

Set oProj = oCW.OpenProject(path, 1, 0, 0)

Set oTarg = oProj.GetCurrentTarget

 

etc.  I still don't, however, see a method for specifically telling the codewarrior IDE what to use as the compiler and linker, command line style.  I see that the Target interface has a method "GetLinkerName", but nothing like SetLinkerName or anything compiler related.  So is there any way using this COM automation stuff to specify the compiler/linker to use for building my project?

0 Kudos

77 Views
J2MEJediMaster
Specialist I
I'd recommend studying the CodeWarrior IDE Automation Guide, which is located in the CodeWarrior Help directory. However, it seems that you've already done that, because I just took a look at it and see only the GetLinkerName method, as you described. The only thing I can think of at this point is, in the Automation Guide, go to the chapter on Microsoft COM automation and study the section on Viewing OLE/COM Objects. This, along the OLE/COm Object Viewer, should let you view any IDE COM methods not described in the Guide.
0 Kudos

77 Views
CrasyCat
Specialist III

Hello

 

COM automation will only allow you to build using the compiler/linker configured in the project.

You cannot specify another compiler/linker at that level.

 

CrasyCat

0 Kudos

77 Views
BrendanDoonan
Contributor III

then how do i set the compiler/linker?  I've looked through the settings pages, but i don't immediately see anything that would let me set that.  can it be done via automation?

 

or am I going to need to essentially run the command line stuff myself, per file.  In which case, how can I easily get the command line options for the compiler/linker specific to my project?  I'd really prefer to have this done through the CW IDE, if at all possible...

0 Kudos

77 Views
CrasyCat
Specialist III

Hello

 

You would need a wrapper Plug in DLL that is doing what you want.

We do not have the tools anymore allowing a customer to expand CodeWArrior with new

functionalities.

 

We will be moving to an Eclipse based IDE soon. THis should make he whole system more flexible. 

 

In the mean time  I would recommend you to build your application from command Line using a  make file.

 

CrasyCat

0 Kudos

77 Views
BrendanDoonan
Contributor III

hmm... that's disheartening.

 

If I go into the "Target Settings" panel and change the linker to "EPPC Linux GNU Linker", it changes what panels are available as options.  It adds GNU Assembler, Disassembler, and Compiler to "Language Settings".  If I go into the newly available "GNU Tools" under "Others", I can set exactly what I want, the command line compiler and linker program names.  If I just use my own compiler/linker here, is that really all I need to know?  Why are these options not available with my normal linker, and can I somehow enable them with it?

0 Kudos

77 Views
CrasyCat
Specialist III

Hello

 

The "EPPC Linux GNU Linker" has been designed to use GNU Build tools to build an application from within CodeWarrior

There is no guarantee that it will work for any other tool chain.

 

CrasyCat

0 Kudos