This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Patch to include $(CFLAGS) into specflags
- To: automake@gnu.org
- Subject: Patch to include $(CFLAGS) into specflags
- From: Pavel Roskin <pavel_roskin@geocities.com>
- Date: Mon, 24 May 1999 20:01:49 +0400 (EEST)
Hello!
As I already wrote, the current implementation of per-executable flags
doesn't include $(CFLAGS) in the command line.
This is bad, since $(CFLAGS) is expected to affect all the compiler
invocations.
The attached patch simplifies the rules used for compilation of
executable-specific objects.
Instead of
$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \
$(test1_CFLAGS) -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
we have now
$(COMPILE) $(test1_CFLAGS) -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
Rules for libtool objects are simplified in a similar way.
Not only is $(CFLAGS) included in the command line (as part of COMPILE),
but also setting COMPILE will now affect compilation of per-executable
objects. Ditto LTCOMPILE.
specflags3.test has been modified accordingly.
sourcesub.test fails as usually :-/
Changelog:
1999-05-24 Pavel Roskin <pavel_roskin@geocities.com>
* automake.in (add_depend2) Use $(COMPILE) and $(LTCOMPILE)
in the rules
Pavel Roskin
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.731
diff -u -r1.731 automake.in
--- automake.in 1999/05/19 00:21:13 1.731
+++ automake.in 1999/05/24 15:44:56
@@ -3057,15 +3057,14 @@
$i += 3;
local ($flag) = $language_map{$lang . '-flags'};
- local ($val) = "(${derived}_${flag}";
- ($rule = $language_map{$lang . '-compile'}) =~
- s/\($flag/$val/;
+ $rule = "\$(COMPILE) \$(${derived}_${flag})";
+ $ltrule = "\$(LTCOMPILE) \$(${derived}_${flag})";
$rule =~ s,([/\$]),\\$1,g;
+ $ltrule =~ s,([/\$]),\\$1,g;
$xform = ('s/\@COMPILE\@/' . $rule . '/g;'
- . 's/\@LTCOMPILE\@/\$(LIBTOOL) --mode=compile ' . $rule
- . '/g;'
+ . 's/\@LTCOMPILE\@/' . $ltrule . '/g;'
. 's/\@OBJ\@/' . $obj . '.o/g;'
. 's/\@LTOBJ\@/' . $obj . '.lo/g;'
. 's/\@SOURCE\@/' . $source . '/g;');
Index: tests/specflags3.test
===================================================================
RCS file: /cvs/automake/automake/tests/specflags3.test,v
retrieving revision 1.1
diff -u -r1.1 specflags3.test
--- specflags3.test 1999/04/27 13:46:43 1.1
+++ specflags3.test 1999/05/24 15:44:56
@@ -18,4 +18,4 @@
$AUTOMAKE || exit 1
-grep 'CC.*-Wp' Makefile.in
+grep 'COMPILE.*foo_CFLAGS.*-Wp' Makefile.in