lib: \$(LIBS_DEP) \$(E_SHLIB)
-exe: apps testapps
-apps: \$(BIN_D)$o\$(E_EXE)$exep
+exe: apps tools testapps
+apps: \$(BIN_D)$o\$(E_EXE)$exep \$(BIN_D)${o}CA.pl
testapps: \$(T_EXE)
+tools: \$(BIN_D)${o}c_rehash
install: all
\$(MKDIR) \"\$(INSTALLTOP)\"
EOF
-$rules .= &do_rehash_rule("rehash.time", "certs apps");
+$rules .= &do_rehash_rule("rehash.time", "certs/demo apps tools");
$rules .= &do_test_rule("test", "rehash.time", "run_tests.pl");
my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform";
}
open (OUT,">>crypto/buildinf.h") || die "Can't open buildinf.h";
-printf OUT <<EOF;
+printf OUT <<"EOF";
#ifdef $platform_cpp_symbol
/* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */
#define CFLAGS "compiler: $cc $cflags"
$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0);
+$rules.=&do_dofile_rule("\$(BIN_D)","c_rehash","tools/c_rehash.in");
+$rules.=&do_dofile_rule("\$(BIN_D)","CA.pl","apps/CA.pl.in");
+
print $defs;
if ($platform eq "linux-elf") {
local($to,$files,$p)=@_;
local($ret,$_,$n,$pp);
+
$files =~ s/\//$o/g if $o ne '/';
foreach (split(/\s+/,$files))
{
return($ret);
}
+sub do_dofile_rule
+ {
+ (my $to, my $file, my $tmpl) = @_;
+
+ $file =~ s|/|$o|g if $o ne '/';
+ return <<"EOF";
+$to${o}$file: $tmpl
+ \$(PERL) "-I." "-Mconfigdata" util/dofile.pl "$tmpl" > "$to${o}$file.new"
+ mv "$to${o}$file.new" "$to${o}$file"
+EOF
+ }
+
# Options picked up from the OPTIONS line in the top level Makefile
# generated by Configure.