discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build assembly code in GNUmakefile


From: Nicola Pero
Subject: Re: Build assembly code in GNUmakefile
Date: Sat, 27 May 2006 17:28:40 +0100 (BST)

> Hi,
> 
>   I have an assembly code with extension '.S'.
>   How could I add it into the building process of GNUmakefile ?
>   It can be done with Makefile like:
>   'gcc -c PortableUContext_asm.S -o _objs/PortableUContext_asm.o'
>   then linked with other C code.

You can list additional object files you want to link into your project by
using the variable xxx_OBJ_FILES.

You can add a rule to create a .o file from a .S file, and here you go.

Full example creating a tool from main.m and PortableUContext_asm.S --

----

include $(GNUSTEP_MAKEFILES)/common.make                                        
                                                                            
                                                                                
                                                                            
TOOL_NAME = NicolaExample                                                       
                                                                            
NicolaExample_OBJC_FILES = main.m                                               
                                                                            
NicolaExample_OBJ_FILES = $(GNUSTEP_OBJ_DIR)/PortableUContext_asm.o             
                                                                            
                                                                                
                                                                            
$(GNUSTEP_OBJ_DIR)/%${OEXT}: %.S                                                
                                                                            
        $(ECHO_COMPILING)$(CC) $< -c -o address@hidden(END_ECHO)                
                                                                                
       
                                                                                
                                                                            
include $(GNUSTEP_MAKEFILES)/tool.make
                                      
----

If this way of compiling .S files into .o files is standard, we can add it
to gnustep-make directly so everyone will have the stuff ready to go.  We
can also add a xxx_ASM_FILES or something similar ... so the only thing
you would need to do then is --

NicolaExample_ASM_FILES = PortableUContext_asm.S

Thanks

 

For Opera Telecom's latest news click here 
"Opera Telecom – Partner of Vodafone, BT, and 02 – Offices in Australia, 
Ireland, Italy, Kenya, Portugal, South Africa, Spain, Tanzania, UK and USA – 
one-stop shop solution including 3G Video, MMS, SMS, WAP, Web, IVR available 
through Opera’s world-leading Dragon self-service platform." 
This e-mail is intended for the above named only. It may contain private and 
confidential information or material that is privileged. If it has come to you 
in error you must take no action based upon it, nor must you copy or show it to 
anyone. Please return the message immediately to postmaster The validity of any 
pricing information contained herein is 30 days unless otherwise stated. E &OE. 
Standard terms and conditions apply 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]