1e0c4386eSCy Schubert## 2e0c4386eSCy Schubert## Makefile for OpenSSL 3e0c4386eSCy Schubert## 4e0c4386eSCy Schubert## {- join("\n## ", @autowarntext) -} 5e0c4386eSCy Schubert{- 6e0c4386eSCy Schubert use OpenSSL::Util; 7e0c4386eSCy Schubert 8e0c4386eSCy Schubert our $makedep_scheme = $config{makedep_scheme}; 9e0c4386eSCy Schubert our $makedepcmd = platform->makedepcmd(); 10e0c4386eSCy Schubert 11e0c4386eSCy Schubert sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ } 12e0c4386eSCy Schubert 13e0c4386eSCy Schubert # Shared AIX support is special. We put libcrypto[64].so.ver into 14e0c4386eSCy Schubert # libcrypto.a and use libcrypto_a.a as static one. 15e0c4386eSCy Schubert sub sharedaix { !$disabled{shared} && $config{target} =~ /^aix/ } 16e0c4386eSCy Schubert 17e0c4386eSCy Schubert our $sover_dirname = platform->shlib_version_as_filename(); 18e0c4386eSCy Schubert 19e0c4386eSCy Schubert # This makes sure things get built in the order they need 20e0c4386eSCy Schubert # to. You're welcome. 21e0c4386eSCy Schubert sub dependmagic { 22e0c4386eSCy Schubert my $target = shift; 23e0c4386eSCy Schubert 24*44096ebdSEnji Cooper return "$target: build_generated\n\t\"\$(MAKE)\" depend && \"\$(MAKE)\" _$target\n_$target"; 25e0c4386eSCy Schubert } 26e0c4386eSCy Schubert 27e0c4386eSCy Schubert our $COLUMNS = $ENV{COLUMNS}; 28e0c4386eSCy Schubert if ($COLUMNS =~ /^\d+$/) { 29e0c4386eSCy Schubert $COLUMNS = int($COLUMNS) - 2; # 2 to leave space for ending ' \' 30e0c4386eSCy Schubert } else { 31e0c4386eSCy Schubert $COLUMNS = 76; 32e0c4386eSCy Schubert } 33e0c4386eSCy Schubert 34e0c4386eSCy Schubert sub fill_lines { 35e0c4386eSCy Schubert my $item_sep = shift; # string 36e0c4386eSCy Schubert my $line_length = shift; # number of chars 37e0c4386eSCy Schubert 38e0c4386eSCy Schubert my @result = (); 39e0c4386eSCy Schubert my $resultpos = 0; 40e0c4386eSCy Schubert 41e0c4386eSCy Schubert foreach (@_) { 42e0c4386eSCy Schubert my $fill_line = $result[$resultpos] // ''; 43e0c4386eSCy Schubert my $newline = 44e0c4386eSCy Schubert ($fill_line eq '' ? '' : $fill_line . $item_sep) . $_; 45e0c4386eSCy Schubert 46e0c4386eSCy Schubert if (length($newline) > $line_length) { 47e0c4386eSCy Schubert # If this is a single item and the intended result line 48e0c4386eSCy Schubert # is empty, we put it there anyway 49e0c4386eSCy Schubert if ($fill_line eq '') { 50e0c4386eSCy Schubert $result[$resultpos++] = $newline; 51e0c4386eSCy Schubert } else { 52e0c4386eSCy Schubert $result[++$resultpos] = $_; 53e0c4386eSCy Schubert } 54e0c4386eSCy Schubert } else { 55e0c4386eSCy Schubert $result[$resultpos] = $newline; 56e0c4386eSCy Schubert } 57e0c4386eSCy Schubert } 58e0c4386eSCy Schubert return @result; 59e0c4386eSCy Schubert } 60e0c4386eSCy Schubert ''; 61e0c4386eSCy Schubert-} 62e0c4386eSCy SchubertPLATFORM={- $config{target} -} 63e0c4386eSCy SchubertOPTIONS={- $config{options} -} 64e0c4386eSCy SchubertCONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -}) 65e0c4386eSCy SchubertSRCDIR={- $config{sourcedir} -} 66e0c4386eSCy SchubertBLDDIR={- $config{builddir} -} 67e0c4386eSCy SchubertFIPSKEY={- $config{FIPSKEY} -} 68e0c4386eSCy Schubert 69e0c4386eSCy SchubertVERSION={- "$config{full_version}" -} 70e0c4386eSCy SchubertVERSION_NUMBER={- "$config{version}" -} 71e0c4386eSCy SchubertMAJOR={- $config{major} -} 72e0c4386eSCy SchubertMINOR={- $config{minor} -} 73e0c4386eSCy SchubertSHLIB_VERSION_NUMBER={- $config{shlib_version} -} 74e0c4386eSCy SchubertSHLIB_TARGET={- $target{shared_target} -} 75e0c4386eSCy Schubert 76e0c4386eSCy SchubertLIBS={- join(" \\\n" . ' ' x 5, 77e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 5, 78e0c4386eSCy Schubert map { platform->staticlib($_) // () } 79e0c4386eSCy Schubert @{$unified_info{libraries}})) -} 80e0c4386eSCy SchubertSHLIBS={- join(" \\\n" . ' ' x 7, 81e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 7, 82e0c4386eSCy Schubert map { platform->sharedlib($_) // () } 83e0c4386eSCy Schubert @{$unified_info{libraries}})) -} 84e0c4386eSCy SchubertSHLIB_INFO={- join(" \\\n" . ' ' x 11, 85e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 11, 86e0c4386eSCy Schubert map { my $x = platform->sharedlib($_); 87e0c4386eSCy Schubert my $y = platform->sharedlib_simple($_) // ''; 88e0c4386eSCy Schubert my $z = platform->sharedlib_import($_) // ''; 89e0c4386eSCy Schubert $x ? "\"$x;$y;$z\"" : () } 90e0c4386eSCy Schubert @{$unified_info{libraries}})) -} 91e0c4386eSCy SchubertMODULES={- join(" \\\n" . ' ' x 8, 92e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 8, 93e0c4386eSCy Schubert map { platform->dso($_) } 94e0c4386eSCy Schubert # Drop all modules that are dependencies, they will 95e0c4386eSCy Schubert # be processed through their dependents 96e0c4386eSCy Schubert grep { my $x = $_; 97e0c4386eSCy Schubert !grep { grep { $_ eq $x } @$_ } 98e0c4386eSCy Schubert values %{$unified_info{depends}} } 99e0c4386eSCy Schubert @{$unified_info{modules}})) -} 100e0c4386eSCy SchubertFIPSMODULE={- # We do some extra checking here, as there should be only one 101e0c4386eSCy Schubert use File::Basename; 102e0c4386eSCy Schubert our @fipsmodules = 103e0c4386eSCy Schubert grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} 104e0c4386eSCy Schubert && $unified_info{attributes}->{modules}->{$_}->{fips} } 105e0c4386eSCy Schubert @{$unified_info{modules}}; 106e0c4386eSCy Schubert die "More that one FIPS module" if scalar @fipsmodules > 1; 107e0c4386eSCy Schubert join(" ", map { platform->dso($_) } @fipsmodules) -} 108e0c4386eSCy SchubertFIPSMODULENAME={- die "More that one FIPS module" if scalar @fipsmodules > 1; 109e0c4386eSCy Schubert join(" ", map { basename(platform->dso($_)) } @fipsmodules) -} 110e0c4386eSCy Schubert 111e0c4386eSCy SchubertPROGRAMS={- join(" \\\n" . ' ' x 9, 112e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 9, 113e0c4386eSCy Schubert map { platform->bin($_) } 114e0c4386eSCy Schubert @{$unified_info{programs}})) -} 115e0c4386eSCy SchubertSCRIPTS={- join(" \\\n" . ' ' x 8, 116e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 8, @{$unified_info{scripts}})) -} 117e0c4386eSCy Schubert{- output_off() if $disabled{makedepend}; "" -} 118e0c4386eSCy SchubertDEPS={- join(" \\\n" . ' ' x 5, 119e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 5, 120e0c4386eSCy Schubert map { platform->isobj($_) ? platform->dep($_) : () } 121e0c4386eSCy Schubert grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ } 122e0c4386eSCy Schubert keys %{$unified_info{sources}})); -} 123e0c4386eSCy Schubert{- output_on() if $disabled{makedepend}; "" -} 124e0c4386eSCy SchubertGENERATED_MANDATORY={- join(" \\\n" . ' ' x 20, 125e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 20, 126e0c4386eSCy Schubert @{$unified_info{depends}->{""}})) -} 127e0c4386eSCy SchubertGENERATED_PODS={- # common0.tmpl provides @generated 128e0c4386eSCy Schubert join(" \\\n" . ' ' x 15, 129e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 15, 130e0c4386eSCy Schubert map { my $x = $_; 131e0c4386eSCy Schubert ( 132e0c4386eSCy Schubert grep { 133e0c4386eSCy Schubert $unified_info{attributes}->{depends} 134e0c4386eSCy Schubert ->{$x}->{$_}->{pod} // 0 135e0c4386eSCy Schubert } 136e0c4386eSCy Schubert keys %{$unified_info{attributes}->{depends}->{$x}} 137e0c4386eSCy Schubert ) ? $x : (); 138e0c4386eSCy Schubert } 139e0c4386eSCy Schubert @generated)) -} 140e0c4386eSCy SchubertGENERATED={- # common0.tmpl provides @generated 141e0c4386eSCy Schubert join(" \\\n" . ' ' x 5, 142e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 5, 143e0c4386eSCy Schubert map { platform->convertext($_) } @generated )) -} 144e0c4386eSCy Schubert 145e0c4386eSCy SchubertINSTALL_LIBS={- 146e0c4386eSCy Schubert join(" \\\n" . ' ' x 13, 147e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 13, 148e0c4386eSCy Schubert map { platform->staticlib($_) // () } 149e0c4386eSCy Schubert grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} } 150e0c4386eSCy Schubert @{$unified_info{libraries}})) 151e0c4386eSCy Schubert-} 152e0c4386eSCy SchubertINSTALL_SHLIBS={- 153e0c4386eSCy Schubert join(" \\\n" . ' ' x 15, 154e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 15, 155e0c4386eSCy Schubert map { platform->sharedlib($_) // () } 156e0c4386eSCy Schubert grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} } 157e0c4386eSCy Schubert @{$unified_info{libraries}})) 158e0c4386eSCy Schubert-} 159e0c4386eSCy SchubertINSTALL_SHLIB_INFO={- 160e0c4386eSCy Schubert join(" \\\n" . ' ' x 19, 161e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 19, 162e0c4386eSCy Schubert map { my $x = platform->sharedlib($_); 163e0c4386eSCy Schubert my $y = platform->sharedlib_simple($_) // ''; 164e0c4386eSCy Schubert my $z = platform->sharedlib_import($_) // ''; 165e0c4386eSCy Schubert $x ? "\"$x;$y;$z\"" : () } 166e0c4386eSCy Schubert grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} } 167e0c4386eSCy Schubert @{$unified_info{libraries}})) 168e0c4386eSCy Schubert-} 169e0c4386eSCy SchubertINSTALL_ENGINES={- 170e0c4386eSCy Schubert join(" \\\n" . ' ' x 16, 171e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 16, 172e0c4386eSCy Schubert map { platform->dso($_) } 173e0c4386eSCy Schubert grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} 174e0c4386eSCy Schubert && $unified_info{attributes}->{modules}->{$_}->{engine} } 175e0c4386eSCy Schubert @{$unified_info{modules}})) 176e0c4386eSCy Schubert-} 177e0c4386eSCy SchubertINSTALL_MODULES={- 178e0c4386eSCy Schubert join(" \\\n" . ' ' x 16, 179e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 16, 180e0c4386eSCy Schubert map { platform->dso($_) } 181e0c4386eSCy Schubert grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} 182e0c4386eSCy Schubert && !$unified_info{attributes}->{modules}->{$_}->{engine} 183e0c4386eSCy Schubert && !$unified_info{attributes}->{modules}->{$_}->{fips} } 184e0c4386eSCy Schubert @{$unified_info{modules}})) 185e0c4386eSCy Schubert-} 186e0c4386eSCy SchubertINSTALL_FIPSMODULE={- 187e0c4386eSCy Schubert join(" \\\n" . ' ' x 16, 188e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 16, 189e0c4386eSCy Schubert map { platform->dso($_) } 190e0c4386eSCy Schubert grep { !$unified_info{attributes}->{modules}->{$_}->{noinst} 191e0c4386eSCy Schubert && $unified_info{attributes}->{modules}->{$_}->{fips} } 192e0c4386eSCy Schubert @{$unified_info{modules}})) 193e0c4386eSCy Schubert-} 194e0c4386eSCy SchubertINSTALL_FIPSMODULECONF=providers/fipsmodule.cnf 195e0c4386eSCy SchubertINSTALL_PROGRAMS={- 196e0c4386eSCy Schubert join(" \\\n" . ' ' x 16, 197e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) } 198e0c4386eSCy Schubert grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} } 199e0c4386eSCy Schubert @{$unified_info{programs}})) 200e0c4386eSCy Schubert-} 201e0c4386eSCy SchubertBIN_SCRIPTS={- 202e0c4386eSCy Schubert join(" \\\n" . ' ' x 12, 203e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 12, 204e0c4386eSCy Schubert map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname}; 205e0c4386eSCy Schubert $x ? "$_:$x" : $_ } 206e0c4386eSCy Schubert grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst} 207e0c4386eSCy Schubert && !$unified_info{attributes}->{scripts}->{$_}->{misc} } 208e0c4386eSCy Schubert @{$unified_info{scripts}})) 209e0c4386eSCy Schubert-} 210e0c4386eSCy SchubertMISC_SCRIPTS={- 211e0c4386eSCy Schubert join(" \\\n" . ' ' x 13, 212e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 13, 213e0c4386eSCy Schubert map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname}; 214e0c4386eSCy Schubert $x ? "$_:$x" : $_ } 215e0c4386eSCy Schubert grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst} 216e0c4386eSCy Schubert && $unified_info{attributes}->{scripts}->{$_}->{misc} } 217e0c4386eSCy Schubert @{$unified_info{scripts}})) 218e0c4386eSCy Schubert-} 219e0c4386eSCy SchubertIMAGEDOCS1={- 220e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 221e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 222e0c4386eSCy Schubert @{$unified_info{imagedocs}->{man1}})) -} 223e0c4386eSCy SchubertIMAGEDOCS3={- 224e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 225e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 226e0c4386eSCy Schubert @{$unified_info{imagedocs}->{man3}})) -} 227e0c4386eSCy SchubertIMAGEDOCS5={- 228e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 229e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 230e0c4386eSCy Schubert @{$unified_info{imagedocs}->{man5}})) -} 231e0c4386eSCy SchubertIMAGEDOCS7={- 232e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 233e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 234e0c4386eSCy Schubert @{$unified_info{imagedocs}->{man7}})) -} 235e0c4386eSCy SchubertHTMLDOCS1={- 236e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 237e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 238e0c4386eSCy Schubert @{$unified_info{htmldocs}->{man1}})) -} 239e0c4386eSCy SchubertHTMLDOCS3={- 240e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 241e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 242e0c4386eSCy Schubert @{$unified_info{htmldocs}->{man3}})) -} 243e0c4386eSCy SchubertHTMLDOCS5={- 244e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 245e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 246e0c4386eSCy Schubert @{$unified_info{htmldocs}->{man5}})) -} 247e0c4386eSCy SchubertHTMLDOCS7={- 248e0c4386eSCy Schubert join(" \\\n" . ' ' x 10, 249e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 250e0c4386eSCy Schubert @{$unified_info{htmldocs}->{man7}})) -} 251e0c4386eSCy SchubertMANDOCS1={- 252e0c4386eSCy Schubert join(" \\\n" . ' ' x 9, 253e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 9, 254e0c4386eSCy Schubert @{$unified_info{mandocs}->{man1}})) -} 255e0c4386eSCy SchubertMANDOCS3={- 256e0c4386eSCy Schubert join(" \\\n" . ' ' x 9, 257e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 9, 258e0c4386eSCy Schubert @{$unified_info{mandocs}->{man3}})) -} 259e0c4386eSCy SchubertMANDOCS5={- 260e0c4386eSCy Schubert join(" \\\n" . ' ' x 9, 261e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 9, 262e0c4386eSCy Schubert @{$unified_info{mandocs}->{man5}})) -} 263e0c4386eSCy SchubertMANDOCS7={- 264e0c4386eSCy Schubert join(" \\\n" . ' ' x 9, 265e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 9, 266e0c4386eSCy Schubert @{$unified_info{mandocs}->{man7}})) -} 267e0c4386eSCy Schubert 268e0c4386eSCy SchubertAPPS_OPENSSL="{- use File::Spec::Functions; 269e0c4386eSCy Schubert catfile("apps","openssl") -}" 270e0c4386eSCy Schubert 271e0c4386eSCy Schubert# DESTDIR is for package builders so that they can configure for, say, 272e0c4386eSCy Schubert# /usr/ and yet have everything installed to /tmp/somedir/usr/. 273e0c4386eSCy Schubert# Normally it is left empty. 274e0c4386eSCy SchubertDESTDIR= 275e0c4386eSCy Schubert 276e0c4386eSCy Schubert# Do not edit these manually. Use Configure with --prefix or --openssldir 277e0c4386eSCy Schubert# to change this! Short explanation in the top comment in Configure 278e0c4386eSCy SchubertINSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet 279e0c4386eSCy Schubert # 280e0c4386eSCy Schubert our $prefix = $config{prefix} || "/usr/local"; 281e0c4386eSCy Schubert $prefix -} 282e0c4386eSCy SchubertOPENSSLDIR={- # 283e0c4386eSCy Schubert # The logic here is that if no --openssldir was given, 284e0c4386eSCy Schubert # OPENSSLDIR will get the value from $prefix plus "/ssl". 285e0c4386eSCy Schubert # If --openssldir was given and the value is an absolute 286e0c4386eSCy Schubert # path, OPENSSLDIR will get its value without change. 287e0c4386eSCy Schubert # If the value from --openssldir is a relative path, 288e0c4386eSCy Schubert # OPENSSLDIR will get $prefix with the --openssldir 289e0c4386eSCy Schubert # value appended as a subdirectory. 290e0c4386eSCy Schubert # 291e0c4386eSCy Schubert use File::Spec::Functions; 292e0c4386eSCy Schubert our $openssldir = 293e0c4386eSCy Schubert $config{openssldir} ? 294e0c4386eSCy Schubert (file_name_is_absolute($config{openssldir}) ? 295e0c4386eSCy Schubert $config{openssldir} 296e0c4386eSCy Schubert : catdir($prefix, $config{openssldir})) 297e0c4386eSCy Schubert : catdir($prefix, "ssl"); 298e0c4386eSCy Schubert $openssldir -} 299e0c4386eSCy SchubertLIBDIR={- our $libdir = $config{libdir}; 300e0c4386eSCy Schubert unless ($libdir) { 301e0c4386eSCy Schubert $libdir = "lib$target{multilib}"; 302e0c4386eSCy Schubert } 303e0c4386eSCy Schubert file_name_is_absolute($libdir) ? "" : $libdir -} 304e0c4386eSCy Schubert# $(libdir) is chosen to be compatible with the GNU coding standards 305e0c4386eSCy Schubertlibdir={- file_name_is_absolute($libdir) 306e0c4386eSCy Schubert ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -} 307e0c4386eSCy SchubertENGINESDIR=$(libdir)/engines-{- $sover_dirname -} 308e0c4386eSCy SchubertMODULESDIR=$(libdir)/ossl-modules 309e0c4386eSCy Schubert 310e0c4386eSCy Schubert# Convenience variable for those who want to set the rpath in shared 311e0c4386eSCy Schubert# libraries and applications 312e0c4386eSCy SchubertLIBRPATH=$(libdir) 313e0c4386eSCy Schubert 314e0c4386eSCy SchubertMANDIR=$(INSTALLTOP)/share/man 315e0c4386eSCy SchubertDOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME) 316e0c4386eSCy SchubertHTMLDIR=$(DOCDIR)/html 317e0c4386eSCy Schubert 318e0c4386eSCy Schubert# MANSUFFIX is for the benefit of anyone who may want to have a suffix 319e0c4386eSCy Schubert# appended after the manpage file section number. "ssl" is popular, 320e0c4386eSCy Schubert# resulting in files such as config.5ssl rather than config.5. 321e0c4386eSCy SchubertMANSUFFIX=ossl 322e0c4386eSCy SchubertHTMLSUFFIX=html 323e0c4386eSCy Schubert 324e0c4386eSCy Schubert# For "optional" echo messages, to get "real" silence 325e0c4386eSCy SchubertECHO = echo 326e0c4386eSCy Schubert 327e0c4386eSCy Schubert##### User defined commands and flags ################################ 328e0c4386eSCy Schubert 329e0c4386eSCy Schubert# We let the C compiler driver to take care of .s files. This is done in 330e0c4386eSCy Schubert# order to be excused from maintaining a separate set of architecture 331e0c4386eSCy Schubert# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC 332e0c4386eSCy Schubert# gcc, then the driver will automatically translate it to -xarch=v8plus 333e0c4386eSCy Schubert# and pass it down to assembler. In any case, we do not define AS or 334e0c4386eSCy Schubert# ASFLAGS for this reason. 335e0c4386eSCy Schubert 336e0c4386eSCy SchubertCROSS_COMPILE={- $config{CROSS_COMPILE} -} 337e0c4386eSCy SchubertCC=$(CROSS_COMPILE){- $config{CC} -} 338e0c4386eSCy SchubertCXX={- $config{CXX} ? "\$(CROSS_COMPILE)$config{CXX}" : '' -} 339e0c4386eSCy SchubertCPPFLAGS={- our $cppflags1 = join(" ", 340e0c4386eSCy Schubert (map { "-D".$_} @{$config{CPPDEFINES}}), 341e0c4386eSCy Schubert (map { "-I".$_} @{$config{CPPINCLUDES}}), 342e0c4386eSCy Schubert @{$config{CPPFLAGS}}) -} 343e0c4386eSCy SchubertCFLAGS={- join(' ', @{$config{CFLAGS}}) -} 344e0c4386eSCy SchubertCXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -} 345e0c4386eSCy SchubertLDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -} 346e0c4386eSCy SchubertEX_LIBS= {- join(' ', @{$config{LDLIBS}}) -} 347e0c4386eSCy Schubert 348e0c4386eSCy SchubertMAKEDEPEND={- $config{makedepcmd} -} 349e0c4386eSCy Schubert 350e0c4386eSCy SchubertPERL={- $config{PERL} -} 351e0c4386eSCy Schubert 352e0c4386eSCy SchubertAR=$(CROSS_COMPILE){- $config{AR} -} 353e0c4386eSCy SchubertARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -} 354e0c4386eSCy SchubertRANLIB={- $config{RANLIB} ? "\$(CROSS_COMPILE)$config{RANLIB}" : "true"; -} 355e0c4386eSCy SchubertRC= $(CROSS_COMPILE){- $config{RC} -} 356e0c4386eSCy SchubertRCFLAGS={- join(' ', @{$config{RCFLAGS}}) -} {- $target{shared_rcflag} -} 357e0c4386eSCy Schubert 358e0c4386eSCy SchubertRM= rm -f 359e0c4386eSCy SchubertRMDIR= rmdir 360e0c4386eSCy SchubertTAR= {- $target{TAR} || "tar" -} 361e0c4386eSCy SchubertTARFLAGS= {- $target{TARFLAGS} -} 362e0c4386eSCy Schubert 363e0c4386eSCy SchubertBASENAME= openssl 364e0c4386eSCy SchubertNAME= $(BASENAME)-$(VERSION) 365e0c4386eSCy Schubert# Relative to $(SRCDIR) 366e0c4386eSCy SchubertTARFILE= ../$(NAME).tar 367e0c4386eSCy Schubert 368e0c4386eSCy Schubert##### Project flags ################################################## 369e0c4386eSCy Schubert 370e0c4386eSCy Schubert# Variables starting with CNF_ are common variables for all product types 371e0c4386eSCy Schubert 372e0c4386eSCy SchubertCNF_CPPFLAGS={- our $cppflags2 = 373e0c4386eSCy Schubert join(' ', $target{cppflags} || (), 374e0c4386eSCy Schubert (map { "-D".$_} @{$target{defines}}, 375e0c4386eSCy Schubert @{$config{defines}}), 376e0c4386eSCy Schubert (map { "-I".$_} @{$target{includes}}, 377e0c4386eSCy Schubert @{$config{includes}}), 378e0c4386eSCy Schubert @{$config{cppflags}}) -} 379e0c4386eSCy SchubertCNF_CFLAGS={- join(' ', $target{cflags} || (), 380e0c4386eSCy Schubert @{$config{cflags}}) -} 381e0c4386eSCy SchubertCNF_CXXFLAGS={- join(' ', $target{cxxflags} || (), 382e0c4386eSCy Schubert @{$config{cxxflags}}) -} 383e0c4386eSCy SchubertCNF_LDFLAGS={- join(' ', $target{lflags} || (), 384e0c4386eSCy Schubert @{$config{lflags}}) -} 385e0c4386eSCy SchubertCNF_EX_LIBS={- join(' ', $target{ex_libs} || (), 386e0c4386eSCy Schubert @{$config{ex_libs}}) -} 387e0c4386eSCy Schubert 388e0c4386eSCy Schubert# Variables starting with LIB_ are used to build library object files 389e0c4386eSCy Schubert# and shared libraries. 390e0c4386eSCy Schubert# Variables starting with DSO_ are used to build DSOs and their object files. 391e0c4386eSCy Schubert# Variables starting with BIN_ are used to build programs and their object 392e0c4386eSCy Schubert# files. 393e0c4386eSCy Schubert 394e0c4386eSCy SchubertLIB_CPPFLAGS={- our $lib_cppflags = 395e0c4386eSCy Schubert join(' ', $target{lib_cppflags} || (), 396e0c4386eSCy Schubert $target{shared_cppflag} || (), 397e0c4386eSCy Schubert (map { '-D'.$_ } 398e0c4386eSCy Schubert @{$target{lib_defines} || ()}, 399e0c4386eSCy Schubert @{$target{shared_defines} || ()}, 400e0c4386eSCy Schubert @{$config{lib_defines} || ()}, 401e0c4386eSCy Schubert @{$config{shared_defines} || ()}), 402e0c4386eSCy Schubert (map { '-I'.quotify1($_) } 403e0c4386eSCy Schubert @{$target{lib_includes}}, 404e0c4386eSCy Schubert @{$target{shared_includes}}, 405e0c4386eSCy Schubert @{$config{lib_includes}}, 406e0c4386eSCy Schubert @{$config{shared_includes}}), 407e0c4386eSCy Schubert @{$config{lib_cppflags}}, 408e0c4386eSCy Schubert @{$config{shared_cppflag}}); 409e0c4386eSCy Schubert join(' ', $lib_cppflags, 410e0c4386eSCy Schubert (map { '-D'.$_ } 411e0c4386eSCy Schubert 'OPENSSLDIR="\"$(OPENSSLDIR)\""', 412e0c4386eSCy Schubert 'ENGINESDIR="\"$(ENGINESDIR)\""', 413e0c4386eSCy Schubert 'MODULESDIR="\"$(MODULESDIR)\""'), 414e0c4386eSCy Schubert '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -} 415e0c4386eSCy SchubertLIB_CFLAGS={- join(' ', $target{lib_cflags} || (), 416e0c4386eSCy Schubert $target{shared_cflag} || (), 417e0c4386eSCy Schubert @{$config{lib_cflags}}, 418e0c4386eSCy Schubert @{$config{shared_cflag}}, 419e0c4386eSCy Schubert '$(CNF_CFLAGS)', '$(CFLAGS)') -} 420e0c4386eSCy SchubertLIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (), 421e0c4386eSCy Schubert $target{shared_cxxflag} || (), 422e0c4386eSCy Schubert @{$config{lib_cxxflags}}, 423e0c4386eSCy Schubert @{$config{shared_cxxflag}}, 424e0c4386eSCy Schubert '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -} 425e0c4386eSCy SchubertLIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (), 426e0c4386eSCy Schubert $config{shared_ldflag} || (), 427e0c4386eSCy Schubert '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} 428e0c4386eSCy SchubertLIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) 429e0c4386eSCy SchubertDSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (), 430e0c4386eSCy Schubert $target{module_cppflags} || (), 431e0c4386eSCy Schubert (map { '-D'.$_ } 432e0c4386eSCy Schubert @{$target{dso_defines}}, 433e0c4386eSCy Schubert @{$target{module_defines}}, 434e0c4386eSCy Schubert @{$config{dso_defines} || ()}, 435e0c4386eSCy Schubert @{$config{module_defines} || ()}), 436e0c4386eSCy Schubert (map { '-I'.quotify1($_) } 437e0c4386eSCy Schubert @{$target{dso_includes}}, 438e0c4386eSCy Schubert @{$target{module_includes}}, 439e0c4386eSCy Schubert @{$config{dso_includes}}, 440e0c4386eSCy Schubert @{$config{module_includes}}), 441e0c4386eSCy Schubert @{$config{dso_cppflags}}, 442e0c4386eSCy Schubert @{$config{module_cppflags}}, 443e0c4386eSCy Schubert '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -} 444e0c4386eSCy SchubertDSO_CFLAGS={- join(' ', $target{dso_cflags} || (), 445e0c4386eSCy Schubert $target{module_cflags} || (), 446e0c4386eSCy Schubert @{$config{dso_cflags}}, 447e0c4386eSCy Schubert @{$config{module_cflags}}, 448e0c4386eSCy Schubert '$(CNF_CFLAGS)', '$(CFLAGS)') -} 449e0c4386eSCy SchubertDSO_CXXFLAGS={- join(' ', $target{dso_cxxflags} || (), 450e0c4386eSCy Schubert $target{module_cxxflags} || (), 451e0c4386eSCy Schubert @{$config{dso_cxxflags}}, 452e0c4386eSCy Schubert @{$config{module_cxxflag}}, 453e0c4386eSCy Schubert '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -} 454e0c4386eSCy SchubertDSO_LDFLAGS={- join(' ', $target{dso_ldflags} || (), 455e0c4386eSCy Schubert $target{module_ldflags} || (), 456e0c4386eSCy Schubert @{$config{dso_ldflags}}, 457e0c4386eSCy Schubert @{$config{module_ldflags}}, 458e0c4386eSCy Schubert '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} 459e0c4386eSCy SchubertDSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) 460e0c4386eSCy SchubertBIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (), 461e0c4386eSCy Schubert (map { '-D'.$_ } @{$config{bin_defines} || ()}), 462e0c4386eSCy Schubert @{$config{bin_cppflags}}, 463e0c4386eSCy Schubert '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -} 464e0c4386eSCy SchubertBIN_CFLAGS={- join(' ', $target{bin_cflags} || (), 465e0c4386eSCy Schubert @{$config{bin_cflags}}, 466e0c4386eSCy Schubert '$(CNF_CFLAGS)', '$(CFLAGS)') -} 467e0c4386eSCy SchubertBIN_CXXFLAGS={- join(' ', $target{bin_cxxflags} || (), 468e0c4386eSCy Schubert @{$config{bin_cxxflags}}, 469e0c4386eSCy Schubert '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -} 470e0c4386eSCy SchubertBIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), 471e0c4386eSCy Schubert @{$config{bin_lflags}}, 472e0c4386eSCy Schubert '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} 473e0c4386eSCy SchubertBIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) 474e0c4386eSCy Schubert 475e0c4386eSCy Schubert# CPPFLAGS_Q is used for one thing only: to build up buildinf.h 476e0c4386eSCy SchubertCPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g; 477e0c4386eSCy Schubert $cppflags2 =~ s|([\\"])|\\$1|g; 478e0c4386eSCy Schubert $lib_cppflags =~ s|([\\"])|\\$1|g; 479e0c4386eSCy Schubert join(' ', $lib_cppflags || (), $cppflags2 || (), 480e0c4386eSCy Schubert $cppflags1 || ()) -} 481e0c4386eSCy Schubert 482e0c4386eSCy SchubertPERLASM_SCHEME= {- $target{perlasm_scheme} -} 483e0c4386eSCy Schubert 484e0c4386eSCy Schubert# For x86 assembler: Set PROCESSOR to 386 if you want to support 485e0c4386eSCy Schubert# the 80386. 486e0c4386eSCy SchubertPROCESSOR= {- $config{processor} -} 487e0c4386eSCy Schubert 488e0c4386eSCy Schubert# We want error [and other] messages in English. Trouble is that make(1) 489e0c4386eSCy Schubert# doesn't pass macros down as environment variables unless there already 490e0c4386eSCy Schubert# was corresponding variable originally set. In other words we can only 491e0c4386eSCy Schubert# reassign environment variables, but not set new ones, not in portable 492e0c4386eSCy Schubert# manner that is. That's why we reassign several, just to be sure... 493e0c4386eSCy SchubertLC_ALL=C 494e0c4386eSCy SchubertLC_MESSAGES=C 495e0c4386eSCy SchubertLANG=C 496e0c4386eSCy Schubert 497e0c4386eSCy Schubert# The main targets ################################################### 498e0c4386eSCy Schubert 499e0c4386eSCy Schubert{- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils 500e0c4386eSCy Schubert{- dependmagic('build_libs'); -}: build_libs_nodep 501e0c4386eSCy Schubert{- dependmagic('build_modules'); -}: build_modules_nodep 502e0c4386eSCy Schubert{- dependmagic('build_programs'); -}: build_programs_nodep 503e0c4386eSCy Schubert 504e0c4386eSCy Schubertbuild_generated_pods: $(GENERATED_PODS) 505e0c4386eSCy Schubertbuild_docs: build_man_docs build_html_docs 506e0c4386eSCy Schubertbuild_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7) 507e0c4386eSCy Schubertbuild_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7) 508e0c4386eSCy Schubert 509e0c4386eSCy Schubertbuild_generated: $(GENERATED_MANDATORY) 510e0c4386eSCy Schubertbuild_libs_nodep: libcrypto.pc libssl.pc openssl.pc 511e0c4386eSCy Schubertbuild_modules_nodep: $(MODULES) 512e0c4386eSCy Schubertbuild_programs_nodep: $(PROGRAMS) $(SCRIPTS) 513e0c4386eSCy Schubert 514e0c4386eSCy Schubert# Kept around for backward compatibility 515e0c4386eSCy Schubertbuild_apps build_tests: build_programs 516e0c4386eSCy Schubert 517e0c4386eSCy Schubert# Convenience target to prebuild all generated files, not just the mandatory 518e0c4386eSCy Schubert# ones 519e0c4386eSCy Schubertbuild_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs 520e0c4386eSCy Schubert @ : {- output_off() if $disabled{makedepend}; "" -} 521e0c4386eSCy Schubert @echo "Warning: consider configuring with no-makedepend, because if" 522e0c4386eSCy Schubert @echo " target system doesn't have $(PERL)," 523e0c4386eSCy Schubert @echo " then make will fail..." 524e0c4386eSCy Schubert @ : {- output_on() if $disabled{makedepend}; "" -} 525e0c4386eSCy Schubert 526e0c4386eSCy Schubertall: build_sw build_docs 527e0c4386eSCy Schubert 528e0c4386eSCy Schuberttest: tests 529e0c4386eSCy Schubert{- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils 530*44096ebdSEnji Cooper "$(MAKE)" run_tests 531e0c4386eSCy Schubertrun_tests: FORCE 532e0c4386eSCy Schubert @ : {- output_off() if $disabled{tests}; "" -} 533e0c4386eSCy Schubert ( SRCTOP=$(SRCDIR) \ 534e0c4386eSCy Schubert BLDTOP=$(BLDDIR) \ 535e0c4386eSCy Schubert PERL="$(PERL)" \ 536e0c4386eSCy Schubert FIPSKEY="$(FIPSKEY)" \ 537e0c4386eSCy Schubert EXE_EXT={- platform->binext() -} \ 538e0c4386eSCy Schubert $(PERL) $(SRCDIR)/test/run_tests.pl $(TESTS) ) 539e0c4386eSCy Schubert @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -} 540e0c4386eSCy Schubert @echo "Tests are not supported with your chosen Configure options" 541e0c4386eSCy Schubert @ : {- output_on() if !$disabled{tests}; "" -} 542e0c4386eSCy Schubert 543e0c4386eSCy Schubertlist-tests: 544e0c4386eSCy Schubert @ : {- output_off() if $disabled{tests}; "" -} 545*44096ebdSEnji Cooper "$(MAKE)" run_tests TESTS=list 546e0c4386eSCy Schubert @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -} 547e0c4386eSCy Schubert @echo "Tests are not supported with your chosen Configure options" 548e0c4386eSCy Schubert @ : {- output_on() if !$disabled{tests}; "" -} 549e0c4386eSCy Schubert 550e0c4386eSCy Schubertinstall: install_sw install_ssldirs install_docs {- $disabled{fips} ? "" : "install_fips" -} 551e0c4386eSCy Schubert 552e0c4386eSCy Schubertuninstall: uninstall_docs uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips" -} 553e0c4386eSCy Schubert 554e0c4386eSCy Schubertlibclean: 555e0c4386eSCy Schubert @set -e; for s in $(SHLIB_INFO); do \ 556e0c4386eSCy Schubert if [ "$$s" = ";" ]; then continue; fi; \ 557e0c4386eSCy Schubert s1=`echo "$$s" | cut -f1 -d";"`; \ 558e0c4386eSCy Schubert s2=`echo "$$s" | cut -f2 -d";"`; \ 559e0c4386eSCy Schubert s3=`echo "$$s" | cut -f3 -d";"`; \ 560e0c4386eSCy Schubert $(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\ 561e0c4386eSCy Schubert $(RM) apps/$$s1; \ 562e0c4386eSCy Schubert $(RM) test/$$s1; \ 563e0c4386eSCy Schubert $(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\ 564e0c4386eSCy Schubert $(RM) $$s1; \ 565e0c4386eSCy Schubert if [ "$$s2" != "" ]; then \ 566e0c4386eSCy Schubert $(ECHO) $(RM) $$s2; \ 567e0c4386eSCy Schubert $(RM) $$s2; \ 568e0c4386eSCy Schubert fi; \ 569e0c4386eSCy Schubert if [ "$$s3" != "" ]; then \ 570e0c4386eSCy Schubert $(ECHO) $(RM) $$s3; \ 571e0c4386eSCy Schubert $(RM) $$s3; \ 572e0c4386eSCy Schubert fi; \ 573e0c4386eSCy Schubert done 574e0c4386eSCy Schubert $(RM) $(LIBS) 575e0c4386eSCy Schubert $(RM) *{- platform->defext() -} 576e0c4386eSCy Schubert 577e0c4386eSCy Schubertclean: libclean 578e0c4386eSCy Schubert $(RM) $(HTMLDOCS1) 579e0c4386eSCy Schubert $(RM) $(HTMLDOCS3) 580e0c4386eSCy Schubert $(RM) $(HTMLDOCS5) 581e0c4386eSCy Schubert $(RM) $(HTMLDOCS7) 582e0c4386eSCy Schubert $(RM) $(MANDOCS1) 583e0c4386eSCy Schubert $(RM) $(MANDOCS3) 584e0c4386eSCy Schubert $(RM) $(MANDOCS5) 585e0c4386eSCy Schubert $(RM) $(MANDOCS7) 586e0c4386eSCy Schubert $(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(FIPSMODULE) $(SCRIPTS) 587e0c4386eSCy Schubert $(RM) $(GENERATED_MANDATORY) $(GENERATED) 588e0c4386eSCy Schubert -find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -exec $(RM) {} \; 589e0c4386eSCy Schubert -find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -exec $(RM) {} \; 590e0c4386eSCy Schubert $(RM) core 591e0c4386eSCy Schubert $(RM) tags TAGS doc-nits md-nits 592e0c4386eSCy Schubert $(RM) -r test/test-runs 593e0c4386eSCy Schubert $(RM) providers/fips*.new 594e0c4386eSCy Schubert $(RM) openssl.pc libcrypto.pc libssl.pc 595e0c4386eSCy Schubert -find . -type l \! -name '.*' -exec $(RM) {} \; 596e0c4386eSCy Schubert 597e0c4386eSCy Schubertdistclean: clean 598e0c4386eSCy Schubert $(RM) include/openssl/configuration.h 599e0c4386eSCy Schubert $(RM) configdata.pm 600e0c4386eSCy Schubert $(RM) Makefile 601e0c4386eSCy Schubert 602e0c4386eSCy Schubert# We check if any depfile is newer than Makefile and decide to 603e0c4386eSCy Schubert# concatenate only if that is true. 604e0c4386eSCy Schubertdepend: Makefile 605e0c4386eSCy Schubert @: {- output_off() if $disabled{makedepend}; "" -} 606e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/add-depends.pl "{- $makedep_scheme -}" 607e0c4386eSCy Schubert @: {- output_on() if $disabled{makedepend}; "" -} 608e0c4386eSCy Schubert 609e0c4386eSCy Schubert# Install helper targets ############################################# 610e0c4386eSCy Schubert 611e0c4386eSCy Schubertinstall_sw: install_dev install_engines install_modules install_runtime 612e0c4386eSCy Schubert 613e0c4386eSCy Schubertuninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev 614e0c4386eSCy Schubert 615e0c4386eSCy Schubertinstall_docs: install_man_docs install_html_docs 616e0c4386eSCy Schubert 617e0c4386eSCy Schubertuninstall_docs: uninstall_man_docs uninstall_html_docs 618e0c4386eSCy Schubert $(RM) -r "$(DESTDIR)$(DOCDIR)" 619e0c4386eSCy Schubert 620e0c4386eSCy Schubert{- output_off() if $disabled{fips}; "" -} 621e0c4386eSCy Schubertinstall_fips: build_sw $(INSTALL_FIPSMODULECONF) 622e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 623e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)" 624e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)" 625e0c4386eSCy Schubert @$(ECHO) "*** Installing FIPS module" 626e0c4386eSCy Schubert @$(ECHO) "install $(INSTALL_FIPSMODULE) -> $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)" 627e0c4386eSCy Schubert @cp "$(INSTALL_FIPSMODULE)" "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" 628e0c4386eSCy Schubert @chmod 755 "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" 629e0c4386eSCy Schubert @mv -f "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).new" \ 630e0c4386eSCy Schubert "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)" 631e0c4386eSCy Schubert @$(ECHO) "*** Installing FIPS module configuration" 632e0c4386eSCy Schubert @$(ECHO) "install $(INSTALL_FIPSMODULECONF) -> $(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf" 633e0c4386eSCy Schubert @cp $(INSTALL_FIPSMODULECONF) "$(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf" 634e0c4386eSCy Schubert 635e0c4386eSCy Schubertuninstall_fips: 636e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling FIPS module configuration" 637e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(OPENSSLDIR)/fipsmodule.cnf" 638e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling FIPS module" 639e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME)" 640e0c4386eSCy Schubert{- if ($disabled{fips}) { output_on(); } else { output_off(); } "" -} 641e0c4386eSCy Schubertinstall_fips: 642e0c4386eSCy Schubert @$(ECHO) "The 'install_fips' target requires the 'enable-fips' option" 643e0c4386eSCy Schubert 644e0c4386eSCy Schubertuninstall_fips: 645e0c4386eSCy Schubert @$(ECHO) "The 'uninstall_fips' target requires the 'enable-fips' option" 646e0c4386eSCy Schubert{- output_on() if !$disabled{fips}; "" -} 647e0c4386eSCy Schubert 648e0c4386eSCy Schubert 649e0c4386eSCy Schubertinstall_ssldirs: 650e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)/certs" 651e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)/private" 652e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(OPENSSLDIR)/misc" 653e0c4386eSCy Schubert @set -e; for x in dummy $(MISC_SCRIPTS); do \ 654e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 655e0c4386eSCy Schubert x1=`echo "$$x" | cut -f1 -d:`; \ 656e0c4386eSCy Schubert x2=`echo "$$x" | cut -f2 -d:`; \ 657e0c4386eSCy Schubert fn=`basename $$x1`; \ 658e0c4386eSCy Schubert $(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \ 659e0c4386eSCy Schubert cp $$x1 "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \ 660e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new"; \ 661e0c4386eSCy Schubert mv -f "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new" \ 662e0c4386eSCy Schubert "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \ 663e0c4386eSCy Schubert if [ "$$x1" != "$$x2" ]; then \ 664e0c4386eSCy Schubert ln=`basename "$$x2"`; \ 665e0c4386eSCy Schubert : {- output_off() unless windowsdll(); "" -}; \ 666e0c4386eSCy Schubert $(ECHO) "copy $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \ 667e0c4386eSCy Schubert cp "$(DESTDIR)$(OPENSSLDIR)/misc/$$fn" "$(DESTDIR)$(OPENSSLDIR)/misc/$$ln"; \ 668e0c4386eSCy Schubert : {- output_on() unless windowsdll(); 669e0c4386eSCy Schubert output_off() if windowsdll(); "" -}; \ 670e0c4386eSCy Schubert $(ECHO) "link $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \ 671e0c4386eSCy Schubert ln -sf $$fn "$(DESTDIR)$(OPENSSLDIR)/misc/$$ln"; \ 672e0c4386eSCy Schubert : {- output_on() if windowsdll(); "" -}; \ 673e0c4386eSCy Schubert fi; \ 674e0c4386eSCy Schubert done 675e0c4386eSCy Schubert @$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist" 676e0c4386eSCy Schubert @cp $(SRCDIR)/apps/openssl.cnf "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" 677e0c4386eSCy Schubert @chmod 644 "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" 678e0c4386eSCy Schubert @mv -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new" "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist" 679e0c4386eSCy Schubert @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \ 680e0c4386eSCy Schubert $(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \ 681e0c4386eSCy Schubert cp $(SRCDIR)/apps/openssl.cnf "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \ 682e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \ 683e0c4386eSCy Schubert fi 684e0c4386eSCy Schubert @$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist" 685e0c4386eSCy Schubert @cp $(SRCDIR)/apps/ct_log_list.cnf "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new" 686e0c4386eSCy Schubert @chmod 644 "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new" 687e0c4386eSCy Schubert @mv -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new" "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist" 688e0c4386eSCy Schubert @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \ 689e0c4386eSCy Schubert $(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \ 690e0c4386eSCy Schubert cp $(SRCDIR)/apps/ct_log_list.cnf "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \ 691e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \ 692e0c4386eSCy Schubert fi 693e0c4386eSCy Schubert 694e0c4386eSCy Schubertinstall_dev: install_runtime_libs 695e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 696e0c4386eSCy Schubert @$(ECHO) "*** Installing development files" 697e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(INSTALLTOP)/include/openssl" 698e0c4386eSCy Schubert @ : {- output_off() if $disabled{uplink}; "" -} 699e0c4386eSCy Schubert @$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c" 700e0c4386eSCy Schubert @cp $(SRCDIR)/ms/applink.c "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c" 701e0c4386eSCy Schubert @chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c" 702e0c4386eSCy Schubert @ : {- output_on() if $disabled{uplink}; "" -} 703e0c4386eSCy Schubert @set -e; for i in $(SRCDIR)/include/openssl/*.h \ 704e0c4386eSCy Schubert $(BLDDIR)/include/openssl/*.h; do \ 705e0c4386eSCy Schubert fn=`basename $$i`; \ 706e0c4386eSCy Schubert $(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ 707e0c4386eSCy Schubert cp $$i "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ 708e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ 709e0c4386eSCy Schubert done 710e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)" 711e0c4386eSCy Schubert @set -e; for l in $(INSTALL_LIBS); do \ 712e0c4386eSCy Schubert fn=`basename $$l`; \ 713e0c4386eSCy Schubert $(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \ 714e0c4386eSCy Schubert cp $$l "$(DESTDIR)$(libdir)/$$fn.new"; \ 715e0c4386eSCy Schubert $(RANLIB) "$(DESTDIR)$(libdir)/$$fn.new"; \ 716e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(libdir)/$$fn.new"; \ 717e0c4386eSCy Schubert mv -f "$(DESTDIR)$(libdir)/$$fn.new" \ 718e0c4386eSCy Schubert "$(DESTDIR)$(libdir)/$$fn"; \ 719e0c4386eSCy Schubert done 720e0c4386eSCy Schubert @ : {- output_off() if $disabled{shared}; "" -} 721e0c4386eSCy Schubert @set -e; for s in $(INSTALL_SHLIB_INFO); do \ 722e0c4386eSCy Schubert s1=`echo "$$s" | cut -f1 -d";"`; \ 723e0c4386eSCy Schubert s2=`echo "$$s" | cut -f2 -d";"`; \ 724e0c4386eSCy Schubert s3=`echo "$$s" | cut -f3 -d";"`; \ 725e0c4386eSCy Schubert fn1=`basename "$$s1"`; \ 726e0c4386eSCy Schubert fn2=`basename "$$s2"`; \ 727e0c4386eSCy Schubert fn3=`basename "$$s3"`; \ 728e0c4386eSCy Schubert : {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \ 729e0c4386eSCy Schubert if [ "$$fn2" != "" ]; then \ 730e0c4386eSCy Schubert $(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \ 731e0c4386eSCy Schubert ln -sf $$fn1 "$(DESTDIR)$(libdir)/$$fn2"; \ 732e0c4386eSCy Schubert fi; \ 733e0c4386eSCy Schubert : {- output_off() unless windowsdll() or sharedaix(); output_on() if windowsdll(); "" -}; \ 734e0c4386eSCy Schubert if [ "$$fn3" != "" ]; then \ 735e0c4386eSCy Schubert $(ECHO) "install $$s3 -> $(DESTDIR)$(libdir)/$$fn3"; \ 736e0c4386eSCy Schubert cp $$s3 "$(DESTDIR)$(libdir)/$$fn3.new"; \ 737e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(libdir)/$$fn3.new"; \ 738e0c4386eSCy Schubert mv -f "$(DESTDIR)$(libdir)/$$fn3.new" \ 739e0c4386eSCy Schubert "$(DESTDIR)$(libdir)/$$fn3"; \ 740e0c4386eSCy Schubert fi; \ 741e0c4386eSCy Schubert : {- output_off() if windowsdll(); output_on() if sharedaix(); "" -}; \ 742e0c4386eSCy Schubert a="$(DESTDIR)$(libdir)/$$fn2"; \ 743e0c4386eSCy Schubert $(ECHO) "install $$s1 -> $$a"; \ 744e0c4386eSCy Schubert if [ -f $$a ]; then ( trap "rm -rf /tmp/ar.$$$$" INT 0; \ 745e0c4386eSCy Schubert mkdir /tmp/ar.$$$$; ( cd /tmp/ar.$$$$; \ 746e0c4386eSCy Schubert cp -f $$a $$a.new; \ 747e0c4386eSCy Schubert for so in `$(AR) t $$a`; do \ 748e0c4386eSCy Schubert $(AR) x $$a $$so; \ 749e0c4386eSCy Schubert chmod u+w $$so; \ 750e0c4386eSCy Schubert strip -X32_64 -e $$so; \ 751e0c4386eSCy Schubert $(AR) r $$a.new $$so; \ 752e0c4386eSCy Schubert done; \ 753e0c4386eSCy Schubert )); fi; \ 754e0c4386eSCy Schubert $(AR) r $$a.new $$s1; \ 755e0c4386eSCy Schubert mv -f $$a.new $$a; \ 756e0c4386eSCy Schubert : {- output_off() if sharedaix(); output_on(); "" -}; \ 757e0c4386eSCy Schubert done 758e0c4386eSCy Schubert @ : {- output_on() if $disabled{shared}; "" -} 759e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)/pkgconfig" 760e0c4386eSCy Schubert @$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc" 761e0c4386eSCy Schubert @cp libcrypto.pc "$(DESTDIR)$(libdir)/pkgconfig" 762e0c4386eSCy Schubert @chmod 644 "$(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc" 763e0c4386eSCy Schubert @$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc" 764e0c4386eSCy Schubert @cp libssl.pc "$(DESTDIR)$(libdir)/pkgconfig" 765e0c4386eSCy Schubert @chmod 644 "$(DESTDIR)$(libdir)/pkgconfig/libssl.pc" 766e0c4386eSCy Schubert @$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc" 767e0c4386eSCy Schubert @cp openssl.pc "$(DESTDIR)$(libdir)/pkgconfig" 768e0c4386eSCy Schubert @chmod 644 "$(DESTDIR)$(libdir)/pkgconfig/openssl.pc" 769e0c4386eSCy Schubert 770e0c4386eSCy Schubertuninstall_dev: uninstall_runtime_libs 771e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling development files" 772e0c4386eSCy Schubert @ : {- output_off() if $disabled{uplink}; "" -} 773e0c4386eSCy Schubert @$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c" 774e0c4386eSCy Schubert @$(RM) "$(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c" 775e0c4386eSCy Schubert @ : {- output_on() if $disabled{uplink}; "" -} 776e0c4386eSCy Schubert @set -e; for i in $(SRCDIR)/include/openssl/*.h \ 777e0c4386eSCy Schubert $(BLDDIR)/include/openssl/*.h; do \ 778e0c4386eSCy Schubert fn=`basename $$i`; \ 779e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ 780e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \ 781e0c4386eSCy Schubert done 782e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(INSTALLTOP)/include/openssl" 783e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(INSTALLTOP)/include" 784e0c4386eSCy Schubert @set -e; for l in $(INSTALL_LIBS); do \ 785e0c4386eSCy Schubert fn=`basename $$l`; \ 786e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \ 787e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/$$fn"; \ 788e0c4386eSCy Schubert done 789e0c4386eSCy Schubert @ : {- output_off() if $disabled{shared}; "" -} 790e0c4386eSCy Schubert @set -e; for s in $(INSTALL_SHLIB_INFO); do \ 791e0c4386eSCy Schubert s1=`echo "$$s" | cut -f1 -d";"`; \ 792e0c4386eSCy Schubert s2=`echo "$$s" | cut -f2 -d";"`; \ 793e0c4386eSCy Schubert s3=`echo "$$s" | cut -f3 -d";"`; \ 794e0c4386eSCy Schubert fn1=`basename "$$s1"`; \ 795e0c4386eSCy Schubert fn2=`basename "$$s2"`; \ 796e0c4386eSCy Schubert fn3=`basename "$$s3"`; \ 797e0c4386eSCy Schubert : {- output_off() if windowsdll(); "" -}; \ 798e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \ 799e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/$$fn1"; \ 800e0c4386eSCy Schubert if [ -n "$$fn2" ]; then \ 801e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \ 802e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/$$fn2"; \ 803e0c4386eSCy Schubert fi; \ 804e0c4386eSCy Schubert : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \ 805e0c4386eSCy Schubert if [ -n "$$fn3" ]; then \ 806e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn3"; \ 807e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/$$fn3"; \ 808e0c4386eSCy Schubert fi; \ 809e0c4386eSCy Schubert : {- output_on() unless windowsdll(); "" -}; \ 810e0c4386eSCy Schubert done 811e0c4386eSCy Schubert @ : {- output_on() if $disabled{shared}; "" -} 812e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc" 813e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/pkgconfig/libssl.pc" 814e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(libdir)/pkgconfig/openssl.pc" 815e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(libdir)/pkgconfig" 816e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(libdir)" 817e0c4386eSCy Schubert 818e0c4386eSCy Schubert_install_modules_deps: install_runtime_libs build_modules 819e0c4386eSCy Schubert 820e0c4386eSCy Schubertinstall_engines: _install_modules_deps 821e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 822e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(ENGINESDIR)/" 823e0c4386eSCy Schubert @$(ECHO) "*** Installing engines" 824e0c4386eSCy Schubert @set -e; for e in dummy $(INSTALL_ENGINES); do \ 825e0c4386eSCy Schubert if [ "$$e" = "dummy" ]; then continue; fi; \ 826e0c4386eSCy Schubert fn=`basename $$e`; \ 827e0c4386eSCy Schubert $(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \ 828e0c4386eSCy Schubert cp $$e "$(DESTDIR)$(ENGINESDIR)/$$fn.new"; \ 829e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(ENGINESDIR)/$$fn.new"; \ 830e0c4386eSCy Schubert mv -f "$(DESTDIR)$(ENGINESDIR)/$$fn.new" \ 831e0c4386eSCy Schubert "$(DESTDIR)$(ENGINESDIR)/$$fn"; \ 832e0c4386eSCy Schubert done 833e0c4386eSCy Schubert 834e0c4386eSCy Schubertuninstall_engines: 835e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling engines" 836e0c4386eSCy Schubert @set -e; for e in dummy $(INSTALL_ENGINES); do \ 837e0c4386eSCy Schubert if [ "$$e" = "dummy" ]; then continue; fi; \ 838e0c4386eSCy Schubert fn=`basename $$e`; \ 839e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \ 840e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(ENGINESDIR)/$$fn"; \ 841e0c4386eSCy Schubert done 842e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(ENGINESDIR)" 843e0c4386eSCy Schubert 844e0c4386eSCy Schubertinstall_modules: _install_modules_deps 845e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 846e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MODULESDIR)/" 847e0c4386eSCy Schubert @$(ECHO) "*** Installing modules" 848e0c4386eSCy Schubert @set -e; for e in dummy $(INSTALL_MODULES); do \ 849e0c4386eSCy Schubert if [ "$$e" = "dummy" ]; then continue; fi; \ 850e0c4386eSCy Schubert fn=`basename $$e`; \ 851e0c4386eSCy Schubert $(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \ 852e0c4386eSCy Schubert cp $$e "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \ 853e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(MODULESDIR)/$$fn.new"; \ 854e0c4386eSCy Schubert mv -f "$(DESTDIR)$(MODULESDIR)/$$fn.new" \ 855e0c4386eSCy Schubert "$(DESTDIR)$(MODULESDIR)/$$fn"; \ 856e0c4386eSCy Schubert done 857e0c4386eSCy Schubert 858e0c4386eSCy Schubertuninstall_modules: 859e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling modules" 860e0c4386eSCy Schubert @set -e; for e in dummy $(INSTALL_MODULES); do \ 861e0c4386eSCy Schubert if [ "$$e" = "dummy" ]; then continue; fi; \ 862e0c4386eSCy Schubert fn=`basename $$e`; \ 863e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \ 864e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(MODULESDIR)/$$fn"; \ 865e0c4386eSCy Schubert done 866e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(MODULESDIR)" 867e0c4386eSCy Schubert 868e0c4386eSCy Schubertinstall_runtime: install_programs 869e0c4386eSCy Schubert 870e0c4386eSCy Schubertinstall_runtime_libs: build_libs 871e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 872e0c4386eSCy Schubert @ : {- output_off() if windowsdll(); "" -} 873e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(libdir)" 874e0c4386eSCy Schubert @ : {- output_on() if windowsdll(); output_off() unless windowsdll(); "" -} 875e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(INSTALLTOP)/bin" 876e0c4386eSCy Schubert @ : {- output_on() unless windowsdll(); "" -} 877e0c4386eSCy Schubert @$(ECHO) "*** Installing runtime libraries" 878e0c4386eSCy Schubert @set -e; for s in dummy $(INSTALL_SHLIBS); do \ 879e0c4386eSCy Schubert if [ "$$s" = "dummy" ]; then continue; fi; \ 880e0c4386eSCy Schubert fn=`basename $$s`; \ 881e0c4386eSCy Schubert : {- output_off() unless windowsdll(); "" -}; \ 882e0c4386eSCy Schubert $(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 883e0c4386eSCy Schubert cp $$s "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new"; \ 884e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new"; \ 885e0c4386eSCy Schubert mv -f "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new" \ 886e0c4386eSCy Schubert "$(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 887e0c4386eSCy Schubert : {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \ 888e0c4386eSCy Schubert $(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \ 889e0c4386eSCy Schubert cp $$s "$(DESTDIR)$(libdir)/$$fn.new"; \ 890e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(libdir)/$$fn.new"; \ 891e0c4386eSCy Schubert mv -f "$(DESTDIR)$(libdir)/$$fn.new" \ 892e0c4386eSCy Schubert "$(DESTDIR)$(libdir)/$$fn"; \ 893e0c4386eSCy Schubert : {- output_on() if windowsdll(); "" -}; \ 894e0c4386eSCy Schubert done 895e0c4386eSCy Schubert 896e0c4386eSCy Schubertinstall_programs: install_runtime_libs build_programs 897e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 898e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(INSTALLTOP)/bin" 899e0c4386eSCy Schubert @$(ECHO) "*** Installing runtime programs" 900e0c4386eSCy Schubert @set -e; for x in dummy $(INSTALL_PROGRAMS); do \ 901e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 902e0c4386eSCy Schubert fn=`basename $$x`; \ 903e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 904e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new"; \ 905e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new"; \ 906e0c4386eSCy Schubert mv -f "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new" \ 907e0c4386eSCy Schubert "$(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 908e0c4386eSCy Schubert done 909e0c4386eSCy Schubert @set -e; for x in dummy $(BIN_SCRIPTS); do \ 910e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 911e0c4386eSCy Schubert fn=`basename $$x`; \ 912e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 913e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new"; \ 914e0c4386eSCy Schubert chmod 755 "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new"; \ 915e0c4386eSCy Schubert mv -f "$(DESTDIR)$(INSTALLTOP)/bin/$$fn.new" \ 916e0c4386eSCy Schubert "$(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 917e0c4386eSCy Schubert done 918e0c4386eSCy Schubert 919e0c4386eSCy Schubertuninstall_runtime: uninstall_programs uninstall_runtime_libs 920e0c4386eSCy Schubert 921e0c4386eSCy Schubertuninstall_programs: 922e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling runtime programs" 923e0c4386eSCy Schubert @set -e; for x in dummy $(INSTALL_PROGRAMS); \ 924e0c4386eSCy Schubert do \ 925e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 926e0c4386eSCy Schubert fn=`basename $$x`; \ 927e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 928e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 929e0c4386eSCy Schubert done; 930e0c4386eSCy Schubert @set -e; for x in dummy $(BIN_SCRIPTS); \ 931e0c4386eSCy Schubert do \ 932e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 933e0c4386eSCy Schubert fn=`basename $$x`; \ 934e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 935e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 936e0c4386eSCy Schubert done 937e0c4386eSCy Schubert -$(RMDIR) "$(DESTDIR)$(INSTALLTOP)/bin" 938e0c4386eSCy Schubert 939e0c4386eSCy Schubertuninstall_runtime_libs: 940e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling runtime libraries" 941e0c4386eSCy Schubert @ : {- output_off() unless windowsdll(); "" -} 942e0c4386eSCy Schubert @set -e; for s in dummy $(INSTALL_SHLIBS); do \ 943e0c4386eSCy Schubert if [ "$$s" = "dummy" ]; then continue; fi; \ 944e0c4386eSCy Schubert fn=`basename $$s`; \ 945e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 946e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ 947e0c4386eSCy Schubert done 948e0c4386eSCy Schubert @ : {- output_on() unless windowsdll(); "" -} 949e0c4386eSCy Schubert 950e0c4386eSCy Schubert 951e0c4386eSCy Schubertinstall_man_docs: build_man_docs 952e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 953e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man1" 954e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man3" 955e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man5" 956e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(MANDIR)/man7" 957e0c4386eSCy Schubert @$(ECHO) "*** Installing manpages" 958e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS1); do \ 959e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 960e0c4386eSCy Schubert fn=`basename $$x`; \ 961e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ 962e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ 963e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ 964e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man1"; \ 965e0c4386eSCy Schubert done 966e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS3); do \ 967e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 968e0c4386eSCy Schubert fn=`basename $$x`; \ 969e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \ 970e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \ 971e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \ 972e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man3"; \ 973e0c4386eSCy Schubert done 974e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS5); do \ 975e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 976e0c4386eSCy Schubert fn=`basename $$x`; \ 977e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \ 978e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \ 979e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \ 980e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man5"; \ 981e0c4386eSCy Schubert done 982e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS7); do \ 983e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 984e0c4386eSCy Schubert fn=`basename $$x`; \ 985e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ 986e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ 987e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ 988e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks install $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man7"; \ 989e0c4386eSCy Schubert done 990e0c4386eSCy Schubert 991e0c4386eSCy Schubertuninstall_man_docs: build_man_docs 992e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling manpages" 993e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS1); do \ 994e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 995e0c4386eSCy Schubert fn=`basename $$x`; \ 996e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ 997e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \ 998e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man1 $(BLDDIR)/doc/man1 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man1"; \ 999e0c4386eSCy Schubert done 1000e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS3); do \ 1001e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1002e0c4386eSCy Schubert fn=`basename $$x`; \ 1003e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \ 1004e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \ 1005e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man3 $(BLDDIR)/doc/man3 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man3"; \ 1006e0c4386eSCy Schubert done 1007e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS5); do \ 1008e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1009e0c4386eSCy Schubert fn=`basename $$x`; \ 1010e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \ 1011e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \ 1012e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man5 $(BLDDIR)/doc/man5 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man5"; \ 1013e0c4386eSCy Schubert done 1014e0c4386eSCy Schubert @set -e; for x in dummy $(MANDOCS7); do \ 1015e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1016e0c4386eSCy Schubert fn=`basename $$x`; \ 1017e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ 1018e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \ 1019e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/write-man-symlinks uninstall $(SRCDIR)/doc/man7 $(BLDDIR)/doc/man7 $${fn}$(MANSUFFIX) "$(DESTDIR)$(MANDIR)/man7"; \ 1020e0c4386eSCy Schubert done 1021e0c4386eSCy Schubert 1022e0c4386eSCy Schubertinstall_html_docs: install_image_docs build_html_docs 1023e0c4386eSCy Schubert @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1) 1024e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man1" 1025e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man3" 1026e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man5" 1027e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man7" 1028e0c4386eSCy Schubert @$(ECHO) "*** Installing HTML manpages" 1029e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS1); do \ 1030e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1031e0c4386eSCy Schubert fn=`basename $$x`; \ 1032e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \ 1033e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \ 1034e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \ 1035e0c4386eSCy Schubert done 1036e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS3); do \ 1037e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1038e0c4386eSCy Schubert fn=`basename $$x`; \ 1039e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \ 1040e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \ 1041e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \ 1042e0c4386eSCy Schubert done 1043e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS5); do \ 1044e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1045e0c4386eSCy Schubert fn=`basename $$x`; \ 1046e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \ 1047e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \ 1048e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \ 1049e0c4386eSCy Schubert done 1050e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS7); do \ 1051e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1052e0c4386eSCy Schubert fn=`basename $$x`; \ 1053e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \ 1054e0c4386eSCy Schubert cp $$x "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \ 1055e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \ 1056e0c4386eSCy Schubert done 1057e0c4386eSCy Schubert 1058e0c4386eSCy Schubertuninstall_html_docs: uninstall_image_docs 1059e0c4386eSCy Schubert @$(ECHO) "*** Uninstalling HTML manpages" 1060e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS1); do \ 1061e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1062e0c4386eSCy Schubert fn=`basename $$x`; \ 1063e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \ 1064e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(HTMLDIR)/man1/$$fn"; \ 1065e0c4386eSCy Schubert done 1066e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS3); do \ 1067e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1068e0c4386eSCy Schubert fn=`basename $$x`; \ 1069e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \ 1070e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(HTMLDIR)/man3/$$fn"; \ 1071e0c4386eSCy Schubert done 1072e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS5); do \ 1073e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1074e0c4386eSCy Schubert fn=`basename $$x`; \ 1075e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \ 1076e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(HTMLDIR)/man5/$$fn"; \ 1077e0c4386eSCy Schubert done 1078e0c4386eSCy Schubert @set -e; for x in dummy $(HTMLDOCS7); do \ 1079e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1080e0c4386eSCy Schubert fn=`basename $$x`; \ 1081e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \ 1082e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(HTMLDIR)/man7/$$fn"; \ 1083e0c4386eSCy Schubert done 1084e0c4386eSCy Schubert 1085e0c4386eSCy Schubertinstall_image_docs: 1086e0c4386eSCy Schubert @$(PERL) $(SRCDIR)/util/mkdir-p.pl "$(DESTDIR)$(HTMLDIR)/man7/img" 1087e0c4386eSCy Schubert @set -e; for x in dummy $(IMAGEDOCS7); do \ 1088e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1089e0c4386eSCy Schubert fn=`basename $$x`; \ 1090e0c4386eSCy Schubert $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \ 1091e0c4386eSCy Schubert cp $(SRCDIR)/$$x "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \ 1092e0c4386eSCy Schubert chmod 644 "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \ 1093e0c4386eSCy Schubert done 1094e0c4386eSCy Schubert 1095e0c4386eSCy Schubertuninstall_image_docs: 1096e0c4386eSCy Schubert @set -e; for x in dummy $(IMAGEDOCS7); do \ 1097e0c4386eSCy Schubert if [ "$$x" = "dummy" ]; then continue; fi; \ 1098e0c4386eSCy Schubert fn=`basename $$x`; \ 1099e0c4386eSCy Schubert $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \ 1100e0c4386eSCy Schubert $(RM) "$(DESTDIR)$(HTMLDIR)/man7/img/$$fn"; \ 1101e0c4386eSCy Schubert done 1102e0c4386eSCy Schubert 1103e0c4386eSCy Schubert# Developer targets (note: these are only available on Unix) ######### 1104e0c4386eSCy Schubert 1105e0c4386eSCy Schubert# It's important that generate_buildinfo comes after ordinals, as ordinals 1106e0c4386eSCy Schubert# is sensitive to build.info changes. 1107e0c4386eSCy Schubertupdate: generate errors ordinals generate_buildinfo 1108e0c4386eSCy Schubert 1109e0c4386eSCy Schubertgenerate: generate_apps generate_crypto_bn generate_crypto_objects \ 1110e0c4386eSCy Schubert generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids 1111e0c4386eSCy Schubert 1112e0c4386eSCy Schubertgenerate_buildinfo: generate_doc_buildinfo 1113e0c4386eSCy Schubert 1114e0c4386eSCy Schubert.PHONY: doc-nits md-nits 1115e0c4386eSCy Schubertdoc-nits: build_generated_pods 1116e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/find-doc-nits -c -n -l -e 1117e0c4386eSCy Schubert 1118e0c4386eSCy Schubert# This uses "mdl", the markdownlint application, which is written in ruby. 1119e0c4386eSCy Schubert# The source is at https://github.com/markdownlint/markdownlint 1120e0c4386eSCy Schubert# If you have ruby installed, "gem install mdl" should work. 1121e0c4386eSCy Schubert# Another option is at https://snapcraft.io/install/mdl/debian 1122e0c4386eSCy Schubert# Finally, there's a Node.js version, which we haven't tried, that 1123e0c4386eSCy Schubert# can be found at https://github.com/DavidAnson/markdownlint 1124e0c4386eSCy Schubertmd-nits: 1125e0c4386eSCy Schubert mdl -s util/markdownlint.rb . 1126e0c4386eSCy Schubert 1127e0c4386eSCy Schubert# Test coverage is a good idea for the future 1128e0c4386eSCy Schubert#coverage: $(PROGRAMS) $(TESTPROGRAMS) 1129e0c4386eSCy Schubert# ... 1130e0c4386eSCy Schubert 1131e0c4386eSCy Schubertlint: 1132e0c4386eSCy Schubert lint -DLINT $(INCLUDES) $(SRCS) 1133e0c4386eSCy Schubert 1134e0c4386eSCy Schubertgenerate_apps: 1135e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \ 1136e0c4386eSCy Schubert < apps/openssl.cnf > apps/openssl-vms.cnf ) 1137e0c4386eSCy Schubert 1138e0c4386eSCy Schubertgenerate_crypto_bn: 1139e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h ) 1140e0c4386eSCy Schubert 1141e0c4386eSCy Schubertgenerate_crypto_objects: 1142e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \ 1143e0c4386eSCy Schubert crypto/objects/objects.txt \ 1144e0c4386eSCy Schubert crypto/objects/obj_mac.num \ 1145e0c4386eSCy Schubert > crypto/objects/obj_mac.new && \ 1146e0c4386eSCy Schubert mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num ) 1147e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \ 1148e0c4386eSCy Schubert crypto/objects/objects.txt \ 1149e0c4386eSCy Schubert crypto/objects/obj_mac.num \ 1150e0c4386eSCy Schubert > include/openssl/obj_mac.h ) 1151e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \ 1152e0c4386eSCy Schubert include/openssl/obj_mac.h \ 1153e0c4386eSCy Schubert > crypto/objects/obj_dat.h ) 1154e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \ 1155e0c4386eSCy Schubert crypto/objects/obj_mac.num \ 1156e0c4386eSCy Schubert crypto/objects/obj_xref.txt \ 1157e0c4386eSCy Schubert > crypto/objects/obj_xref.h ) 1158e0c4386eSCy Schubert ( cd $(SRCDIR); sed -e '1,8d' crypto/objects/obj_compat.h >> include/openssl/obj_mac.h ) 1159e0c4386eSCy Schubert 1160e0c4386eSCy Schubertgenerate_crypto_conf: 1161e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \ 1162e0c4386eSCy Schubert > crypto/conf/conf_def.h ) 1163e0c4386eSCy Schubert 1164e0c4386eSCy Schubertgenerate_crypto_asn1: 1165e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \ 1166e0c4386eSCy Schubert > crypto/asn1/charmap.h ) 1167e0c4386eSCy Schubert 1168e0c4386eSCy Schubertgenerate_fuzz_oids: 1169e0c4386eSCy Schubert ( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \ 1170e0c4386eSCy Schubert crypto/objects/obj_dat.h \ 1171e0c4386eSCy Schubert > fuzz/oids.txt ) 1172e0c4386eSCy Schubert 1173e0c4386eSCy Schubertgenerate_doc_buildinfo: 1174e0c4386eSCy Schubert ( $(PERL) -I$(BLDDIR) -Mconfigdata \ 1175e0c4386eSCy Schubert $(SRCDIR)/util/dofile.pl -o Makefile \ 1176e0c4386eSCy Schubert $(SRCDIR)/doc/build.info.in \ 1177e0c4386eSCy Schubert > $(SRCDIR)/doc/build.info.new; \ 1178e0c4386eSCy Schubert if ( test -e $(SRCDIR)/doc/build.info \ 1179e0c4386eSCy Schubert && cmp $(SRCDIR)/doc/build.info.new $(SRCDIR)/doc/build.info \ 1180e0c4386eSCy Schubert > /dev/null ); \ 1181e0c4386eSCy Schubert then \ 1182e0c4386eSCy Schubert rm $(SRCDIR)/doc/build.info.new; \ 1183e0c4386eSCy Schubert else \ 1184e0c4386eSCy Schubert mv $(SRCDIR)/doc/build.info.new $(SRCDIR)/doc/build.info; \ 1185e0c4386eSCy Schubert fi ) 1186e0c4386eSCy Schubert 1187e0c4386eSCy Schubertgenerate_fips_sources: providers/fips.module.sources.new 1188e0c4386eSCy Schubertproviders/fips.module.sources.new: configdata.pm 1189e0c4386eSCy Schubert rm -rf sources-tmp 1190e0c4386eSCy Schubert mkdir sources-tmp 1191e0c4386eSCy Schubert ( \ 1192e0c4386eSCy Schubert srcdir=`cd $(SRCDIR); pwd`; \ 1193e0c4386eSCy Schubert cd sources-tmp \ 1194e0c4386eSCy Schubert && $$srcdir/Configure --banner=Configured enable-fips -O0 \ 1195e0c4386eSCy Schubert && ./configdata.pm --query 'get_sources("providers/fips")' > sources1 \ 1196*44096ebdSEnji Cooper && "$(MAKE)" -sj 4 build_generated providers/fips.so \ 1197e0c4386eSCy Schubert && find . -name '*.d' | xargs cat > dep1 \ 1198*44096ebdSEnji Cooper && "$(MAKE)" distclean \ 1199e0c4386eSCy Schubert && $$srcdir/Configure --banner=Configured enable-fips no-asm -O0 \ 1200e0c4386eSCy Schubert && ./configdata.pm --query 'get_sources("providers/fips")' > sources2 \ 1201*44096ebdSEnji Cooper && "$(MAKE)" -sj 4 build_generated providers/fips.so \ 1202e0c4386eSCy Schubert && find . -name '*.d' | xargs cat > dep2 \ 1203e0c4386eSCy Schubert && cat sources1 sources2 \ 1204e0c4386eSCy Schubert | grep -v ' : \\$$' | grep -v util/providers.num \ 1205e0c4386eSCy Schubert | sed -e 's/^ *//' -e 's/ *\\$$//' \ 1206e0c4386eSCy Schubert | sort | uniq > sources \ 1207e0c4386eSCy Schubert && cat dep1 dep2 \ 1208e0c4386eSCy Schubert | $(PERL) -p -e 's/\\\n//' \ 1209e0c4386eSCy Schubert | sed -e 's/^.*: *//' -e 's/ */ /g' \ 1210e0c4386eSCy Schubert | fgrep -f sources \ 1211e0c4386eSCy Schubert | tr ' ' '\n' \ 1212e0c4386eSCy Schubert | sort | uniq > deps.raw \ 1213e0c4386eSCy Schubert && cat deps.raw \ 1214e0c4386eSCy Schubert | xargs ./configdata.pm --query 'get_sources(@ARGV)' \ 1215e0c4386eSCy Schubert | $(PERL) -p -e 's/\\\n//' \ 1216e0c4386eSCy Schubert | sed -e 's/\./\\\./g' -e 's/ : */:/' -e 's/^/s:/' -e 's/$$/:/' \ 1217e0c4386eSCy Schubert > deps.sed \ 1218e0c4386eSCy Schubert && cat deps.raw | sed -f deps.sed > deps \ 1219e0c4386eSCy Schubert ) 1220e0c4386eSCy Schubert ( \ 1221e0c4386eSCy Schubert cat sources-tmp/sources sources-tmp/deps \ 1222e0c4386eSCy Schubert | $(PERL) -p -e 's:^ *\Q../\E:: ;' \ 1223e0c4386eSCy Schubert -e 's:^\Q$(SRCDIR)/\E:: if "$(SRCDIR)" ne "." ;' \ 1224e0c4386eSCy Schubert -e 'my $$x; do { $$x = $$_; s:(^|/)((?!\Q../\E)[^/]*/)\Q..\E($$|/):$$1: } while ($$x ne $$_) ;' ; \ 1225e0c4386eSCy Schubert cd $(SRCDIR); \ 1226e0c4386eSCy Schubert for x in crypto/bn/asm/*.pl crypto/bn/asm/*.S \ 1227e0c4386eSCy Schubert crypto/aes/asm/*.pl crypto/aes/asm/*.S \ 1228e0c4386eSCy Schubert crypto/ec/asm/*.pl \ 1229e0c4386eSCy Schubert crypto/modes/asm/*.pl \ 1230e0c4386eSCy Schubert crypto/sha/asm/*.pl \ 1231e0c4386eSCy Schubert crypto/*cpuid.pl crypto/*cpuid.S \ 1232e0c4386eSCy Schubert crypto/*cap.c; do \ 1233e0c4386eSCy Schubert echo "$$x"; \ 1234e0c4386eSCy Schubert done \ 1235e0c4386eSCy Schubert ) | sort | uniq > providers/fips.module.sources.new 1236e0c4386eSCy Schubert rm -rf sources-tmp 1237e0c4386eSCy Schubert 1238e0c4386eSCy Schubert# Set to -force to force a rebuild 1239e0c4386eSCy SchubertERROR_REBUILD= 1240e0c4386eSCy Schuberterrors: 1241e0c4386eSCy Schubert ( b=`pwd`; set -e; cd $(SRCDIR); \ 1242e0c4386eSCy Schubert $(PERL) util/ck_errf.pl -strict -internal; \ 1243e0c4386eSCy Schubert $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal ) 1244e0c4386eSCy Schubert ( b=`pwd`; set -e; cd $(SRCDIR)/engines; \ 1245e0c4386eSCy Schubert for E in *.ec ; do \ 1246e0c4386eSCy Schubert $(PERL) ../util/ck_errf.pl -strict \ 1247e0c4386eSCy Schubert -conf $$E `basename $$E .ec`.c; \ 1248e0c4386eSCy Schubert $(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \ 1249e0c4386eSCy Schubert -conf $$E `basename $$E .ec`.c ; \ 1250e0c4386eSCy Schubert done ) 1251e0c4386eSCy Schubert 1252e0c4386eSCy Schubert{- use File::Basename; 1253e0c4386eSCy Schubert 1254e0c4386eSCy Schubert my @sslheaders_tmpl = 1255e0c4386eSCy Schubert qw( include/openssl/ssl.h 1256e0c4386eSCy Schubert include/openssl/ssl2.h 1257e0c4386eSCy Schubert include/openssl/ssl3.h 1258e0c4386eSCy Schubert include/openssl/sslerr.h 1259e0c4386eSCy Schubert include/openssl/tls1.h 1260e0c4386eSCy Schubert include/openssl/dtls1.h 1261e0c4386eSCy Schubert include/openssl/srtp.h 1262e0c4386eSCy Schubert include/openssl/sslerr_legacy.h ); 1263e0c4386eSCy Schubert my @cryptoheaders_tmpl = 1264e0c4386eSCy Schubert qw( include/internal/dso.h 1265e0c4386eSCy Schubert include/internal/o_dir.h 1266e0c4386eSCy Schubert include/internal/err.h 1267e0c4386eSCy Schubert include/internal/evp.h 1268e0c4386eSCy Schubert include/internal/pem.h 1269e0c4386eSCy Schubert include/internal/asn1.h 1270e0c4386eSCy Schubert include/internal/sslconf.h ); 1271e0c4386eSCy Schubert my @cryptoskipheaders = ( @sslheaders_tmpl, 1272e0c4386eSCy Schubert qw( include/openssl/conf_api.h 1273e0c4386eSCy Schubert include/openssl/ebcdic.h 1274e0c4386eSCy Schubert include/openssl/opensslconf.h 1275e0c4386eSCy Schubert include/openssl/symhacks.h ) ); 1276e0c4386eSCy Schubert our %cryptoheaders = (); 1277e0c4386eSCy Schubert our %sslheaders = (); 1278e0c4386eSCy Schubert foreach my $d ( qw( include/openssl include/internal ) ) { 1279e0c4386eSCy Schubert my @header_patterns = 1280e0c4386eSCy Schubert map { catfile($config{sourcedir}, $d, $_) } ( '*.h', '*.h.in' ); 1281e0c4386eSCy Schubert foreach my $f ( map { glob($_) } @header_patterns ) { 1282e0c4386eSCy Schubert my $base = basename($f); 1283e0c4386eSCy Schubert my $base_in = basename($f, '.in'); 1284e0c4386eSCy Schubert my $dir = catfile($config{sourcedir}, $d); 1285e0c4386eSCy Schubert if ($base ne $base_in) { 1286e0c4386eSCy Schubert # We have a .h.in file, which means the header file is in the 1287e0c4386eSCy Schubert # build tree. 1288e0c4386eSCy Schubert $base = $base_in; 1289e0c4386eSCy Schubert $dir = catfile($config{builddir}, $d); 1290e0c4386eSCy Schubert } 1291e0c4386eSCy Schubert my $new_f = catfile($dir, $base); 1292e0c4386eSCy Schubert my $fn = "$d/$base"; 1293e0c4386eSCy Schubert # The logic to add files to @cryptoheaders is a bit complex. The 1294e0c4386eSCy Schubert # file to be added must be either in the public header directory 1295e0c4386eSCy Schubert # or one of the pre-declared internal headers, and must under no 1296e0c4386eSCy Schubert # circumstances be one of those that must be skipped. 1297e0c4386eSCy Schubert $cryptoheaders{$new_f} = 1 1298e0c4386eSCy Schubert if (($d eq 'include/openssl' 1299e0c4386eSCy Schubert || ( grep { $_ eq $fn } @cryptoheaders_tmpl )) 1300e0c4386eSCy Schubert && !( grep { $_ eq $fn } @cryptoskipheaders )); 1301e0c4386eSCy Schubert # The logic to add files to @sslheaders is much simpler... 1302e0c4386eSCy Schubert $sslheaders{$new_f} = 1 if grep { $_ eq $fn } @sslheaders_tmpl; 1303e0c4386eSCy Schubert } 1304e0c4386eSCy Schubert } 1305e0c4386eSCy Schubert ""; 1306e0c4386eSCy Schubert-} 1307e0c4386eSCy SchubertCRYPTOHEADERS={- join(" \\\n" . ' ' x 14, 1308e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 14, sort keys %cryptoheaders)) -} 1309e0c4386eSCy SchubertSSLHEADERS={- join(" \\\n" . ' ' x 11, 1310e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 11, sort keys %sslheaders)) -} 1311e0c4386eSCy Schubert 1312e0c4386eSCy Schubertrenumber: build_generated 1313e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \ 1314e0c4386eSCy Schubert --ordinals $(SRCDIR)/util/libcrypto.num \ 1315e0c4386eSCy Schubert --symhacks $(SRCDIR)/include/openssl/symhacks.h \ 1316e0c4386eSCy Schubert --renumber \ 1317e0c4386eSCy Schubert $(CRYPTOHEADERS) 1318e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \ 1319e0c4386eSCy Schubert --ordinals $(SRCDIR)/util/libssl.num \ 1320e0c4386eSCy Schubert --symhacks $(SRCDIR)/include/openssl/symhacks.h \ 1321e0c4386eSCy Schubert --renumber \ 1322e0c4386eSCy Schubert $(SSLHEADERS) 1323e0c4386eSCy Schubert 1324e0c4386eSCy Schubertordinals: build_generated 1325e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \ 1326e0c4386eSCy Schubert --ordinals $(SRCDIR)/util/libcrypto.num \ 1327e0c4386eSCy Schubert --symhacks $(SRCDIR)/include/openssl/symhacks.h \ 1328e0c4386eSCy Schubert $(CRYPTOHEADERS) 1329e0c4386eSCy Schubert $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION_NUMBER) --no-warnings \ 1330e0c4386eSCy Schubert --ordinals $(SRCDIR)/util/libssl.num \ 1331e0c4386eSCy Schubert --symhacks $(SRCDIR)/include/openssl/symhacks.h \ 1332e0c4386eSCy Schubert $(SSLHEADERS) 1333e0c4386eSCy Schubert 1334e0c4386eSCy Schuberttest_ordinals: 1335*44096ebdSEnji Cooper "$(MAKE)" run_tests TESTS=test_ordinals 1336e0c4386eSCy Schubert 1337e0c4386eSCy Schuberttags TAGS: FORCE 1338e0c4386eSCy Schubert rm -f TAGS tags 1339e0c4386eSCy Schubert -ctags -R . 1340e0c4386eSCy Schubert -etags `find . -name '*.[ch]' -o -name '*.pm'` 1341e0c4386eSCy Schubert 1342e0c4386eSCy Schubertproviders/fips.checksum.new: providers/fips.module.sources.new 1343e0c4386eSCy Schubert @which unifdef > /dev/null || \ 1344e0c4386eSCy Schubert ( echo >&2 "ERROR: unifdef not in your \$$PATH, FIPS checksums not calculated"; \ 1345e0c4386eSCy Schubert false ) 1346e0c4386eSCy Schubert ( sources=`pwd`/providers/fips.module.sources.new; \ 1347e0c4386eSCy Schubert cd $(SRCDIR) \ 1348e0c4386eSCy Schubert && cat $$sources \ 1349e0c4386eSCy Schubert | xargs ./util/fips-checksums.sh ) \ 1350e0c4386eSCy Schubert > providers/fips-sources.checksums.new \ 1351e0c4386eSCy Schubert && sha256sum providers/fips-sources.checksums.new \ 1352e0c4386eSCy Schubert | sed -e 's|\.new||' > providers/fips.checksum.new 1353e0c4386eSCy Schubert 1354e0c4386eSCy Schubertfips-checksums: providers/fips.checksum.new 1355e0c4386eSCy Schubert 1356e0c4386eSCy Schubert$(SRCDIR)/providers/fips.checksum: providers/fips.checksum.new 1357e0c4386eSCy Schubert cp -p providers/fips.module.sources.new $(SRCDIR)/providers/fips.module.sources 1358e0c4386eSCy Schubert cp -p providers/fips-sources.checksums.new $(SRCDIR)/providers/fips-sources.checksums 1359e0c4386eSCy Schubert cp -p providers/fips.checksum.new $(SRCDIR)/providers/fips.checksum 1360e0c4386eSCy Schubert 1361e0c4386eSCy Schubertupdate-fips-checksums: $(SRCDIR)/providers/fips.checksum 1362e0c4386eSCy Schubert 1363e0c4386eSCy Schubertdiff-fips-checksums: fips-checksums 1364e0c4386eSCy Schubert diff -u $(SRCDIR)/providers/fips.module.sources providers/fips.module.sources.new 1365e0c4386eSCy Schubert diff -u $(SRCDIR)/providers/fips-sources.checksums providers/fips-sources.checksums.new 1366e0c4386eSCy Schubert diff -u $(SRCDIR)/providers/fips.checksum providers/fips.checksum.new 1367e0c4386eSCy Schubert 1368e0c4386eSCy Schubert# Release targets (note: only available on Unix) ##################### 1369e0c4386eSCy Schubert 1370e0c4386eSCy Schuberttar: 1371e0c4386eSCy Schubert (cd $(SRCDIR); ./util/mktar.sh --name='$(NAME)' --tarfile='$(TARFILE)') 1372e0c4386eSCy Schubert 1373e0c4386eSCy Schubert# Helper targets ##################################################### 1374e0c4386eSCy Schubert 1375e0c4386eSCy Schubertlink-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/apps/openssl.cnf 1376e0c4386eSCy Schubert 1377e0c4386eSCy Schubert$(BLDDIR)/util/opensslwrap.sh: Makefile 1378e0c4386eSCy Schubert @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \ 1379e0c4386eSCy Schubert mkdir -p "$(BLDDIR)/util"; \ 1380e0c4386eSCy Schubert ln -sf "../$(SRCDIR)/util/`basename "$@"`" "$(BLDDIR)/util"; \ 1381e0c4386eSCy Schubert fi 1382e0c4386eSCy Schubert 1383e0c4386eSCy Schubert$(BLDDIR)/apps/openssl.cnf: Makefile 1384e0c4386eSCy Schubert @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \ 1385e0c4386eSCy Schubert mkdir -p "$(BLDDIR)/apps"; \ 1386e0c4386eSCy Schubert ln -sf "../$(SRCDIR)/apps/`basename "$@"`" "$(BLDDIR)/apps"; \ 1387e0c4386eSCy Schubert fi 1388e0c4386eSCy Schubert 1389e0c4386eSCy SchubertFORCE: 1390e0c4386eSCy Schubert 1391e0c4386eSCy Schubert# Building targets ################################################### 1392e0c4386eSCy Schubert 1393e0c4386eSCy Schubertlibcrypto.pc libssl.pc openssl.pc: Makefile $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // platform->sharedlib_import($_) // platform->sharedlib($_) // () } @{$unified_info{libraries}}) -} 1394e0c4386eSCy Schubert 1395e0c4386eSCy Schubertlibcrypto.pc: 1396e0c4386eSCy Schubert @ ( echo 'prefix=$(INSTALLTOP)'; \ 1397e0c4386eSCy Schubert echo 'exec_prefix=$${prefix}'; \ 1398e0c4386eSCy Schubert if [ -n "$(LIBDIR)" ]; then \ 1399e0c4386eSCy Schubert echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ 1400e0c4386eSCy Schubert else \ 1401e0c4386eSCy Schubert echo 'libdir=$(libdir)'; \ 1402e0c4386eSCy Schubert fi; \ 1403e0c4386eSCy Schubert echo 'includedir=$${prefix}/include'; \ 1404e0c4386eSCy Schubert echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \ 1405e0c4386eSCy Schubert echo 'modulesdir=$${libdir}/ossl-modules'; \ 1406e0c4386eSCy Schubert echo ''; \ 1407e0c4386eSCy Schubert echo 'Name: OpenSSL-libcrypto'; \ 1408e0c4386eSCy Schubert echo 'Description: OpenSSL cryptography library'; \ 1409e0c4386eSCy Schubert echo 'Version: '$(VERSION); \ 1410e0c4386eSCy Schubert echo 'Libs: -L$${libdir} -lcrypto'; \ 1411e0c4386eSCy Schubert echo 'Libs.private: $(LIB_EX_LIBS)'; \ 1412e0c4386eSCy Schubert echo 'Cflags: -I$${includedir}' ) > libcrypto.pc 1413e0c4386eSCy Schubert 1414e0c4386eSCy Schubertlibssl.pc: 1415e0c4386eSCy Schubert @ ( echo 'prefix=$(INSTALLTOP)'; \ 1416e0c4386eSCy Schubert echo 'exec_prefix=$${prefix}'; \ 1417e0c4386eSCy Schubert if [ -n "$(LIBDIR)" ]; then \ 1418e0c4386eSCy Schubert echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ 1419e0c4386eSCy Schubert else \ 1420e0c4386eSCy Schubert echo 'libdir=$(libdir)'; \ 1421e0c4386eSCy Schubert fi; \ 1422e0c4386eSCy Schubert echo 'includedir=$${prefix}/include'; \ 1423e0c4386eSCy Schubert echo ''; \ 1424e0c4386eSCy Schubert echo 'Name: OpenSSL-libssl'; \ 1425e0c4386eSCy Schubert echo 'Description: Secure Sockets Layer and cryptography libraries'; \ 1426e0c4386eSCy Schubert echo 'Version: '$(VERSION); \ 1427e0c4386eSCy Schubert echo 'Requires.private: libcrypto'; \ 1428e0c4386eSCy Schubert echo 'Libs: -L$${libdir} -lssl'; \ 1429e0c4386eSCy Schubert echo 'Cflags: -I$${includedir}' ) > libssl.pc 1430e0c4386eSCy Schubert 1431e0c4386eSCy Schubertopenssl.pc: 1432e0c4386eSCy Schubert @ ( echo 'prefix=$(INSTALLTOP)'; \ 1433e0c4386eSCy Schubert echo 'exec_prefix=$${prefix}'; \ 1434e0c4386eSCy Schubert if [ -n "$(LIBDIR)" ]; then \ 1435e0c4386eSCy Schubert echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ 1436e0c4386eSCy Schubert else \ 1437e0c4386eSCy Schubert echo 'libdir=$(libdir)'; \ 1438e0c4386eSCy Schubert fi; \ 1439e0c4386eSCy Schubert echo 'includedir=$${prefix}/include'; \ 1440e0c4386eSCy Schubert echo ''; \ 1441e0c4386eSCy Schubert echo 'Name: OpenSSL'; \ 1442e0c4386eSCy Schubert echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ 1443e0c4386eSCy Schubert echo 'Version: '$(VERSION); \ 1444e0c4386eSCy Schubert echo 'Requires: libssl libcrypto' ) > openssl.pc 1445e0c4386eSCy Schubert 1446e0c4386eSCy SchubertMakefile: configdata.pm \ 1447e0c4386eSCy Schubert {- join(" \\\n" . ' ' x 10, 1448e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 10, 1449e0c4386eSCy Schubert @{$config{build_file_templates}})) -} 1450e0c4386eSCy Schubert @echo "Detected changed: $?" 1451e0c4386eSCy Schubert $(PERL) configdata.pm 1452e0c4386eSCy Schubert @echo "**************************************************" 1453e0c4386eSCy Schubert @echo "*** ***" 1454e0c4386eSCy Schubert @echo "*** Please run the same make command again ***" 1455e0c4386eSCy Schubert @echo "*** ***" 1456e0c4386eSCy Schubert @echo "**************************************************" 1457e0c4386eSCy Schubert @false 1458e0c4386eSCy Schubert 1459e0c4386eSCy Schubertconfigdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config \ 1460e0c4386eSCy Schubert {- join(" \\\n" . ' ' x 15, 1461e0c4386eSCy Schubert fill_lines(" ", $COLUMNS - 15, 1462e0c4386eSCy Schubert @{$config{build_infos}}, 1463e0c4386eSCy Schubert @{$config{conf_files}})) -} 1464e0c4386eSCy Schubert @echo "Detected changed: $?" 1465e0c4386eSCy Schubert $(PERL) configdata.pm -r 1466e0c4386eSCy Schubert @echo "**************************************************" 1467e0c4386eSCy Schubert @echo "*** ***" 1468e0c4386eSCy Schubert @echo "*** Please run the same make command again ***" 1469e0c4386eSCy Schubert @echo "*** ***" 1470e0c4386eSCy Schubert @echo "**************************************************" 1471e0c4386eSCy Schubert @false 1472e0c4386eSCy Schubert 1473e0c4386eSCy Schubertreconfigure reconf: 1474e0c4386eSCy Schubert $(PERL) configdata.pm -r 1475e0c4386eSCy Schubert 1476e0c4386eSCy Schubert{- 1477e0c4386eSCy Schubert use File::Basename; 1478e0c4386eSCy Schubert use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/; 1479e0c4386eSCy Schubert 1480e0c4386eSCy Schubert # Helper function to convert dependencies in platform agnostic form to 1481e0c4386eSCy Schubert # dependencies in platform form. 1482e0c4386eSCy Schubert sub compute_platform_depends { 1483e0c4386eSCy Schubert map { my $x = $_; 1484e0c4386eSCy Schubert 1485e0c4386eSCy Schubert grep { $x eq $_ } @{$unified_info{programs}} and platform->bin($x) 1486e0c4386eSCy Schubert or grep { $x eq $_ } @{$unified_info{modules}} and platform->dso($x) 1487e0c4386eSCy Schubert or grep { $x eq $_ } @{$unified_info{libraries}} and platform->lib($x) 1488e0c4386eSCy Schubert or platform->convertext($x); } @_; 1489e0c4386eSCy Schubert } 1490e0c4386eSCy Schubert 1491e0c4386eSCy Schubert # Helper function to figure out dependencies on libraries 1492e0c4386eSCy Schubert # It takes a list of library names and outputs a list of dependencies 1493e0c4386eSCy Schubert sub compute_lib_depends { 1494e0c4386eSCy Schubert # Depending on shared libraries: 1495e0c4386eSCy Schubert # On Windows POSIX layers, we depend on {libname}.dll.a 1496e0c4386eSCy Schubert # On Unix platforms, we depend on {shlibname}.so 1497e0c4386eSCy Schubert return map { platform->sharedlib_simple($_) 1498e0c4386eSCy Schubert // platform->sharedlib_import($_) 1499e0c4386eSCy Schubert // platform->sharedlib($_) 1500e0c4386eSCy Schubert // platform->staticlib($_) 1501e0c4386eSCy Schubert } @_; 1502e0c4386eSCy Schubert } 1503e0c4386eSCy Schubert 1504e0c4386eSCy Schubert sub generatetarget { 1505e0c4386eSCy Schubert my %args = @_; 1506e0c4386eSCy Schubert my $deps = join(" ", compute_platform_depends(@{$args{deps}})); 1507e0c4386eSCy Schubert return <<"EOF"; 1508e0c4386eSCy Schubert$args{target}: $deps 1509e0c4386eSCy SchubertEOF 1510e0c4386eSCy Schubert } 1511e0c4386eSCy Schubert 1512e0c4386eSCy Schubert sub generatesrc { 1513e0c4386eSCy Schubert my %args = @_; 1514e0c4386eSCy Schubert my $gen0 = $args{generator}->[0]; 1515e0c4386eSCy Schubert my $gen_args = join('', map { " $_" } 1516e0c4386eSCy Schubert @{$args{generator}}[1..$#{$args{generator}}]); 1517e0c4386eSCy Schubert my $gen_incs = join("", map { " -I".$_ } @{$args{generator_incs}}); 1518e0c4386eSCy Schubert my $incs = join("", map { " -I".$_ } @{$args{incs}}); 1519e0c4386eSCy Schubert my $defs = join("", map { " -D".$_ } @{$args{defs}}); 1520e0c4386eSCy Schubert my $deps = join(" ", compute_platform_depends(@{$args{generator_deps}}, 1521e0c4386eSCy Schubert @{$args{deps}})); 1522e0c4386eSCy Schubert 1523e0c4386eSCy Schubert if ($args{src} =~ /\.html$/) { 1524e0c4386eSCy Schubert # 1525e0c4386eSCy Schubert # HTML generator 1526e0c4386eSCy Schubert # 1527e0c4386eSCy Schubert my $title = basename($args{src}, ".html"); 1528e0c4386eSCy Schubert my $pod = $gen0; 1529e0c4386eSCy Schubert return <<"EOF"; 1530e0c4386eSCy Schubert$args{src}: $pod 1531e0c4386eSCy Schubert \$(PERL) \$(SRCDIR)/util/mkpod2html.pl -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc" 1532e0c4386eSCy SchubertEOF 1533e0c4386eSCy Schubert } elsif ($args{src} =~ /\.(\d)$/) { 1534e0c4386eSCy Schubert # 1535e0c4386eSCy Schubert # Man-page generator 1536e0c4386eSCy Schubert # 1537e0c4386eSCy Schubert my $section = $1; 1538e0c4386eSCy Schubert my $name = uc basename($args{src}, ".$section"); 1539e0c4386eSCy Schubert my $pod = $gen0; 1540e0c4386eSCy Schubert return <<"EOF"; 1541e0c4386eSCy Schubert$args{src}: $pod 1542e0c4386eSCy Schubert pod2man --name=$name --section=$section\$(MANSUFFIX) --center=OpenSSL \\ 1543e0c4386eSCy Schubert --release=\$(VERSION) $pod >\$\@ 1544e0c4386eSCy SchubertEOF 1545e0c4386eSCy Schubert } elsif (platform->isdef($args{src})) { 1546e0c4386eSCy Schubert # 1547e0c4386eSCy Schubert # Linker script-ish generator 1548e0c4386eSCy Schubert # 1549e0c4386eSCy Schubert my $target = platform->def($args{src}); 1550e0c4386eSCy Schubert (my $mkdef_os = $target{shared_target}) =~ s|-shared$||; 1551e0c4386eSCy Schubert my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION_NUMBER)' : ''; 1552e0c4386eSCy Schubert my $ord_name = $args{generator}->[1] || $args{product}; 1553e0c4386eSCy Schubert return <<"EOF"; 1554e0c4386eSCy Schubert$target: $gen0 $deps \$(SRCDIR)/util/mkdef.pl 1555e0c4386eSCy Schubert \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --type $args{intent} --ordinals $gen0 --name $ord_name --OS $mkdef_os > $target 1556e0c4386eSCy SchubertEOF 1557e0c4386eSCy Schubert } elsif (platform->isasm($args{src}) 1558e0c4386eSCy Schubert || platform->iscppasm($args{src})) { 1559e0c4386eSCy Schubert # 1560e0c4386eSCy Schubert # Assembler generator 1561e0c4386eSCy Schubert # 1562e0c4386eSCy Schubert my $cppflags = { 1563e0c4386eSCy Schubert shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', 1564e0c4386eSCy Schubert lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', 1565e0c4386eSCy Schubert dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', 1566e0c4386eSCy Schubert bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' 1567e0c4386eSCy Schubert } -> {$args{intent}}; 1568e0c4386eSCy Schubert 1569e0c4386eSCy Schubert my $generator; 1570e0c4386eSCy Schubert if ($gen0 =~ /\.pl$/) { 1571e0c4386eSCy Schubert $generator = 'CC="$(CC)" $(PERL)'.$gen_incs.' '.$gen0.$gen_args 1572e0c4386eSCy Schubert .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)'; 1573e0c4386eSCy Schubert } elsif ($gen0 =~ /\.m4$/) { 1574e0c4386eSCy Schubert $generator = 'm4 -B 8192'.$gen_incs.' '.$gen0.$gen_args.' >' 1575e0c4386eSCy Schubert } elsif ($gen0 =~ /\.S$/) { 1576e0c4386eSCy Schubert $generator = undef; 1577e0c4386eSCy Schubert } else { 1578e0c4386eSCy Schubert die "Generator type for $args{src} unknown: $gen0\n"; 1579e0c4386eSCy Schubert } 1580e0c4386eSCy Schubert 1581e0c4386eSCy Schubert if (defined($generator)) { 1582e0c4386eSCy Schubert return <<"EOF"; 1583e0c4386eSCy Schubert$args{src}: $gen0 $deps 1584e0c4386eSCy Schubert $generator \$@ 1585e0c4386eSCy SchubertEOF 1586e0c4386eSCy Schubert } 1587e0c4386eSCy Schubert return <<"EOF"; 1588e0c4386eSCy Schubert$args{src}: $gen0 $deps 1589e0c4386eSCy Schubert \$(CC) $incs $cppflags $defs -E $gen0 | \\ 1590e0c4386eSCy Schubert \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@ 1591e0c4386eSCy SchubertEOF 1592e0c4386eSCy Schubert } elsif ($gen0 =~ m|^.*\.in$|) { 1593e0c4386eSCy Schubert # 1594e0c4386eSCy Schubert # "dofile" generator (file.in -> file) 1595e0c4386eSCy Schubert # 1596e0c4386eSCy Schubert my $dofile = abs2rel(rel2abs(catfile($config{sourcedir}, 1597e0c4386eSCy Schubert "util", "dofile.pl")), 1598e0c4386eSCy Schubert rel2abs($config{builddir})); 1599e0c4386eSCy Schubert my @perlmodules = ( 'configdata.pm', 1600e0c4386eSCy Schubert grep { $_ =~ m|\.pm$| } @{$args{deps}} ); 1601e0c4386eSCy Schubert my %perlmoduleincs = map { '"-I'.dirname($_).'"' => 1 } @perlmodules; 1602e0c4386eSCy Schubert $deps = join(' ', $deps, compute_platform_depends(@perlmodules)); 1603e0c4386eSCy Schubert @perlmodules = map { "-M".basename($_, '.pm') } @perlmodules; 1604e0c4386eSCy Schubert my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules); 1605e0c4386eSCy Schubert return <<"EOF"; 1606e0c4386eSCy Schubert$args{src}: $gen0 $deps 1607e0c4386eSCy Schubert \$(PERL)$perlmodules "$dofile" "-o$target{build_file}" $gen0$gen_args > \$@ 1608e0c4386eSCy SchubertEOF 1609e0c4386eSCy Schubert } elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) { 1610e0c4386eSCy Schubert # 1611e0c4386eSCy Schubert # Generic generator using OpenSSL programs 1612e0c4386eSCy Schubert # 1613e0c4386eSCy Schubert 1614e0c4386eSCy Schubert # Redo $gen0, to ensure that we have the proper extension where 1615e0c4386eSCy Schubert # necessary. 1616e0c4386eSCy Schubert $gen0 = platform->bin($gen0); 1617e0c4386eSCy Schubert # Use $(PERL) to execute wrap.pl directly to avoid calling env 1618e0c4386eSCy Schubert return <<"EOF"; 1619e0c4386eSCy Schubert$args{src}: $gen0 $deps \$(BLDDIR)/util/wrap.pl 1620e0c4386eSCy Schubert \$(PERL) \$(BLDDIR)/util/wrap.pl $gen0$gen_args > \$@ 1621e0c4386eSCy SchubertEOF 1622e0c4386eSCy Schubert } else { 1623e0c4386eSCy Schubert # 1624e0c4386eSCy Schubert # Generic generator using Perl 1625e0c4386eSCy Schubert # 1626e0c4386eSCy Schubert return <<"EOF"; 1627e0c4386eSCy Schubert$args{src}: $gen0 $deps 1628e0c4386eSCy Schubert \$(PERL)$gen_incs $gen0$gen_args > \$@ 1629e0c4386eSCy SchubertEOF 1630e0c4386eSCy Schubert } 1631e0c4386eSCy Schubert } 1632e0c4386eSCy Schubert 1633e0c4386eSCy Schubert # Should one wonder about the end of the Perl snippet, it's because this 1634e0c4386eSCy Schubert # second regexp eats up line endings as well, if the removed path is the 1635e0c4386eSCy Schubert # last in the line. We may therefore need to put back a line ending. 1636e0c4386eSCy Schubert sub src2obj { 1637e0c4386eSCy Schubert my %args = @_; 1638e0c4386eSCy Schubert my $obj = platform->convertext($args{obj}); 1639e0c4386eSCy Schubert my $dep = platform->dep($args{obj}); 1640e0c4386eSCy Schubert my @srcs = @{$args{srcs}}; 1641e0c4386eSCy Schubert my $srcs = join(" ", @srcs); 1642e0c4386eSCy Schubert my $deps = join(" ", @srcs, @{$args{deps}}); 1643e0c4386eSCy Schubert my $incs = join("", map { " -I".$_ } @{$args{incs}}); 1644e0c4386eSCy Schubert my $defs = join("", map { " -D".$_ } @{$args{defs}}); 1645e0c4386eSCy Schubert my $cmd; 1646e0c4386eSCy Schubert my $cmdflags; 1647e0c4386eSCy Schubert my $cmdcompile; 1648e0c4386eSCy Schubert if (grep /\.rc$/, @srcs) { 1649e0c4386eSCy Schubert $cmd = '$(RC)'; 1650e0c4386eSCy Schubert $cmdflags = '$(RCFLAGS)'; 1651e0c4386eSCy Schubert $cmdcompile = ''; 1652e0c4386eSCy Schubert } elsif (grep /\.(cc|cpp)$/, @srcs) { 1653e0c4386eSCy Schubert $cmd = '$(CXX)'; 1654e0c4386eSCy Schubert $cmdcompile = ' -c'; 1655e0c4386eSCy Schubert $cmdflags = { 1656e0c4386eSCy Schubert shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)', 1657e0c4386eSCy Schubert lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)', 1658e0c4386eSCy Schubert dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)', 1659e0c4386eSCy Schubert bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)' 1660e0c4386eSCy Schubert } -> {$args{intent}}; 1661e0c4386eSCy Schubert } else { 1662e0c4386eSCy Schubert $cmd = '$(CC)'; 1663e0c4386eSCy Schubert $cmdcompile = ' -c'; 1664e0c4386eSCy Schubert $cmdflags = { 1665e0c4386eSCy Schubert shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', 1666e0c4386eSCy Schubert lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)', 1667e0c4386eSCy Schubert dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)', 1668e0c4386eSCy Schubert bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)' 1669e0c4386eSCy Schubert } -> {$args{intent}}; 1670e0c4386eSCy Schubert } 1671e0c4386eSCy Schubert my $recipe; 1672e0c4386eSCy Schubert # extension-specific rules 1673e0c4386eSCy Schubert if (grep /\.s$/, @srcs) { 1674e0c4386eSCy Schubert $recipe .= <<"EOF"; 1675e0c4386eSCy Schubert$obj: $deps 1676e0c4386eSCy Schubert $cmd $cmdflags -c -o \$\@ $srcs 1677e0c4386eSCy SchubertEOF 1678e0c4386eSCy Schubert } elsif (grep /\.S$/, @srcs) { 1679e0c4386eSCy Schubert # Originally there was multi-step rule with $(CC) -E file.S 1680e0c4386eSCy Schubert # followed by $(CC) -c file.s. It compensated for one of 1681e0c4386eSCy Schubert # legacy platform compiler's inability to handle .S files. 1682e0c4386eSCy Schubert # The platform is long discontinued by vendor so there is 1683e0c4386eSCy Schubert # hardly a point to drag it along... 1684e0c4386eSCy Schubert $recipe .= <<"EOF"; 1685e0c4386eSCy Schubert$obj: $deps 1686e0c4386eSCy Schubert $cmd $incs $defs $cmdflags -c -o \$\@ $srcs 1687e0c4386eSCy SchubertEOF 1688e0c4386eSCy Schubert } elsif ($makedep_scheme eq 'gcc' && !grep /\.rc$/, @srcs) { 1689e0c4386eSCy Schubert $recipe .= <<"EOF"; 1690e0c4386eSCy Schubert$obj: $deps 1691e0c4386eSCy Schubert $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs 1692e0c4386eSCy Schubert \@touch $dep.tmp 1693e0c4386eSCy Schubert \@if cmp $dep.tmp $dep > /dev/null 2> /dev/null; then \\ 1694e0c4386eSCy Schubert rm -f $dep.tmp; \\ 1695e0c4386eSCy Schubert else \\ 1696e0c4386eSCy Schubert mv $dep.tmp $dep; \\ 1697e0c4386eSCy Schubert fi 1698e0c4386eSCy SchubertEOF 1699e0c4386eSCy Schubert } else { 1700e0c4386eSCy Schubert $recipe .= <<"EOF"; 1701e0c4386eSCy Schubert$obj: $deps 1702e0c4386eSCy Schubert $cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs 1703e0c4386eSCy SchubertEOF 1704e0c4386eSCy Schubert if ($makedep_scheme eq 'makedepend') { 1705e0c4386eSCy Schubert $recipe .= <<"EOF"; 1706e0c4386eSCy Schubert \$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\ 1707e0c4386eSCy Schubert > $dep 1708e0c4386eSCy SchubertEOF 1709e0c4386eSCy Schubert } 1710e0c4386eSCy Schubert } 1711e0c4386eSCy Schubert return $recipe; 1712e0c4386eSCy Schubert } 1713e0c4386eSCy Schubert # We *know* this routine is only called when we've configure 'shared'. 1714e0c4386eSCy Schubert sub obj2shlib { 1715e0c4386eSCy Schubert my %args = @_; 1716e0c4386eSCy Schubert my @linkdirs = (); 1717e0c4386eSCy Schubert my @linklibs = (); 1718e0c4386eSCy Schubert foreach (@{$args{deps}}) { 1719e0c4386eSCy Schubert if (platform->isstaticlib($_)) { 1720e0c4386eSCy Schubert push @linklibs, platform->convertext($_); 1721e0c4386eSCy Schubert } else { 1722e0c4386eSCy Schubert my $d = "-L" . dirname($_); 1723e0c4386eSCy Schubert my $l = basename($_); 1724e0c4386eSCy Schubert $l =~ s/^lib//; 1725e0c4386eSCy Schubert $l = "-l" . $l; 1726e0c4386eSCy Schubert push @linklibs, $l; 1727e0c4386eSCy Schubert push @linkdirs, $d unless grep { $d eq $_ } @linkdirs; 1728e0c4386eSCy Schubert } 1729e0c4386eSCy Schubert } 1730e0c4386eSCy Schubert my $linkflags = join("", map { $_." " } @linkdirs); 1731e0c4386eSCy Schubert my $linklibs = join("", map { $_." " } @linklibs); 1732e0c4386eSCy Schubert my @objs = map { platform->convertext($_) } 1733e0c4386eSCy Schubert grep { !platform->isdef($_) } 1734e0c4386eSCy Schubert @{$args{objs}}; 1735e0c4386eSCy Schubert my @defs = map { platform->def($_) } 1736e0c4386eSCy Schubert grep { platform->isdef($_) } 1737e0c4386eSCy Schubert @{$args{objs}}; 1738e0c4386eSCy Schubert my @deps = compute_lib_depends(@{$args{deps}}); 1739e0c4386eSCy Schubert die "More than one exported symbol map" if scalar @defs > 1; 1740e0c4386eSCy Schubert 1741e0c4386eSCy Schubert my $full = platform->sharedlib($args{lib}); 1742e0c4386eSCy Schubert # $import is for Windows and subsystems thereof, where static import 1743e0c4386eSCy Schubert # libraries for DLLs are a thing. On platforms that have this mechanism, 1744e0c4386eSCy Schubert # $import has the name of this import library. On platforms that don't 1745e0c4386eSCy Schubert # have this mechanism, $import will be |undef|. 1746e0c4386eSCy Schubert my $import = platform->sharedlib_import($args{lib}); 1747e0c4386eSCy Schubert # $simple is for platforms where full shared library names include the 1748e0c4386eSCy Schubert # shared library version, and there's a simpler name that doesn't include 1749e0c4386eSCy Schubert # that version. On such platforms, $simple has the simpler name. On 1750e0c4386eSCy Schubert # other platforms, it will be |undef|. 1751e0c4386eSCy Schubert my $simple = platform->sharedlib_simple($args{lib}); 1752e0c4386eSCy Schubert 1753e0c4386eSCy Schubert my $argfile = defined $target{shared_argfileflag} ? $full.".args" : undef; 1754e0c4386eSCy Schubert my $shared_soname = ""; 1755e0c4386eSCy Schubert $shared_soname .= ' '.$target{shared_sonameflag}.basename($full) 1756e0c4386eSCy Schubert if defined $target{shared_sonameflag}; 1757e0c4386eSCy Schubert my $shared_imp = ""; 1758e0c4386eSCy Schubert $shared_imp .= ' '.$target{shared_impflag}.basename($import) 1759e0c4386eSCy Schubert if defined $target{shared_impflag} && defined $import; 1760e0c4386eSCy Schubert my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs); 1761e0c4386eSCy Schubert 1762e0c4386eSCy Schubert # There is at least one platform where the compiler-as-linker needs to 1763e0c4386eSCy Schubert # have one object file directly on the command line. That won't hurt 1764e0c4386eSCy Schubert # any other platform, so we do that for everyone when there's an argfile 1765e0c4386eSCy Schubert # to be had. This depends heavily on splice, which removes elements from 1766e0c4386eSCy Schubert # the given array, and returns them so they can be captured. 1767e0c4386eSCy Schubert my @argfileobjs = $argfile 1768e0c4386eSCy Schubert ? splice(@objs, 1) 1769e0c4386eSCy Schubert : (); 1770e0c4386eSCy Schubert my $argfilecmds = $argfile 1771e0c4386eSCy Schubert ? join("\n\t", map { "echo $_ >> $argfile" } @argfileobjs) 1772e0c4386eSCy Schubert : undef; 1773e0c4386eSCy Schubert my $argfiledeps = $argfile 1774e0c4386eSCy Schubert ? join(" \\\n" . ' ' x (length($argfile) + 2), 1775e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - length($full) - 2, @argfileobjs)) 1776e0c4386eSCy Schubert : undef; 1777e0c4386eSCy Schubert my @fulldeps = (@objs, ($argfile ? $argfile : ()), @defs, @deps); 1778e0c4386eSCy Schubert my @fullobjs = ( 1779e0c4386eSCy Schubert @objs, 1780e0c4386eSCy Schubert ($argfile ? $target{shared_argfileflag}.$argfile : ()) 1781e0c4386eSCy Schubert ); 1782e0c4386eSCy Schubert my $fulldeps = 1783e0c4386eSCy Schubert join(" \\\n" . ' ' x (length($full) + 2), 1784e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - length($full) - 2, @fulldeps)); 1785e0c4386eSCy Schubert my $fullobjs = 1786e0c4386eSCy Schubert join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @fullobjs)); 1787e0c4386eSCy Schubert 1788e0c4386eSCy Schubert my $recipe = ''; 1789e0c4386eSCy Schubert 1790e0c4386eSCy Schubert if (defined $simple && $simple ne $full) { 1791e0c4386eSCy Schubert if (sharedaix()) { 1792e0c4386eSCy Schubert $recipe .= <<"EOF"; 1793e0c4386eSCy Schubert$simple: $full 1794e0c4386eSCy Schubert rm -f $simple && \\ 1795e0c4386eSCy Schubert \$(AR) r $simple $full 1796e0c4386eSCy SchubertEOF 1797e0c4386eSCy Schubert } else { 1798e0c4386eSCy Schubert $recipe .= <<"EOF"; 1799e0c4386eSCy Schubert$simple: $full 1800e0c4386eSCy Schubert rm -f $simple && \\ 1801e0c4386eSCy Schubert ln -s $full $simple 1802e0c4386eSCy SchubertEOF 1803e0c4386eSCy Schubert } 1804e0c4386eSCy Schubert } 1805e0c4386eSCy Schubert if (defined $import) { 1806e0c4386eSCy Schubert $recipe .= <<"EOF"; 1807e0c4386eSCy Schubert$import: $full 1808e0c4386eSCy SchubertEOF 1809e0c4386eSCy Schubert } 1810e0c4386eSCy Schubert $recipe .= <<"EOF"; 1811e0c4386eSCy Schubert$full: $fulldeps 1812e0c4386eSCy Schubert \$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\ 1813e0c4386eSCy Schubert -o $full$shared_def \\ 1814e0c4386eSCy Schubert $fullobjs \\ 1815e0c4386eSCy Schubert $linklibs \$(LIB_EX_LIBS) 1816e0c4386eSCy SchubertEOF 1817e0c4386eSCy Schubert if (windowsdll()) { 1818e0c4386eSCy Schubert $recipe .= <<"EOF"; 1819e0c4386eSCy Schubert rm -f apps/$full 1820e0c4386eSCy Schubert rm -f fuzz/$full 1821e0c4386eSCy Schubert cp -p $full apps/ 1822e0c4386eSCy Schubert cp -p $full fuzz/ 1823e0c4386eSCy SchubertEOF 1824e0c4386eSCy Schubert if (!$disabled{tests}) { 1825e0c4386eSCy Schubert $recipe .= <<"EOF"; 1826e0c4386eSCy Schubert rm -f test/$full 1827e0c4386eSCy Schubert cp -p $full test/ 1828e0c4386eSCy SchubertEOF 1829e0c4386eSCy Schubert } 1830e0c4386eSCy Schubert } 1831e0c4386eSCy Schubert $recipe .= <<"EOF" if defined $argfile; 1832e0c4386eSCy Schubert$argfile: $argfiledeps 1833e0c4386eSCy Schubert \$(RM) $argfile 1834e0c4386eSCy Schubert $argfilecmds 1835e0c4386eSCy SchubertEOF 1836e0c4386eSCy Schubert return $recipe; 1837e0c4386eSCy Schubert } 1838e0c4386eSCy Schubert sub obj2dso { 1839e0c4386eSCy Schubert my %args = @_; 1840e0c4386eSCy Schubert my $dso = platform->dso($args{module}); 1841e0c4386eSCy Schubert my @linkdirs = (); 1842e0c4386eSCy Schubert my @linklibs = (); 1843e0c4386eSCy Schubert foreach (@{$args{deps}}) { 1844e0c4386eSCy Schubert next unless defined $_; 1845e0c4386eSCy Schubert if (platform->isstaticlib($_)) { 1846e0c4386eSCy Schubert push @linklibs, platform->convertext($_); 1847e0c4386eSCy Schubert } else { 1848e0c4386eSCy Schubert my $d = "-L" . dirname($_); 1849e0c4386eSCy Schubert my $l = basename($_); 1850e0c4386eSCy Schubert $l =~ s/^lib//; 1851e0c4386eSCy Schubert $l = "-l" . $l; 1852e0c4386eSCy Schubert push @linklibs, $l; 1853e0c4386eSCy Schubert push @linkdirs, $d unless grep { $d eq $_ } @linkdirs; 1854e0c4386eSCy Schubert } 1855e0c4386eSCy Schubert } 1856e0c4386eSCy Schubert my $linkflags = join("", map { $_." " } @linkdirs); 1857e0c4386eSCy Schubert my $linklibs = join("", map { $_." " } @linklibs); 1858e0c4386eSCy Schubert my @objs = map { platform->convertext($_) } 1859e0c4386eSCy Schubert grep { !platform->isdef($_) } 1860e0c4386eSCy Schubert @{$args{objs}}; 1861e0c4386eSCy Schubert my @defs = map { platform->def($_) } 1862e0c4386eSCy Schubert grep { platform->isdef($_) } 1863e0c4386eSCy Schubert @{$args{objs}}; 1864e0c4386eSCy Schubert my @deps = compute_lib_depends(@{$args{deps}}); 1865e0c4386eSCy Schubert my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs); 1866e0c4386eSCy Schubert # Next line needs to become "less magic" (see PR #11950) 1867e0c4386eSCy Schubert $shared_def .= ' '.$target{shared_fipsflag} if (defined $target{shared_fipsflag} && $shared_def =~ m/providers\/fips/); 1868e0c4386eSCy Schubert my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs)); 1869e0c4386eSCy Schubert my $deps = join(" \\\n" . ' ' x (length($dso) + 2), 1870e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - length($dso) - 2, 1871e0c4386eSCy Schubert @objs, @defs, @deps)); 1872e0c4386eSCy Schubert 1873e0c4386eSCy Schubert return <<"EOF"; 1874e0c4386eSCy Schubert$dso: $deps 1875e0c4386eSCy Schubert \$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\ 1876e0c4386eSCy Schubert -o $dso$shared_def \\ 1877e0c4386eSCy Schubert $objs \\ 1878e0c4386eSCy Schubert $linklibs\$(DSO_EX_LIBS) 1879e0c4386eSCy SchubertEOF 1880e0c4386eSCy Schubert } 1881e0c4386eSCy Schubert sub obj2lib { 1882e0c4386eSCy Schubert my %args = @_; 1883e0c4386eSCy Schubert my $lib = platform->staticlib($args{lib}); 1884e0c4386eSCy Schubert my @objs = map { platform->obj($_) } @{$args{objs}}; 1885e0c4386eSCy Schubert my $deps = join(" \\\n" . ' ' x (length($lib) + 2), 1886e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - length($lib) - 2, @objs)); 1887e0c4386eSCy Schubert my $max_per_call = 500; 1888e0c4386eSCy Schubert my @objs_grouped; 1889e0c4386eSCy Schubert push @objs_grouped, join(" ", splice @objs, 0, $max_per_call) while @objs; 1890e0c4386eSCy Schubert my $fill_lib = 1891e0c4386eSCy Schubert join("\n\t", (map { "\$(AR) \$(ARFLAGS) $lib $_" } @objs_grouped)); 1892e0c4386eSCy Schubert return <<"EOF"; 1893e0c4386eSCy Schubert$lib: $deps 1894e0c4386eSCy Schubert \$(RM) $lib 1895e0c4386eSCy Schubert $fill_lib 1896e0c4386eSCy Schubert \$(RANLIB) \$\@ || echo Never mind. 1897e0c4386eSCy SchubertEOF 1898e0c4386eSCy Schubert } 1899e0c4386eSCy Schubert sub obj2bin { 1900e0c4386eSCy Schubert my %args = @_; 1901e0c4386eSCy Schubert my $bin = platform->bin($args{bin}); 1902e0c4386eSCy Schubert my @objs = map { platform->obj($_) } @{$args{objs}}; 1903e0c4386eSCy Schubert my @deps = compute_lib_depends(@{$args{deps}}); 1904e0c4386eSCy Schubert my $objs = join(" \\\n" . ' ' x (length($bin) + 2), 1905e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - length($bin) - 2, @objs)); 1906e0c4386eSCy Schubert my @linkdirs = (); 1907e0c4386eSCy Schubert my @linklibs = (); 1908e0c4386eSCy Schubert foreach (@{$args{deps}}) { 1909e0c4386eSCy Schubert next unless defined $_; 1910e0c4386eSCy Schubert if (platform->isstaticlib($_)) { 1911e0c4386eSCy Schubert push @linklibs, platform->convertext($_); 1912e0c4386eSCy Schubert } else { 1913e0c4386eSCy Schubert my $d = "-L" . dirname($_); 1914e0c4386eSCy Schubert my $l = basename($_); 1915e0c4386eSCy Schubert $l =~ s/^lib//; 1916e0c4386eSCy Schubert $l = "-l" . $l; 1917e0c4386eSCy Schubert push @linklibs, $l; 1918e0c4386eSCy Schubert push @linkdirs, $d unless grep { $d eq $_ } @linkdirs; 1919e0c4386eSCy Schubert } 1920e0c4386eSCy Schubert } 1921e0c4386eSCy Schubert my $linkflags = join("", map { $_." " } @linkdirs); 1922e0c4386eSCy Schubert my $linklibs = join("", map { $_." " } @linklibs); 1923e0c4386eSCy Schubert my $cmd = '$(CC)'; 1924e0c4386eSCy Schubert my $cmdflags = '$(BIN_CFLAGS)'; 1925e0c4386eSCy Schubert if (grep /_cc\.o$/, @{$args{objs}}) { 1926e0c4386eSCy Schubert $cmd = '$(CXX)'; 1927e0c4386eSCy Schubert $cmdflags = '$(BIN_CXXFLAGS)'; 1928e0c4386eSCy Schubert } 1929e0c4386eSCy Schubert 1930e0c4386eSCy Schubert my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs)); 1931e0c4386eSCy Schubert my $deps = join(" \\\n" . ' ' x (length($bin) + 2), 1932e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - length($bin) - 2, 1933e0c4386eSCy Schubert @objs, @deps)); 1934e0c4386eSCy Schubert 1935e0c4386eSCy Schubert return <<"EOF"; 1936e0c4386eSCy Schubert$bin: $deps 1937e0c4386eSCy Schubert rm -f $bin 1938e0c4386eSCy Schubert \$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\ 1939e0c4386eSCy Schubert -o $bin \\ 1940e0c4386eSCy Schubert $objs \\ 1941e0c4386eSCy Schubert $linklibs\$(BIN_EX_LIBS) 1942e0c4386eSCy SchubertEOF 1943e0c4386eSCy Schubert } 1944e0c4386eSCy Schubert sub in2script { 1945e0c4386eSCy Schubert my %args = @_; 1946e0c4386eSCy Schubert my $script = $args{script}; 1947e0c4386eSCy Schubert my $sources = join(" ", @{$args{sources}}); 1948e0c4386eSCy Schubert my $dofile = abs2rel(rel2abs(catfile($config{sourcedir}, 1949e0c4386eSCy Schubert "util", "dofile.pl")), 1950e0c4386eSCy Schubert rel2abs($config{builddir})); 1951e0c4386eSCy Schubert return <<"EOF"; 1952e0c4386eSCy Schubert$script: $sources configdata.pm 1953e0c4386eSCy Schubert \$(RM) "$script" 1954e0c4386eSCy Schubert \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\ 1955e0c4386eSCy Schubert "-o$target{build_file}" $sources > "$script" 1956e0c4386eSCy Schubert chmod a+x $script 1957e0c4386eSCy SchubertEOF 1958e0c4386eSCy Schubert } 1959e0c4386eSCy Schubert sub generatedir { 1960e0c4386eSCy Schubert my %args = @_; 1961e0c4386eSCy Schubert my $dir = $args{dir}; 1962e0c4386eSCy Schubert my @deps = compute_platform_depends(@{$args{deps}}); 1963e0c4386eSCy Schubert my @comments = (); 1964e0c4386eSCy Schubert 1965e0c4386eSCy Schubert # We already have a 'test' target, and the top directory is just plain 1966e0c4386eSCy Schubert # silly 1967e0c4386eSCy Schubert return if $dir eq "test" || $dir eq "."; 1968e0c4386eSCy Schubert 1969e0c4386eSCy Schubert foreach my $type (("dso", "lib", "bin", "script")) { 1970e0c4386eSCy Schubert next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type}); 1971e0c4386eSCy Schubert # For lib object files, we could update the library. However, it 1972e0c4386eSCy Schubert # was decided that it's enough to build the directory local object 1973e0c4386eSCy Schubert # files, so we don't need to add any actions, and the dependencies 1974e0c4386eSCy Schubert # are already taken care of. 1975e0c4386eSCy Schubert if ($type ne "lib") { 1976e0c4386eSCy Schubert foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) { 1977e0c4386eSCy Schubert if (dirname($prod) eq $dir) { 1978e0c4386eSCy Schubert push @deps, compute_platform_depends($prod); 1979e0c4386eSCy Schubert } else { 1980e0c4386eSCy Schubert push @comments, "# No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}}); 1981e0c4386eSCy Schubert } 1982e0c4386eSCy Schubert } 1983e0c4386eSCy Schubert } 1984e0c4386eSCy Schubert } 1985e0c4386eSCy Schubert 1986e0c4386eSCy Schubert my $target = "$dir $dir/"; 1987e0c4386eSCy Schubert my $deps = join(" \\\n\t", 1988e0c4386eSCy Schubert fill_lines(' ', $COLUMNS - 8, @deps)); 1989e0c4386eSCy Schubert my $comments = join("\n", "", @comments); 1990e0c4386eSCy Schubert return <<"EOF"; 1991e0c4386eSCy Schubert$target: \\ 1992e0c4386eSCy Schubert $deps$comments 1993e0c4386eSCy SchubertEOF 1994e0c4386eSCy Schubert } 1995e0c4386eSCy Schubert "" # Important! This becomes part of the template result. 1996e0c4386eSCy Schubert-} 1997