This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dependency tracking for .S assembler files


hi :)

On Fri, Sep 24, 2004 at 05:51:40PM +0200, Alexandre Duret-Lutz wrote:
> The only think holding this patch is that it adds a new language
> without documenting it.

I merged Ralfs and my patch and also added a minimal bit of
documentation:


Index: automake.in
===================================================================
RCS file: /cvsroot/automake/automake/automake.in,v
retrieving revision 1.1584
diff -u -p -r1.1584 automake.in
--- automake.in	28 Sep 2004 22:02:33 -0000	1.1584
+++ automake.in	5 Oct 2004 21:06:16 -0000
@@ -801,12 +801,29 @@ register_language ('name' => 'asm',
 		   'config_vars' => ['CCAS', 'CCASFLAGS'],
 
 		   'flags' => ['CCASFLAGS'],
-		   # Users can set AM_ASFLAGS to includes DEFS, INCLUDES,
+		   # Users can set AM_CCASFLAGS to includes DEFS, INCLUDES,
 		   # or anything else required.  They can also set AS.
 		   'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
 		   'compiler' => 'CCASCOMPILE',
 		   'compile_flag' => '-c',
-		   'extensions' => ['.s', '.S'],
+		   'extensions' => ['.s'],
+
+		   # With assembly we still use the C linker.
+		   '_finish' => \&lang_c_finish);
+
+# Preprocessed Assembler.
+register_language ('name' => 'cppasm',
+		   'Name' => 'Preprocessed Assembler',
+		   'config_vars' => ['CCAS', 'CCASFLAGS'],
+
+		   'autodep' => 'CCAS',
+		   'flags' => ['CCASFLAGS','CPPFLAGS'],
+		   # Users can set AM_ASFLAGS to includes DEFS, INCLUDES,
+		   # or anything else required.  They can also set AS.
+		   'compile' => '$(CCAS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+		   'compiler' => 'CPPASCOMPILE',
+		   'compile_flag' => '-c',
+		   'extensions' => ['.S'],
 
 		   # With assembly we still use the C linker.
 		   '_finish' => \&lang_c_finish);
@@ -1386,7 +1403,7 @@ sub handle_languages
 					%transform, %lang);
 
 	# If the source to a program consists entirely of code from a
-	# `pure' language, for instance C++ for Fortran 77, then we
+	# `pure' language, for instance C++ or Fortran 77, then we
 	# don't need the C compiler code.  However if we run into
 	# something unusual then we do generate the C code.  There are
 	# probably corner cases here that do not work properly.
@@ -5190,6 +5207,12 @@ sub lang_asm_rewrite
     return &lang_sub_obj;
 }
 
+# Rewrite a single preprocessed assembly file.
+sub lang_cppasm_rewrite
+{
+    return &lang_sub_obj;
+}
+
 # Rewrite a single Fortran 77 file.
 sub lang_f77_rewrite
 {
Index: doc/automake.texi
===================================================================
RCS file: /cvsroot/automake/automake/doc/automake.texi,v
retrieving revision 1.56
diff -u -p -r1.56 automake.texi
--- doc/automake.texi	25 Sep 2004 20:50:29 -0000	1.56
+++ doc/automake.texi	5 Oct 2004 21:06:23 -0000
@@ -3898,11 +3898,14 @@ The command used to actually link a C++ 
 @section Assembly Support
 
 Automake includes some support for assembly code.
+There are two forms of assembler files:
+normal (@samp{.s}) and preprocessed by @code{CPP} (@samp{.S}).
 
 The variable @code{CCAS} holds the name of the compiler used to build
 assembly code.  This compiler must work a bit like a C compiler; in
 particular it must accept @samp{-c} and @samp{-o}.  The value of
-@code{CCASFLAGS} is passed to the compilation.
+@code{CCASFLAGS} (and @samp{CPPFLAGS} for preprocessed files) is passed
+to the compilation.
 @vindex CCAS
 @vindex CCASFLAGS
 
Index: m4/as.m4
===================================================================
RCS file: /cvsroot/automake/automake/m4/as.m4,v
retrieving revision 1.8
diff -u -p -r1.8 as.m4
--- m4/as.m4	11 Jan 2004 12:05:12 -0000	1.8
+++ m4/as.m4	5 Oct 2004 21:06:23 -0000
@@ -28,4 +28,5 @@ test "${CCAS+set}" = set || CCAS=$CC
 test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
 AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
 AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_DEPENDENCIES([CCAS])
 ])
-- 
Martin Waitz

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]