lint:
lint -DLINT $(INCLUDES) $(SRCS)
-generate_apps: $(SRCDIR)/apps/openssl-vms.cnf
+generate_apps: $(SRCDIR)/apps/openssl-vms.cnf $(SRCDIR)/apps/progs.h
generate_crypto_bn: $(SRCDIR)/crypto/bn/bn_prime.h
$(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
genpkey.c genrsa.c nseq.c ocsp.c passwd.c pkcs12.c pkcs7.c pkcs8.c \
pkey.c pkeyparam.c pkeyutl.c prime.c rand.c req.c rsa.c rsautl.c \
s_client.c s_server.c s_time.c sess_id.c smime.c speed.c spkac.c \
- srp.c ts.c verify.c version.c x509.c
+ srp.c ts.c verify.c version.c x509.c rehash.c
EXE_OBJ = openssl.o $(OBJ) $(EXTRA_OBJ) $(RAND_OBJ)
EXE_SRC = openssl.c $(SRC) $(EXTRA_SRC) $(RAND_SRC)
done
$(RM) $(INSTALL_PREFIX)$(OPENSSLDIR)/openssl.cnf
-generate: openssl-vms.cnf
+generate: openssl-vms.cnf progs.h
depend:
$(TOP)/util/domd $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(EXE_SRC)
$(DLIBCRYPTO):
(cd ..; $(MAKE) build_libcrypto)
-$(EXE): progs.h $(EXE_OBJ) $(DLIBCRYPTO) $(DLIBSSL)
+$(EXE): $(EXE_OBJ) $(DLIBCRYPTO) $(DLIBSSL)
$(RM) $(EXE)
shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
shlib_target="$(SHLIB_TARGET)"; \
LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
link_app.$${shlib_target}
-progs.h: progs.pl Makefile
+progs.h: progs.pl Makefile.in
$(RM) progs.h
- $(PERL) progs.pl $(COMMANDS) >progs.h
- $(RM) openssl.o
+ $(PERL) progs.pl $(EXE_SRC) > progs.h
CA.pl: CA.pl.in
$(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl -oapps/Makefile CA.pl.in > CA.pl.new
SCRIPTS=CA.pl
SOURCE[CA.pl]=CA.pl.in
-
-BEGINRAW[Makefile]
-{- $builddir -}/progs.h: {- $sourcedir -}/progs.pl {- $builddir -}/../Makefile
- $(RM) {- $builddir -}/progs.h
- $(PERL) {- $sourcedir -}/progs.pl $(COMMANDS) >{- $builddir -}/progs.h
-ENDRAW[Makefile]
-#!/usr/local/bin/perl
-# Generate progs.h file from list of "programs" passed on the command line.
+#!/usr/bin/perl
+# Generate progs.h file by looking for command mains in list of C files
+# passed on the command line.
+
+use strict;
+use warnings;
+
+my %commands = ();
+my $cmdre = qr/^\s*int\s+([a-z_][a-z0-9_]*)_main\(\s*int\s+argc\s*,/;
+
+foreach my $filename (@ARGV) {
+ open F, $filename or die "Coudn't open $_: $!\n";
+ foreach (grep /$cmdre/, <F>) {
+ my @foo = /$cmdre/;
+ $commands{$1} = 1;
+ }
+ close F;
+}
+
+@ARGV = sort keys %commands;
print <<'EOF';
/*
EOF
-grep(s/\.o//, @ARGV);
-grep(s/^asn1pars$/asn1parse/, @ARGV);
-grep(s/^crl2p7$/crl2pkcs7/, @ARGV);
-push @ARGV, 'list';
-push @ARGV, 'help';
-push @ARGV, 'exit';
-
foreach (@ARGV) {
printf "extern int %s_main(int argc, char *argv[]);\n", $_;
}
print "\n#ifdef INCLUDE_FUNCTION_TABLE\n";
print "static FUNCTION functions[] = {\n";
foreach (@ARGV) {
- $str=" { FT_general, \"$_\", ${_}_main, ${_}_options },\n";
+ my $str=" { FT_general, \"$_\", ${_}_main, ${_}_options },\n";
if (/^s_/ || /^ciphers$/) {
print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n";
} elsif (/^engine$/) {
"cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb",
"cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb"
) {
- $str=" { FT_cipher, \"$_\", enc_main, enc_options },\n";
+ my $str=" { FT_cipher, \"$_\", enc_main, enc_options },\n";
if (/des/) {
printf "#ifndef OPENSSL_NO_DES\n${str}#endif\n";
} elsif (/aes/) {