BasicMicro - Forums

www.basicmicro.com
It is currently Sat Feb 04, 2012 7:12 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: c/c++ compiler - Tell source files which processor?
PostPosted: Mon Aug 23, 2010 7:36 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 500
Hi Nathan,

I am playing around with my C libraries and C Phoenix code and I am trying to make it work with multiple processors, (Bap28, Bap40 and Arc32). Yesterday I updated my makefile for the library to build so far the Bap28 and Bap40, where the object files are built in their own sub-directories and the like. Now I would like to build the phoenix to run on either the Bap28 or the Bap40. I now have all of my code setup (I think) to configure around the different processors with things like: #ifdef BASICATOMPRO28.

My Hex Programs master header file has in it:
Code:
#ifndef BASICATOMPRO28
#ifndef BASICATOMPRO40
#ifndef BASICATOMARC32
#warning "Which Atom Pro not defined assuming BASICATOMPRO28"
#define BASICATOMPRO28
#endif
#endif
#endif


The question is, how to tell the source code which one I am compiling for. I could try to change the global compiler options (Preferences to define it), but I hate having to change this each time I am building. Likewise I could change my master header file each time...

Another option. You could modify the build depending on what Processor is chosen at the top of the IDE. You already use this to select which link file to use... You could pass this through with the -D BASICATOMPRO28 on the compiler invocation.

Suggestions?
Kurt

P.S - Later I will also include phoenix running on Arc32, but my servo code is not working yet and I need to figure out how to write Servo code for the Arc32...


Top
 Profile  
 
 Post subject: Re: c/c++ compiler - Tell source files which processor?
PostPosted: Mon Aug 23, 2010 8:42 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 784
Location: Temecula, CA
Kurt, send me an email and I'll try to add this in the next release.

_________________
Nathan Scherdin
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO