mainSavannah Administration - Support: sr #105544, Selecting an alternative compiler...

 
 

sr #105544: Selecting an alternative compiler for "make" to use.

Submitter:  Peter Anderson <peter_anderson>
Submitted:  Tue 05 Sep 2006 02:31:19 PM UTC
   
 
Category:  None Priority:  1 - Later
Severity:  3 - Normal Status:  Invalid
Privacy:  Public Assigned to:  sp
Operating System:  GNU/Linux Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 09 Sep 2006 11:56:51 AM UTC, comment #2: 

Hi Stephan,

Please accept my apologies for posting a request to the wrong  support system.  My feeble excuse is that I am new to forums and don't always get it right.

I do appreciate your help as, though I am an experienced microcontroller assembly language programmed, I am new to Blackfin, uClinux, Makefiles and "C".

Thanks for the answer - I can now progress my learning and get some useful programming done.

Best wishes,

Peter

Peter Anderson <peter_anderson>
Thu 07 Sep 2006 03:28:56 PM UTC, comment #1: 

Hi!

Let's start with a quick note: the GNU Savannah support system is actually meant for GNU Savannah related issues and not for GNU/Linux or similar problems.
However, I'll still answer your question. Next time please don't file a support request here when looking for an answer to such a question.

Okay, now let's give you an answer:

As you said, you tried setting the CC variable in your makefile, without any luck though. The reason for this is that setting a variable in a makefile works pretty much the same way setting variables in shell scripts work.
So, after setting the CC variable you can 'access' it using ${CC}. This way ${CC} will be replaced with the value of the CC variable when parsing the makefile.

So, adapted to your makefile it would look like this:

CC=/path/to/your/gcc

hello : hello.o
${CC} -o hello.c hello.o

hello.o : hello.c
${CC} -c hello.c

clean :
rm hello hello.o

Don't forget to not simply copy&paste this snippted but to add tabs again.

Regards.

PS: I've closed this support request. If you do have any other questions not related to GNU Savannah please do not use this support request system. If you do have other specific GNU make related 'problems', please refer to the GNU make manual which can be found at http://www.gnu.org/software/make/manual/make.html.

Stephan Peijnik <sp>
Tue 05 Sep 2006 02:31:19 PM UTC, original submission:  

Dear Sirs,

I am trying to use a Makefile to produce code for the Blackfin processor.  My development system uses Suse 10.1.

I have written a "Hello World" c program and a simple Makefile:

hello : hello.o
       cc -o hello.c hello.o

hello.o : hello.c
       cc -c hello.c

clean :
       rm hello hello.o

The default 386 gcc compiler has the path: usr/bin/ and the Blackfin compiler the path: /opt/uClinux/bfin-uclinux/bin/.

When I type "make", the 386 gcc compiler is always used.

I have tried adding: CC = bfin-uclinux-gcc as the first line of the Makefile, also: override CC = bfin-uclinux-gcc.  None worked.

The Blackfin compiler path is "visible" as:
 bfin-uclinux-gcc -Wl,-elf2flt hello.c -o hello works.

I have experimented and checked the web with no success.

Can you please tell me how "make" can be forced to use the Blackfin compiler rather than the 386 compiler?

Best wishes,

Peter


Peter Anderson <peter_anderson>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-09-07 sp Priority5 - Normal 1 - Later
    Severity4 - Important 3 - Normal
    StatusNone Invalid
    Assigned toNone sp
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code