From 85c65f5fcc4312e9c6c3f18ebf6f9ee802e80abe Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 1 Jun 1998 23:12:15 +0000 Subject: [PATCH] Added AM_ flags support --- ChangeLog | 5 +++++ NEWS | 4 ++++ automake.in | 28 +++++++++++----------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89ccbb52..ab612f15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ Mon Jun 1 14:23:29 1998 Tom Tromey + * automake.in (handle_yacc_lex_cxx): Use AM_CPPFLAGS, AM_CXXFLAGS, + AM_CFLAGS. + (output_yacc_build_rule): Use AM_YFLAGS, AM_LFLAGS. + (handle_dependencies): Don't define CXXMKDEP. + * clean.am (mostlyclean-generic): Prefix rule with MOSTLYCLEAN. (clean-generic): Prefix rule with CLEAN. (distclean-generic): Prefix rule with DISTCLEAN. diff --git a/NEWS b/NEWS index 2967320f..b42e5fb6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +New in 1.3a: +* Added `AM_FOOFLAGS' variable for each compiler invocation; + e.g. AM_CFLAGS can be used in Makefile.am to set C compiler flags + New in 1.3: * Bug fixes * Better Cygwin32 support diff --git a/automake.in b/automake.in index 88fd5948..2d234439 100755 --- a/automake.in +++ b/automake.in @@ -977,12 +977,12 @@ sub handle_yacc_lex_cxx push (@suffixes, @cxx_list); &define_configure_variable ("CXXFLAGS"); - &define_variable ('CXXCOMPILE', '$(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)'); + &define_variable ('CXXCOMPILE', '$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)'); &define_variable ('LTCXXCOMPILE', - $ltcompile . '$(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)') + $ltcompile . '$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)') if ($seen_libtool); - &define_variable ('CXXLINK', $ltlink . '$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@'); + &define_variable ('CXXLINK', $ltlink . '$(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@'); local ($ext); foreach $ext (@cxx_list) @@ -1029,7 +1029,7 @@ sub handle_yacc_lex_cxx # we can't use $< -- some makes only define $< during a # suffix rule. $output_rules .= ($base . "_.c: $base.c \$(ANSI2KNR)\n\t" - . '$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) ' + . '$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) ' . '`if test -f $(srcdir)/' . $base . '.c' . '; then echo $(srcdir)/' . $base . '.c' . '; else echo ' . $base . '.c; fi` ' @@ -1050,12 +1050,12 @@ sub handle_yacc_lex_cxx { &define_configure_variable ('CFLAGS'); &define_variable ('COMPILE', - '$(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)'); + '$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)'); &define_variable ('LTCOMPILE', $ltcompile . - '$(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)') + '$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)') if ($seen_libtool); - &define_variable ('LINK', $ltlink . '$(CC) $(CFLAGS) $(LDFLAGS) -o $@'); + &define_variable ('LINK', $ltlink . '$(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@'); } if ($seen_c_source && ! defined $configure_vars{'CC'}) @@ -1083,11 +1083,11 @@ sub output_yacc_build_rule { $output_rules .= ('$(SHELL) $(YLWRAP)' . ' "$(YACC)" $< y.tab.c $*' . $suffix - . ' y.tab.h $*.h -- $(YFLAGS)'); + . ' y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS)'); } else { - $output_rules .= ('$(YACC) $(YFLAGS) $< && mv y.tab.c $*' + $output_rules .= ('$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*' . $suffix . "\n" . "\tif test -f y.tab.h; then \\\n" . "\tif cmp -s y.tab.h \$*.h; then rm -f y.tab.h; else mv y.tab.h \$*.h; fi; \\\n" @@ -1112,11 +1112,11 @@ sub output_lex_build_rule # Is the $@ correct here? If so, why not use it in the ylwrap # build rule for yacc above? $output_rules .= '$(SHELL) $(YLWRAP)' - . ' "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(LFLAGS)'; + . ' "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(AM_LFLAGS) $(LFLAGS)'; } else { - $output_rules .= '$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@'; + $output_rules .= '$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@'; } $output_rules .= "\n"; } @@ -2814,18 +2814,12 @@ sub handle_dependencies . 's/\@PFX\@//g;', 'depend2'); local ($ext); - local ($need_cxx) = 0; foreach $ext (sort keys %cxx_extensions) { $output_rules .= &file_contents_with_transform ('s/\@EXT\@/' . $ext .'/g;' . 's/\@PFX\@/CXX/g;', 'depend2'); - $need_cxx = 1; - } - if ($need_cxx) - { - &define_variable ('CXXMKDEP', '$(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)'); } } } -- 2.43.5