View Single Post
Old 10-02-2012, 12:38 PM   #37
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Cross Make Example

This is only an example of statements you may find in a Makefile intended to be used for both cross-compiles and native-compiles:
PHP Code:
AS      = $(CROSS_COMPILE)as
LD      = $(CROSS_COMPILE)ld
CC      
= $(CROSS_COMPILE)gcc
CPP     
= $(CC) -E
AR      
= $(CROSS_COMPILE)ar
NM      
= $(CROSS_COMPILE)nm
STRIP   
= $(CROSS_COMPILE)strip
OBJCOPY 
= $(CROSS_COMPILE)objcopy
OBJDUMP 
= $(CROSS_COMPILE)objdump
RANLIB  
= $(CROSS_COMPILE)RANLIB 
After which, in the Makefile, all references to the toolchain take the symbolic form of:
$(AS)

So in twobob's example path to the ARM cross-compiler, if the Makefile is called with:
PHP Code:
CROSS_COMPILE='arm-linux-gnueabi-' 
set in its envronment, then $(AS) will be: arm-linux-gnueabi-as

If CROSS_COMPILE is not set (or an empty string), then $(AS) will be: as

The 'unadorned' name for the host machine's assembler.

In other words, your #2 answered your #1
knc1 is offline   Reply With Quote