grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
keys %{$unified_info{sources}}); -}
{- output_on() if $disabled{makedepend}; "" -}
-GENERATED={- join(" ", map { (my $x = $_) =~ s|\.S$|\.s|; $x } keys %{$unified_info{generate}}) -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
+GENERATED={- join(" ",
+ ( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
+ grep { defined $unified_info{generate}->{$_} }
+ map { @{$unified_info{sources}->{$_}} }
+ grep { /\.o$/ } keys %{$unified_info{sources}} ),
+ ( grep { /\.h$/ } keys %{$unified_info{generate}} )) -}
{- output_off() if $disabled{apps}; "" -}
BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
-MISC_SCRIPTS=$(SRCDIR)/tools/c_hash $(SRCDIR)/tools/c_info \
- $(SRCDIR)/tools/c_issuer $(SRCDIR)/tools/c_name \
- $(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
+MISC_SCRIPTS=$(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
{- output_on() if $disabled{apps}; "" -}
SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
# $prefix is not /usr.
. ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
-RCFLAGS={- $target{shared_rcflag} -}
DSO_CFLAGS={- $target{shared_cflag} || "" -}
DSO_LDFLAGS=$(LIB_LDFLAGS)
-BIN_CFLAGS={- "" -}
+BIN_CFLAGS={- $target{bin_cflags} -}
PERL={- $config{perl} -}
AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
RANLIB= {- $target{ranlib} -}
NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
+RCFLAGS={- $target{shared_rcflag} -}
+RC= $(CROSS_COMPILE){- $target{rc} || "windres" -}
RM= rm -f
RMDIR= rmdir
TAR= {- $target{tar} || "tar" -}
# The main targets ###################################################
-all: configdata.pm build_libs_nodep build_engines_nodep build_apps_nodep \
+all: build_generated \
+ build_libs_nodep build_engines_nodep build_apps_nodep \
depend link-utils
-build_libs: configdata.pm build_libs_nodep depend
+build_libs: build_generated build_libs_nodep depend
build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
-build_engines: configdata.pm build_engines_nodep depend
+build_engines: build_generated build_engines_nodep depend
build_engines_nodep: $(ENGINES)
-build_apps: configdata.pm build_apps_nodep depend
+build_apps: build_generated build_apps_nodep depend
build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
-build_tests: configdata.pm build_tests_nodep depend
+build_tests: build_generated build_tests_nodep depend
build_tests_nodep: $(TESTPROGS)
+build_generated: $(GENERATED_MANDATORY)
+
test: tests
-tests: build_tests_nodep build_apps_nodep build_engines_nodep \
+tests: build_generated \
+ build_tests_nodep build_apps_nodep build_engines_nodep \
depend link-utils
@ : {- output_off() if $disabled{tests}; "" -}
( cd test; \
SRCTOP=../$(SRCDIR) \
BLDTOP=../$(BLDDIR) \
+ PERL="$(PERL)" \
EXE_EXT={- $exeext -} \
OPENSSL_ENGINES=../$(BLDDIR)/engines \
$(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
@ : {- output_on() if !$disabled{tests}; "" -}
list-tests:
- @TOP=$(SRCDIR) PERL=$(PERL) $(PERL) $(SRCDIR)/test/run_tests.pl list
+ @TOP="$(SRCDIR)" PERL="$(PERL)" $(PERL) $(SRCDIR)/test/run_tests.pl list
libclean:
@set -e; for s in $(SHLIB_INFO); do \
rm -f core
rm -f tags TAGS
rm -f openssl.pc libcrypto.pc libssl.pc
- -rm -f `find . -type l`
+ -rm -f `find . -type l -a \! -path "./.git/*"`
rm -f $(TARFILE)
+distclean: clean
+ rm -f configdata.pm
+ rm -f Makefile
+
# This exists solely for those who still type 'make depend'
#
# We check if any depfile is newer than Makefile and decide to
SEC=`sed -ne 's/^=for *comment *openssl_manual_section: *\([0-9]\) *$$/\1/p' $$p`; \
[ -z "$$SEC" ] && SEC=$$defsec; \
fn=`basename $$p .pod`; \
+ Name=$$fn; \
NAME=`echo $$fn | tr [a-z] [A-Z]`; \
suf=`eval "echo $$OUTSUFFIX"`; \
top=`eval "echo $$OUTTOP"`; \
OUTSUFFIX='.$(HTMLSUFFIX)'; \
OUTTOP="$(DESTDIR)$(HTMLDIR)"; \
GENERATE="pod2html --podroot=$(SRCDIR)/doc --htmldir=.. \
- --podpath=apps:crypto:ssl \
+ --podpath=apps:crypto:ssl --title=\$$Name \
| sed -e 's|href=\"http://man.he.net/man|href=\"../man|g'"; \
$(PROCESS_PODS)
update: generate errors ordinals
-generate: generate_apps generate_crypto_bn generate_crypto_objects
+generate: generate_apps generate_crypto_bn generate_crypto_objects \
+ generate_crypto_conf generate_crypto_asn1
# Test coverage is a good idea for the future
#coverage: $(PROGRAMS) $(TESTPROGRAMS)
( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
generate_crypto_objects:
- ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
- include/openssl/obj_mac.h \
- crypto/objects/obj_dat.h )
( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
crypto/objects/objects.txt \
crypto/objects/obj_mac.num \
include/openssl/obj_mac.h )
+ ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
+ include/openssl/obj_mac.h \
+ crypto/objects/obj_dat.h )
( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
crypto/objects/obj_mac.num \
crypto/objects/obj_xref.txt \
> crypto/objects/obj_xref.h )
+generate_crypto_conf:
+ ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
+ > crypto/conf/conf_def.h )
+
+generate_crypto_asn1:
+ ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
+ > crypto/asn1/charmap.h )
+
errors:
( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
# Release targets (note: only available on Unix) #####################
-TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
+TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
PREPARE_CMD=:
tar:
TMPDIR=/var/tmp/openssl-copy.$$$$; \
mkdir -p $$TMPDIR/$$DISTDIR; \
(cd $(SRCDIR); \
git ls-tree -r --name-only --full-tree HEAD \
+ | grep -v '^fuzz/corpora' \
| while read F; do \
mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
cp $$F $$TMPDIR/$$DISTDIR/$$F; \
my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
if ($args{src} !~ /\.[sS]$/) {
- return <<"EOF";
+ if ($args{generator}->[0] =~ m|^.*\.in$|) {
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$args{src}: $args{generator}->[0] $deps
+ \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $generator > \$@
+EOF
+ } else {
+ return <<"EOF";
$args{src}: $args{generator}->[0] $deps
\$(PERL)$generator_incs $generator > \$@
EOF
+ }
} else {
if ($args{generator}->[0] =~ /\.pl$/) {
$generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
$target: $args{generator}->[0] $deps
( trap "rm -f \$@.*" INT 0; \\
$generator \$@.S; \\
- \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@.i && mv -f \$@.i \$@ )
+ \$(CC) \$(CFLAGS) $incs -E \$@.S | \\
+ \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.i && \\
+ mv -f \$@.i \$@ )
EOF
}
# Otherwise....
}
return <<"EOF";
$args{src}: $args{generator}->[0] $deps
- \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
+ \$(CC) \$(CFLAGS) $incs -E \$< | \\
+ \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
EOF
}
}
$target: $lib$libext $deps $ordinalsfile
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PLATFORM=\$(PLATFORM) \\
- PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
+ PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
LIBNAME=$libname LIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
LIBCOMPATVERSIONS=';\$(SHLIB_VERSION_HISTORY)' \\
CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
- CROSS_COMPILE='\$(CROSS_COMPILE)' LDFLAGS='\$(LDFLAGS)' \\
+ LDFLAGS='\$(LDFLAGS)' \\
SHARED_LDFLAGS='\$(LIB_LDFLAGS)' SHLIB_EXT=$shlibext \\
- SHARED_RCFLAGS='\$(RCFLAGS)' \\
+ RC='\$(RC)' SHARED_RCFLAGS='\$(RCFLAGS)' \\
link_shlib.$shlib_target
EOF
. (windowsdll() ? <<"EOF" : "");
$target: $objs $deps
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
PLATFORM=\$(PLATFORM) \\
- PERL=\$(PERL) SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
+ PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
LIBNAME=$libname LDFLAGS='\$(LDFLAGS)' \\
CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
$bin$exeext: $objs $deps
\$(RM) $bin$exeext
\$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
- PERL=\$(PERL) SRCDIR=\$(SRCDIR) \\
+ PERL="\$(PERL)" SRCDIR=\$(SRCDIR) \\
APPNAME=$bin$exeext OBJECTS="$objs" \\
LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(BIN_CFLAGS)' \\
\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
"-o$target{build_file}" $sources > "$script"
chmod a+x $script
+EOF
+ }
+ sub generatedir {
+ my %args = @_;
+ my $dir = $args{dir};
+ my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
+ my @actions = ();
+ my %extinfo = ( dso => $dsoext,
+ lib => $libext,
+ bin => $exeext );
+
+ foreach my $type (("dso", "lib", "bin", "script")) {
+ next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
+ if ($type eq "lib") {
+ foreach my $lib (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
+ push @actions, <<"EOF";
+ \$(AR) $lib$libext \$\?
+ \$(RANLIB) $lib$libext || echo Never mind.
+EOF
+ }
+ } else {
+ foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
+ if (dirname($prod) eq $dir) {
+ push @deps, $prod.$extinfo{$type};
+ } else {
+ push @actions, "\t@ : No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
+ }
+ }
+ }
+ }
+
+ my $deps = join(" ", @deps);
+ my $actions = join("\n", "", @actions);
+ return <<"EOF";
+$args{dir} $args{dir}/: $deps$actions
EOF
}
"" # Important! This becomes part of the template result.