Re: Codewarrior compiler command line???



On 15/12/2011 00:09, Tim Wescott wrote:
On Wed, 14 Dec 2011 14:34:37 -0800, Not Really Me wrote:

We are using CodeWarrior IDE v5.9.0 for a PPC project.

We need to build some additional files externally, but CW is not
forthcoming with the command line it is creating in the internal project
file. (.mpc) It keeps all of that and the individual object files
hidden. Freescale provided an excel spreadsheet to help duplicate the
command line for compile and link by telling it what IDE project options
you are selecting.

Does anyone have a more reliable approach?


I don't know about the particular CW version you have here, but all the CW tools I have used have a "help/pdf" directory with the manuals - including one that contains all the details of the command line switches for the compiler. It shouldn't be too hard to figure out what you need.

I _hate_ IDEs, and that's one reason.

In extremis, unless Windows 7 gets in your way, you can make a command
line logger and put it in place of the compiler that Code Warrior calls.
I've done this before. It's very much over the top, but it can also be a
life-saver.

Far better would be to build the whole project from a makefile, so you
actually know what is going on.


I agree, for the most part. An IDE build can be faster to get up an running, especially if you are not familiar with the compiler and the switches you need. But in the long run, makefiles are far better - they are more flexible, and provide clear documentation of the build process that can be easily read, changed, stored in a vcs, moved between different machines, etc.

The IDE (should!) handle multiple source directories, put the object files and binaries in directories other than the source, and handle all the dependencies automatically. Crafting a makefile that does that well is not easy - it takes a fair amount of trial and error, though generally it can be reused almost as-is for multiple tools and projects. An optimised makefile also generally runs faster than an IDE-based build.

Personally, I normally use makefiles. I used to hate IDE editors - they were almost always pretty poor, so I only used the IDE for debugging and possibly for getting started with a tool. Some IDE's have additional features (chip wizards, etc.) which can be useful. However, now almost all development tools use Eclipse as their IDE (including modern versions of CodeWorrier). As long as it is a fairly current version of Eclipse, I am happy with that for editing too. Eclipse works well with external makefiles, parsing the compiler output to put warning and error markers in the source code.

And if you do use an Eclipse IDE for handling the build, you can read the makefiles afterwards and use them for hints for your own makefile.

.