Author Topic: Source tree question  (Read 9791 times)

Offline johnr

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Source tree question
« on: August 28, 2007, 07:07:00 PM »
 I'm starting to study the source files and see references like

 #ifdef _M5223x , #ifdef  _CODE_WARRIOR_CF etc in config.h and other files
but can't find where these labels are defined. Am I missing something ?

 John

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Source tree question
« Reply #1 on: August 28, 2007, 07:16:46 PM »
Hi John

When working with the simulator (VS project) _M5223X is a pre-processor define in the project (see project->settings->C++->Pre-processor).

When compiling with a cross compiler the same define is set in the compiler set up in much the same way.

In the GCC project the _M5223X define is also a pre-processor define which is passed in the command line:
eg. (in make file)
Code: [Select]
Build\uTasker.o: ..\..\..\uTasker\uTasker.c $(DEPENDS)
m68k-elf-gcc -mcpu=52235 -Wall -Wstrict-prototypes -I..\..\uTaskerV1.3 -D _GNU -D _M5223X -g -c -Os ..\..\..\uTasker\uTasker.c -o Build\uTasker.o
-D _GNU and -D _M5223X are 2 pre-processor defines used to specify the processor and the fact that the code is being compiled for GNU.

The define _CODE_WARRIOR_CF is a pre-processor define which is delivered by the CodeWarrior compiler setup (as _GNU by the GCC) so that some low level stuff can be adapted to the specific compiler. This expains why you don't find any of these defines in any head files.

Regards

Mark


« Last Edit: November 13, 2007, 07:54:04 PM by mark »