Remove clean-depend
Remove depend hacks from demos/engines.
Remove clean-depend; just call makedepend (or $CC -M) and use that.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Rich Salz authored 8 years ago
Rich Salz committed 8 years ago
88 | 88 | touch $(SHLIB).aix |
89 | 89 | |
90 | 90 | depend: |
91 | sed -e '/^# DO NOT DELETE.*/,$$d' < Makefile > Makefile.tmp | |
92 | echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp | |
93 | gcc -M $(CFLAGS) $(SRC) >> Makefile.tmp | |
94 | perl ../../../util/clean-depend.pl < Makefile.tmp > Makefile.new | |
95 | rm -f Makefile.tmp Makefile | |
96 | mv Makefile.new Makefile | |
97 | 91 | |
98 | 92 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
88 | 88 | touch $(SHLIB).aix |
89 | 89 | |
90 | 90 | depend: |
91 | sed -e '/^# DO NOT DELETE.*/,$$d' < Makefile > Makefile.tmp | |
92 | echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp | |
93 | gcc -M $(CFLAGS) $(SRC) >> Makefile.tmp | |
94 | perl ../../../util/clean-depend.pl < Makefile.tmp > Makefile.new | |
95 | rm -f Makefile.tmp Makefile | |
96 | mv Makefile.new Makefile | |
97 | 91 | |
98 | 92 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
109 | 109 | touch $(SHLIB).aix |
110 | 110 | |
111 | 111 | depend: |
112 | sed -e '/^# DO NOT DELETE.*/,$$d' < Makefile > Makefile.tmp | |
113 | echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp | |
114 | gcc -M $(CFLAGS) $(SRC) >> Makefile.tmp | |
115 | perl ../../../util/clean-depend.pl < Makefile.tmp > Makefile.new | |
116 | rm -f Makefile.tmp Makefile | |
117 | mv Makefile.new Makefile | |
118 | 112 | |
119 | 113 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
88 | 88 | touch $(SHLIB).aix |
89 | 89 | |
90 | 90 | depend: |
91 | sed -e '/^# DO NOT DELETE.*/,$$d' < Makefile > Makefile.tmp | |
92 | echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp | |
93 | gcc -M $(CFLAGS) $(SRC) >> Makefile.tmp | |
94 | perl ../../../util/clean-depend.pl < Makefile.tmp > Makefile.new | |
95 | rm -f Makefile.tmp Makefile | |
96 | mv Makefile.new Makefile | |
97 | 91 | |
98 | 92 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
0 | #!/usr/local/bin/perl -w | |
1 | # Clean the dependency list in a makefile of standard includes... | |
2 | # Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999 | |
3 | ||
4 | use strict; | |
5 | use Cwd; | |
6 | ||
7 | my $path = getcwd(); | |
8 | $path =~ /([^\/]+)$/; | |
9 | $path = $1; | |
10 | ||
11 | while(<STDIN>) { | |
12 | print; | |
13 | last if /^# DO NOT DELETE THIS LINE/; | |
14 | } | |
15 | ||
16 | my %files; | |
17 | ||
18 | # Fetch all the dependency output first | |
19 | my $thisfile=""; | |
20 | while(<STDIN>) { | |
21 | my ($dummy, $file,$deps)=/^((.*):)? (.*)$/; | |
22 | $thisfile=$file if defined $file; | |
23 | next if !defined $deps; | |
24 | my @deps=split ' ',$deps; | |
25 | @deps=grep(!/^\\$/,@deps); | |
26 | push @{$files{$thisfile}},@deps; | |
27 | } | |
28 | ||
29 | my $file; | |
30 | ||
31 | # Time to clean out possible system directories and normalise quirks | |
32 | # from different makedepend methods | |
33 | foreach $file (sort keys %files) { | |
34 | # This gets around a quirk with gcc, which removes all directory | |
35 | # information from the original file | |
36 | my $tmpfile=$file; | |
37 | $tmpfile=~s/\.o$/.c/; | |
38 | (my $origfile)=grep(/(^|\/)${tmpfile}$/,@{$files{$file}}); | |
39 | my $newfile=$origfile; | |
40 | $newfile=~s/\.c$/.o/; | |
41 | if ($newfile ne $file) { | |
42 | $files{$newfile} = $files{$file}; | |
43 | delete $files{$file}; | |
44 | $file = $newfile; | |
45 | } | |
46 | ||
47 | @{$files{$file}} = | |
48 | grep(!/^\//, | |
49 | grep(!/^$origfile$/, @{$files{$file}})); | |
50 | } | |
51 | ||
52 | foreach $file (sort keys %files) { | |
53 | my $len=0; | |
54 | my $dep; | |
55 | my $origfile=$file; | |
56 | $origfile=~s/\.o$/.c/; | |
57 | $file=~s/^\.\///; | |
58 | push @{$files{$file}},$origfile; | |
59 | my $prevdep=""; | |
60 | ||
61 | # Remove leading ./ before sorting | |
62 | my @deps = map { $_ =~ s/^\.\///; $_ } @{$files{$file}}; | |
63 | # Remove ../thisdir/ | |
64 | @deps = map { $_ =~ s|^../$path/||; $_ } @deps; | |
65 | ||
66 | foreach $dep (sort @deps) { | |
67 | $dep=~s/^\.\///; | |
68 | next if $prevdep eq $dep; # to exterminate duplicates... | |
69 | $prevdep = $dep; | |
70 | $len=0 if $len+length($dep)+1 >= 80; | |
71 | if($len == 0) { | |
72 | print "\n$file:"; | |
73 | $len=length($file)+1; | |
74 | } | |
75 | print " $dep"; | |
76 | $len+=length($dep)+1; | |
77 | } | |
78 | } | |
79 | ||
80 | print "\n"; |
0 | 0 | #!/bin/sh |
1 | # Do a makedepend, only leave out the standard headers | |
2 | # Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999 | |
1 | # Wrapper to portably run makedepend or equivalent compiler built-in. | |
2 | # Runs on Makefile.in, generates Makefile | |
3 | 3 | |
4 | 4 | TOP=$1 |
5 | 5 | shift |
12 | 12 | shift |
13 | 13 | fi |
14 | 14 | fi |
15 | if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi | |
15 | if [ -z "$MAKEDEPEND" ] ; then | |
16 | MAKEDEPEND=makedepend | |
17 | fi | |
16 | 18 | |
17 | cp Makefile Makefile.save | |
18 | if ${MAKEDEPEND} --version 2>&1 | grep "clang" > /dev/null || | |
19 | echo $MAKEDEPEND | grep "gcc" > /dev/null; then | |
19 | if ${MAKEDEPEND} --version 2>&1 | egrep "clang|gcc" >/dev/null | |
20 | 20 | args="" |
21 | 21 | while [ $# -gt 0 ]; do |
22 | if [ "$1" != "--" ]; then args="$args $1"; fi | |
22 | if [ "$1" != '--' ] ; then | |
23 | args="$args $1" | |
24 | fi | |
23 | 25 | shift |
24 | 26 | done |
25 | sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp | |
26 | echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp | |
27 | ${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit 1 | |
28 | ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new | |
29 | RC=$? | |
30 | rm -f Makefile.tmp | |
27 | ${MAKEDEPEND} -Werror -DOPENSSL_DOING_MAKEDEPEND -M $args >Makefile.tmp || exit 1 | |
28 | cat Makefile.in Makefile.tmp >Makefile | |
29 | rm Makefile.tmp | |
31 | 30 | else |
32 | ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@ && \ | |
33 | ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new | |
34 | RC=$? | |
31 | cp Makefile.in Makefile | |
32 | ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1 | |
35 | 33 | fi |
36 | mv Makefile.new Makefile | |
37 | ||
38 | exit $RC |