Boost logo

Boost-Build :

From: Craig Rodrigues (rodrigc_at_[hidden])
Date: 2005-08-01 19:51:22


Hi,

Would it be possible to add a new type for assembly files?

For example, with gcc, files which end with .s or .S
are assembly files. We could add support for other assemblers
if people are interested, but gcc is the only one I know about right now.

I am thinking of something like this:

--- /dev/null 2005-03-19 14:36:14.000000000 -0500
+++ build/v2/tools/types/asm.jam 2005-08-01 13:45:08.756349200 -0400
@@ -0,0 +1,4 @@
+# Copyright Craig Rodrigues 2005. Distributed under the Boost
+# Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+type ASM : s ;

Index: gcc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/gcc.jam,v
retrieving revision 1.53
diff -u -r1.53 gcc.jam
--- gcc.jam 15 Jun 2005 12:24:06 -0000 1.53
+++ gcc.jam 1 Aug 2005 18:25:55 -0000
@@ -66,6 +66,7 @@

generators.register-c-compiler gcc.compile.c++ : CPP : OBJ : <toolset>gcc ;
generators.register-c-compiler gcc.compile.c : C : OBJ : <toolset>gcc ;
+generators.register-c-compiler gcc.compile.asm : ASM : OBJ : <toolset>gcc ;

# Declare flags and action for compilation
@@ -153,6 +154,16 @@
"$(CONFIG_COMMAND)" $(LANG) -Wall $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}

+rule compile.asm
+{
+ LANG on $(<) = "-x assembler" ;
+}
+
+actions compile.asm
+{
+ "$(CONFIG_COMMAND)" $(LANG) -Wall $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
+}
+
# The class which check that we don't try to use
# the <runtime-link>static property while creating or using shared library,
# since it's not supported by gcc/libc.

With gcc, you can test this by doing something like:

gcc -S hello.cpp (to generate hello.s)

Than make a Jamroot file with one line:
exe hello : hello.s ;

Thanks.

-- 
Craig Rodrigues 
rodrigc_at_[hidden]
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk