Replace sed command with perl
[openssl.git] / Configurations / unix-Makefile.tmpl
index be6299bc808abbb866b173fd8e00cb91dc6590bb..1923acc2f265d54e2add96632cc430e00755c1d3 100644 (file)
@@ -260,7 +260,7 @@ clean: libclean
 # concatenate only if that is true.
 depend:
        @: {- output_off() if $disabled{makedepend}; "" -}
-       @if [ -z "`find $(DEPS) -newer Makefile`" ]; then \
+       @if [ -z "`find $(DEPS) -newer Makefile 2>/dev/null; exit 0`" ]; then \
          ( sed -e '/^# DO NOT DELETE THIS LINE.*/,$$d' < Makefile; \
            echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
            echo; \
@@ -492,11 +492,11 @@ uninstall_runtime:
 
 # A method to extract all names from a .pod file
 # The first sed extracts everything between "=head1 NAME" and the next =head1
-# The second sed joins all the lines into one
-# The third sed removes the description and turns all commas into spaces
+# The perl command joins all the lines into one
+# The second sed removes the description and turns all commas into spaces
 # VoilĂ , you have a space separated list of names!
 EXTRACT_NAMES=sed -e '1,/^=head1  *NAME *$$/d;/^=head1/,$$d' | \
-              sed -e ':a;{N;s/\n/ /;ba}' | \
+              $(PERL) -p -0 -e 's/\n/ /g; END {print "\n"}' | \
               sed -e 's/ - .*$$//;s/,/ /g'
 PROCESS_PODS=\
        set -e; \
@@ -617,7 +617,7 @@ generate: generate_apps generate_crypto_bn generate_crypto_objects
 lint:
        lint -DLINT $(INCLUDES) $(SRCS)
 
-generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
+generate_apps: $(SRCDIR)/apps/openssl-vms.cnf
 
 generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
 
@@ -695,17 +695,6 @@ $(SRCDIR)/apps/openssl-vms.cnf: $(SRCDIR)/apps/openssl.cnf
        $(PERL) $(SRCDIR)/VMS/VMSify-conf.pl \
                 < $(SRCDIR)/apps/openssl.cnf > $(SRCDIR)/apps/openssl-vms.cnf
 
-{- # because the program apps/openssl has object files as sources, and
-   # they then have the corresponding C files as source, we need to chain
-   # the lookups in %unified_info
-   my $apps_openssl = catfile("apps","openssl");
-   our @openssl_source = map { @{$unified_info{sources}->{$_}} }
-                         @{$unified_info{sources}->{$apps_openssl}};
-   ""; -}
-$(SRCDIR)/apps/progs.h:
-       $(RM) $@
-       $(PERL) $(SRCDIR)/apps/progs.pl {- join(" ", @openssl_source) -} > $@
-
 $(SRCDIR)/crypto/bn/bn_prime.h: $(SRCDIR)/crypto/bn/bn_prime.pl
        $(PERL) $(SRCDIR)/crypto/bn/bn_prime.pl > $(SRCDIR)/crypto/bn/bn_prime.h
 
@@ -813,10 +802,11 @@ configdata.pm: $(SRCDIR)/Configurations/unix-Makefile.tmpl $(SRCDIR)/Configurati
       my %args = @_;
       my $generator = join(" ", @{$args{generator}});
       my $incs = join("", map { " -I".$_ } @{$args{incs}});
+      my $deps = join(" ", @{$args{deps}});
 
       if ($args{src} !~ /\.[sS]$/) {
           return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: $args{generator}->[0] $deps
        \$(PERL) $generator > \$@
 EOF
       } else {
@@ -836,7 +826,7 @@ EOF
               if ($args{src} =~ /\.S$/) {
                    (my $target = $args{src}) =~ s|\.S$|.s|;
                    return <<"EOF";
-$target: $args{generator}->[0]
+$target: $args{generator}->[0] $deps
        ( trap "rm -f \$@.*" INT 0; \\
          $generator \$@.S; \\
          \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@.i && mv -f \$@.i \$@ )
@@ -844,12 +834,12 @@ EOF
               }
               # Otherwise....
               return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: $args{generator}->[0] $deps
        $generator \$@
 EOF
           }
           return <<"EOF";
-$args{src}: $args{generator}->[0]
+$args{src}: $args{generator}->[0] $deps
        \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
 EOF
       }