automake-ng
[Top][All Lists]
Advanced

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

Re: [Automake-NG] [PATCH 04/14] [ng] clean: revamp recipes and APIs to e


From: Akim Demaille
Subject: Re: [Automake-NG] [PATCH 04/14] [ng] clean: revamp recipes and APIs to extend cleaning rules
Date: Thu, 21 Jun 2012 14:49:47 +0200

Le 21 juin 2012 à 12:32, Stefano Lattarini a écrit :

> This change it introduces eight new internal variables, which our

all

> can been appended to by our Makefile fragments to declare stuff that
> should be cleaned upon the various "make *clean" targets; these new
> variables are:
> 
>  - am__mostlyclean_files, am__mostlyclean_dirs
>  - am__clean_files,       am__clean_dirs
>  - am__distclean_files,   am__distclean_dirs
>  - am__maintclean_files,  am__maintclean_dirs
> 
> This change also ensures that the contents of the $(MOSTLYCLEANFILES),
> $(CLEANFILES), $(DISTCLEANFILES) and $(MAINTAINERCLEANFILES) variables
> will be cleaned even if those variables where not defined in the

were

> Makefile.am (so that it is now possible to, e.g., define them in a
> wrapper GNUmakefile including the Automake-generated Makefile, and
> still have the relevant '*clean' targets remove them).

Sounds good.  Much better than the *-local approach.



> diff --git a/automake.in b/automake.in
> index 66071e5..46f22d1 100644
> --- a/automake.in
> +++ b/automake.in
> @@ -2260,20 +2260,17 @@ sub handle_libtool
>   require_conf_file_with_macro (TRUE, 'LIBTOOL', FOREIGN, @libtool_files)
>     if $relative_dir eq '.' && ! $libtool_new_api;
> 
> -  my @libtool_rms;
> -  foreach my $item (sort keys %libtool_clean_directories)
> -    {
> -      my $dir = ($item eq '.') ? '' : "$item/";
> -      # .libs is for Unix, _libs for DOS.
> -      push (@libtool_rms, "\t-rm -rf ${dir}.libs ${dir}_libs");
> -    }
> -
> +  # .libs is for Unix, _libs for DOS.
> +  my @libtool_clean_directories = map { ("$_/.libs", "$_/_libs") }
> +                                  (sort keys %libtool_clean_directories);
>   check_user_variables 'LIBTOOLFLAGS';
> 
>   # Output the libtool compilation rules.
> -  $output_rules .= &file_contents ('libtool',
> -                                new Automake::Location,
> -                                LTRMS => join ("\n", @libtool_rms));
> +  # FIXME: actually, this only output the libtool cleaning rules …

outputs



> +## Some files must be cleaned only in VPATH builds -- e.g., those linked
> +## in usages like "AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])".
> +am__distclean_files += $(if $(filter 
> .,$(srcdir)),,$(CONFIG_CLEAN_VPATH_FILES))
> +
> +## Built sources are automatically removed by maintainer-clean.ù

ù

> +     $(call .am.clean-cmd.f,$(am__mostlyclean_files))
> +     $(call .am.clean-cmd.d,$(am__mostlyclean_dirs))

You could also just pass the name of the variable.


Good!





reply via email to

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