From eda59a6ca0e9eae395fef339ca809d133f92902c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 8 Aug 2005 22:14:40 +0000 Subject: r9217: Add 'make clean' hooks to the ans1 depedency generator. To be used by the impending Heimdal resync, which has files starting with asn1_ that are not generated. Andrew Bartlett (This used to be commit 15b7af1c39a8369fb701f60485c7ac2040f1c27a) --- source4/heimdal_build/asn1_deps.pl | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'source4/heimdal_build/asn1_deps.pl') diff --git a/source4/heimdal_build/asn1_deps.pl b/source4/heimdal_build/asn1_deps.pl index f102a6c663..962aadfdad 100755 --- a/source4/heimdal_build/asn1_deps.pl +++ b/source4/heimdal_build/asn1_deps.pl @@ -7,7 +7,8 @@ use File::Basename; my $file = shift; my $prefix = shift; - +my $x_file, @x_files; +my $c_file, @c_files; if (not defined ($prefix)) { $prefix = "asn1"; } $dirname = dirname($file); @@ -24,9 +25,23 @@ foreach() { if (/^([A-Za-z0-9_-]+)[ \t]*::= /) { my $output = $1; $output =~ s/-/_/g; - print "$dirname/asn1_$output.x: $header\n"; - print "$dirname/asn1_$output.c: $dirname/asn1_$output.x\n"; - print "\t\@cp $dirname/asn1_$output.x $dirname/asn1_$output.c\n\n"; + $c_file = "$dirname/asn1_$output.c"; + $x_file = "$dirname/asn1_$output.x"; + print "$x_file: $header\n"; + print "$c_file: $dirname/asn1_$output.x\n"; + print "\t\@cp $x_file $c_file\n\n"; + push @x_files, $x_file; + push @c_files, $c_file; } } close(IN); +print $prefix."_clean: \n"; +print "\t\@echo \"Deleting ASN1 ouput files generated from $file\""; +print "\n\t\@rm -f $header"; +foreach $c_file (@c_files) { + print "\n\t\@rm -f $c_file"; +} +foreach $x_file (@x_files) { + print "\n\t\@rm -f $x_file"; +} +print "\n\n"; -- cgit