grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
keys %{$unified_info{sources}}); -}
{- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
GENERATED={- join(" ",
( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
grep { defined $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}}) -}
# 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 `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
# 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: $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) \\
$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.