2016-03-02 19:29:56 +08:00
|
|
|
##
|
|
|
|
## Makefile for OpenSSL
|
|
|
|
##
|
|
|
|
## {- join("\n## ", @autowarntext) -}
|
|
|
|
{-
|
|
|
|
our $objext = $target{obj_extension} || ".obj";
|
2017-12-04 21:27:58 +08:00
|
|
|
our $resext = $target{res_extension} || ".res";
|
2016-03-02 19:29:56 +08:00
|
|
|
our $depext = $target{dep_extension} || ".d";
|
2018-09-30 20:44:59 +08:00
|
|
|
our $defext = $target{dep_extension} || ".def";
|
2016-03-02 19:29:56 +08:00
|
|
|
our $exeext = $target{exe_extension} || ".exe";
|
|
|
|
our $libext = $target{lib_extension} || ".lib";
|
|
|
|
our $shlibext = $target{shared_extension} || ".dll";
|
|
|
|
our $shlibextimport = $target{shared_import_extension} || ".lib";
|
|
|
|
our $dsoext = $target{dso_extension} || ".dll";
|
|
|
|
|
2017-07-19 16:13:41 +08:00
|
|
|
(our $sover_dirname = $config{shlib_version_number}) =~ s|\.|_|g;
|
2016-07-07 00:37:52 +08:00
|
|
|
|
2018-03-04 05:26:45 +08:00
|
|
|
my $build_scheme = $target{build_scheme};
|
|
|
|
my $install_flavour = $build_scheme->[$#$build_scheme]; # last element
|
2016-03-17 17:08:25 +08:00
|
|
|
my $win_installenv =
|
2018-03-04 05:26:45 +08:00
|
|
|
$install_flavour eq "VC-WOW" ? "ProgramFiles(x86)"
|
|
|
|
: "ProgramW6432";
|
2016-03-17 17:08:25 +08:00
|
|
|
my $win_commonenv =
|
2018-03-04 05:26:45 +08:00
|
|
|
$install_flavour eq "VC-WOW" ? "CommonProgramFiles(x86)"
|
|
|
|
: "CommonProgramW6432";
|
2016-03-17 17:08:25 +08:00
|
|
|
our $win_installroot =
|
2018-03-04 05:26:45 +08:00
|
|
|
defined($ENV{$win_installenv}) ? $win_installenv : 'ProgramFiles';
|
2016-03-17 17:08:25 +08:00
|
|
|
our $win_commonroot =
|
2018-03-04 05:26:45 +08:00
|
|
|
defined($ENV{$win_commonenv}) ? $win_commonenv : 'CommonProgramFiles';
|
2016-05-06 18:45:50 +08:00
|
|
|
|
|
|
|
# expand variables early
|
|
|
|
$win_installroot = $ENV{$win_installroot};
|
|
|
|
$win_commonroot = $ENV{$win_commonroot};
|
2016-03-17 17:08:25 +08:00
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
sub shlib {
|
|
|
|
my $lib = shift;
|
2017-04-18 22:24:23 +08:00
|
|
|
return () if $disabled{shared} || $lib =~ /\.a$/;
|
|
|
|
return () unless defined $unified_info{sharednames}->{$lib};
|
2016-03-02 19:29:56 +08:00
|
|
|
return $unified_info{sharednames}->{$lib} . $shlibext;
|
|
|
|
}
|
|
|
|
|
2017-04-18 22:24:23 +08:00
|
|
|
sub lib {
|
|
|
|
(my $lib = shift) =~ s/\.a$//;
|
2018-10-25 21:55:15 +08:00
|
|
|
$lib .= '_static'
|
|
|
|
if (defined $unified_info{sharednames}->{$lib});
|
2017-04-18 22:24:23 +08:00
|
|
|
return $lib . $libext;
|
|
|
|
}
|
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
sub shlib_import {
|
|
|
|
my $lib = shift;
|
2017-04-18 22:24:23 +08:00
|
|
|
return () if $disabled{shared} || $lib =~ /\.a$/;
|
2016-03-02 19:29:56 +08:00
|
|
|
return $lib . $shlibextimport;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub dso {
|
|
|
|
my $dso = shift;
|
|
|
|
|
|
|
|
return $dso . $dsoext;
|
|
|
|
}
|
2017-04-22 21:06:35 +08:00
|
|
|
# This makes sure things get built in the order they need
|
|
|
|
# to. You're welcome.
|
|
|
|
sub dependmagic {
|
|
|
|
my $target = shift;
|
|
|
|
|
2018-02-08 05:40:32 +08:00
|
|
|
return "$target: build_generated\n\t\$(MAKE) /\$(MAKEFLAGS) depend && \$(MAKE) /\$(MAKEFLAGS) _$target\n_$target";
|
2017-04-22 21:06:35 +08:00
|
|
|
}
|
2016-03-02 19:29:56 +08:00
|
|
|
'';
|
|
|
|
-}
|
|
|
|
|
|
|
|
PLATFORM={- $config{target} -}
|
|
|
|
SRCDIR={- $config{sourcedir} -}
|
|
|
|
BLDDIR={- $config{builddir} -}
|
|
|
|
|
|
|
|
VERSION={- $config{version} -}
|
|
|
|
MAJOR={- $config{major} -}
|
|
|
|
MINOR={- $config{minor} -}
|
|
|
|
|
|
|
|
SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
|
|
|
|
|
2018-10-25 21:55:15 +08:00
|
|
|
LIBS={- join(" ", map { ( shlib_import($_), lib($_) ) } @{$unified_info{libraries}}) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
|
2016-05-13 00:08:21 +08:00
|
|
|
SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{libraries}}) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
|
2016-05-13 00:08:21 +08:00
|
|
|
ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{engines}}) -}
|
2017-06-08 14:02:26 +08:00
|
|
|
PROGRAMS={- our @PROGRAMS = map { $_.$exeext } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
|
2016-07-08 23:58:36 +08:00
|
|
|
PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
|
2016-03-19 07:05:25 +08:00
|
|
|
{- output_off() if $disabled{makedepend}; "" -}
|
2016-03-02 19:29:56 +08:00
|
|
|
DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
|
|
|
|
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
|
|
|
|
keys %{$unified_info{sources}}); -}
|
2016-03-19 07:05:25 +08:00
|
|
|
{- output_on() if $disabled{makedepend}; "" -}
|
2016-06-14 04:02:11 +08:00
|
|
|
GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
|
Configuration: Simplify generating list of generated files in build file templates
Computing the value of the GENERATED variable in the build file
templates is somewhat overcomplicated, and because of possible
duplication errors, changes are potentially error prone.
Looking more closely at how this list is determined, it can be
observed that the exact list of files to check is consistently
available in all the values found in the %unified_info tables
'depends', 'sources' and 'shared_sources', and all that's needed is to
filter those values so only those present as keys in the 'generate'
table are left.
This computation is also common for all build files, so due to its
apparent complexity, we move it to common0.tmpl, with the result left
in a global variable (@generated), to be consumed by all build file
templates.
common0.tmpl is included among the files to process when creating
build files, but unlike common.tmpl, it comes first of all.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5930)
2018-04-11 19:13:22 +08:00
|
|
|
GENERATED={- # common0.tmpl provides @generated
|
2018-09-30 20:44:59 +08:00
|
|
|
join(" ", map { my $x = $_;
|
|
|
|
$x =~ s|\.[sS]$|.asm|;
|
|
|
|
$x =~ s|\.ld$|$defext|;
|
|
|
|
$x }
|
Configuration: Simplify generating list of generated files in build file templates
Computing the value of the GENERATED variable in the build file
templates is somewhat overcomplicated, and because of possible
duplication errors, changes are potentially error prone.
Looking more closely at how this list is determined, it can be
observed that the exact list of files to check is consistently
available in all the values found in the %unified_info tables
'depends', 'sources' and 'shared_sources', and all that's needed is to
filter those values so only those present as keys in the 'generate'
table are left.
This computation is also common for all build files, so due to its
apparent complexity, we move it to common0.tmpl, with the result left
in a global variable (@generated), to be consumed by all build file
templates.
common0.tmpl is included among the files to process when creating
build files, but unlike common.tmpl, it comes first of all.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5930)
2018-04-11 19:13:22 +08:00
|
|
|
@generated) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2018-10-25 21:55:15 +08:00
|
|
|
INSTALL_LIBS={- join(" ", map { quotify1(shlib_import($_) or lib($_)) } @{$unified_info{install}->{libraries}}) -}
|
2018-08-01 21:26:13 +08:00
|
|
|
INSTALL_SHLIBS={- join(" ", map { quotify_l(shlib($_)) } @{$unified_info{install}->{libraries}}) -}
|
|
|
|
INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; quotify_l(shlib($_)) } @{$unified_info{install}->{libraries}}) -}
|
2018-07-05 21:38:28 +08:00
|
|
|
INSTALL_ENGINES={- join(" ", map { quotify1(dso($_)) } @{$unified_info{install}->{engines}}) -}
|
|
|
|
INSTALL_ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; quotify1(dso($_)) } @{$unified_info{install}->{engines}}) -}
|
|
|
|
INSTALL_PROGRAMS={- join(" ", map { quotify1($_.$exeext) } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
|
|
|
|
INSTALL_PROGRAMPDBS={- join(" ", map { quotify1($_.".pdb") } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
|
2016-07-08 20:52:09 +08:00
|
|
|
{- output_off() if $disabled{apps}; "" -}
|
2018-07-05 21:38:28 +08:00
|
|
|
BIN_SCRIPTS="$(BLDDIR)\tools\c_rehash.pl"
|
|
|
|
MISC_SCRIPTS="$(BLDDIR)\apps\CA.pl" "$(BLDDIR)\apps\tsget.pl"
|
2016-07-08 20:52:09 +08:00
|
|
|
{- output_on() if $disabled{apps}; "" -}
|
|
|
|
|
2017-06-16 01:31:01 +08:00
|
|
|
APPS_OPENSSL={- use File::Spec::Functions;
|
2018-07-05 21:38:28 +08:00
|
|
|
"\"".catfile("apps","openssl")."\"" -}
|
2017-06-16 01:31:01 +08:00
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
# Do not edit these manually. Use Configure with --prefix or --openssldir
|
|
|
|
# to change this! Short explanation in the top comment in Configure
|
2016-06-28 19:20:21 +08:00
|
|
|
INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
|
|
|
|
#
|
|
|
|
use File::Spec::Functions qw(:DEFAULT splitpath);
|
2017-10-04 15:42:23 +08:00
|
|
|
our $prefix = canonpath($config{prefix}
|
|
|
|
|| "$win_installroot\\OpenSSL");
|
2016-06-28 19:20:21 +08:00
|
|
|
our ($prefix_dev, $prefix_dir, $prefix_file) =
|
2016-06-30 06:10:21 +08:00
|
|
|
splitpath($prefix, 1);
|
2016-06-28 19:20:21 +08:00
|
|
|
$prefix_dev -}
|
2017-10-04 15:42:23 +08:00
|
|
|
INSTALLTOP_dir={- canonpath($prefix_dir) -}
|
2016-06-28 19:20:21 +08:00
|
|
|
OPENSSLDIR_dev={- #
|
|
|
|
# The logic here is that if no --openssldir was given,
|
2017-06-11 19:10:15 +08:00
|
|
|
# OPENSSLDIR will get the value "$win_commonroot\\SSL".
|
2016-06-28 19:20:21 +08:00
|
|
|
# If --openssldir was given and the value is an absolute
|
|
|
|
# path, OPENSSLDIR will get its value without change.
|
|
|
|
# If the value from --openssldir is a relative path,
|
|
|
|
# OPENSSLDIR will get $prefix with the --openssldir
|
|
|
|
# value appended as a subdirectory.
|
|
|
|
#
|
|
|
|
use File::Spec::Functions qw(:DEFAULT splitpath);
|
2016-07-07 01:43:59 +08:00
|
|
|
our $openssldir =
|
2016-06-28 19:20:21 +08:00
|
|
|
$config{openssldir} ?
|
|
|
|
(file_name_is_absolute($config{openssldir}) ?
|
2017-10-04 15:42:23 +08:00
|
|
|
canonpath($config{openssldir})
|
2016-06-28 19:20:21 +08:00
|
|
|
: catdir($prefix, $config{openssldir}))
|
2017-10-04 15:42:23 +08:00
|
|
|
: canonpath("$win_commonroot\\SSL");
|
2016-06-28 19:20:21 +08:00
|
|
|
our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
|
|
|
|
splitpath($openssldir, 1);
|
|
|
|
$openssldir_dev -}
|
2017-10-04 15:42:23 +08:00
|
|
|
OPENSSLDIR_dir={- canonpath($openssldir_dir) -}
|
2016-03-17 17:08:25 +08:00
|
|
|
LIBDIR={- our $libdir = $config{libdir} || "lib";
|
2018-02-23 19:10:42 +08:00
|
|
|
file_name_is_absolute($libdir) ? "" : $libdir -}
|
2016-06-28 19:20:21 +08:00
|
|
|
ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath);
|
2017-07-19 16:13:41 +08:00
|
|
|
our $enginesdir = catdir($prefix,$libdir,"engines-$sover_dirname");
|
2016-06-28 19:20:21 +08:00
|
|
|
our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
|
|
|
|
splitpath($enginesdir, 1);
|
|
|
|
$enginesdir_dev -}
|
2017-10-04 15:42:23 +08:00
|
|
|
ENGINESDIR_dir={- canonpath($enginesdir_dir) -}
|
2016-06-28 19:20:21 +08:00
|
|
|
!IF "$(DESTDIR)" != ""
|
|
|
|
INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
|
|
|
|
OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
|
|
|
|
ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
|
|
|
|
!ELSE
|
|
|
|
INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
|
|
|
|
OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
|
|
|
|
ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
|
|
|
|
!ENDIF
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2018-02-23 19:10:42 +08:00
|
|
|
# $(libdir) is chosen to be compatible with the GNU coding standards
|
|
|
|
libdir={- file_name_is_absolute($libdir)
|
|
|
|
? $libdir : '$(INSTALLTOP)\$(LIBDIR)' -}
|
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
##### User defined commands and flags ################################
|
|
|
|
|
|
|
|
CC={- $config{CC} -}
|
|
|
|
CPP={- $config{CPP} -}
|
|
|
|
CPPFLAGS={- our $cppflags1 = join(" ",
|
|
|
|
(map { "-D".$_} @{$config{CPPDEFINES}}),
|
|
|
|
(map { " /I ".$_} @{$config{CPPINCLUDES}}),
|
|
|
|
@{$config{CPPFLAGS}}) -}
|
|
|
|
CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
|
|
|
|
LD={- $config{LD} -}
|
|
|
|
LDFLAGS={- join(' ', @{$config{LDFLAGS}}) -}
|
|
|
|
EX_LIBS={- join(' ', @{$config{LDLIBS}}) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2018-07-08 18:00:06 +08:00
|
|
|
PERL={- $config{PERL} -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
AR={- $config{AR} -}
|
|
|
|
ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
|
|
|
|
|
|
|
|
MT={- $config{MT} -}
|
|
|
|
MTFLAGS= {- join(' ', @{$config{MTFLAGS}}) -}
|
|
|
|
|
|
|
|
AS={- $config{AS} -}
|
|
|
|
ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
RC={- $config{RC} -}
|
2016-07-14 15:23:36 +08:00
|
|
|
|
2018-07-10 20:12:33 +08:00
|
|
|
ECHO="$(PERL)" "$(SRCDIR)\util\echo.pl"
|
|
|
|
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
##### Special command flags ##########################################
|
|
|
|
|
|
|
|
COUTFLAG={- $target{coutflag} -}$(OSSL_EMPTY)
|
|
|
|
LDOUTFLAG={- $target{ldoutflag} -}$(OSSL_EMPTY)
|
|
|
|
AROUTFLAG={- $target{aroutflag} -}$(OSSL_EMPTY)
|
|
|
|
MTINFLAG={- $target{mtinflag} -}$(OSSL_EMPTY)
|
|
|
|
MTOUTFLAG={- $target{mtoutflag} -}$(OSSL_EMPTY)
|
2016-07-15 18:57:27 +08:00
|
|
|
ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
RCOUTFLAG={- $target{rcoutflag} -}$(OSSL_EMPTY)
|
|
|
|
|
|
|
|
##### Project flags ##################################################
|
|
|
|
|
|
|
|
# Variables starting with CNF_ are common variables for all product types
|
|
|
|
|
|
|
|
CNF_ASFLAGS={- join(' ', $target{asflags} || (),
|
|
|
|
@{$config{asflags}}) -}
|
|
|
|
CNF_CPPFLAGS={- our $cppfags2 =
|
|
|
|
join(' ', $target{cppflags} || (),
|
2018-04-01 23:41:16 +08:00
|
|
|
(map { '-D'.quotify1($_) } @{$target{defines}},
|
|
|
|
@{$config{defines}}),
|
|
|
|
(map { '-I'.quotify1($_) } @{$target{includes}},
|
|
|
|
@{$config{includes}}),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
@{$config{cppflags}}) -}
|
|
|
|
CNF_CFLAGS={- join(' ', $target{cflags} || (),
|
|
|
|
@{$config{cflags}}) -}
|
|
|
|
CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
|
|
|
|
@{$config{cxxflags}}) -}
|
|
|
|
CNF_LDFLAGS={- join(' ', $target{lflags} || (),
|
|
|
|
@{$config{lflags}}) -}
|
|
|
|
CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
|
|
|
|
@{$config{ex_libs}}) -}
|
|
|
|
|
|
|
|
# Variables starting with LIB_ are used to build library object files
|
|
|
|
# and shared libraries.
|
|
|
|
# Variables starting with DSO_ are used to build DSOs and their object files.
|
|
|
|
# Variables starting with BIN_ are used to build programs and their object
|
|
|
|
# files.
|
|
|
|
|
|
|
|
LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
|
|
|
|
@{$config{lib_asflags}},
|
|
|
|
'$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
|
2018-03-09 19:39:01 +08:00
|
|
|
LIB_CPPFLAGS={- our $lib_cppflags =
|
|
|
|
join(' ', $target{lib_cppflags} || (),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
$target{shared_cppflag} || (),
|
2018-04-01 23:41:16 +08:00
|
|
|
(map { '-D'.quotify1($_) }
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
@{$target{lib_defines}},
|
|
|
|
@{$target{shared_defines}},
|
|
|
|
@{$config{lib_defines}},
|
2018-03-09 19:39:01 +08:00
|
|
|
@{$config{shared_defines}}),
|
2018-04-01 23:41:16 +08:00
|
|
|
(map { '-I'.quotify1($_) }
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
@{$target{lib_includes}},
|
|
|
|
@{$target{shared_includes}},
|
|
|
|
@{$config{lib_includes}},
|
|
|
|
@{$config{shared_includes}}),
|
|
|
|
@{$config{lib_cppflags}},
|
2018-03-09 19:39:01 +08:00
|
|
|
@{$config{shared_cppflag}});
|
|
|
|
join(' ', $lib_cppflags,
|
2018-04-01 23:41:16 +08:00
|
|
|
(map { '-D'.quotify1($_) }
|
2018-03-09 19:39:01 +08:00
|
|
|
"OPENSSLDIR=\"$openssldir\"",
|
|
|
|
"ENGINESDIR=\"$enginesdir\""),
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
'$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
|
|
|
|
LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
|
|
|
|
$target{shared_cflag} || (),
|
|
|
|
@{$config{lib_cflags}},
|
|
|
|
@{$config{shared_cflag}},
|
|
|
|
'$(CNF_CFLAGS)', '$(CFLAGS)') -}
|
|
|
|
LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
|
|
|
|
$config{shared_ldflag} || (),
|
|
|
|
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
|
|
|
|
LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
|
|
|
|
DSO_ASFLAGS={- join(' ', $target{dso_asflags} || (),
|
|
|
|
$target{module_asflags} || (),
|
|
|
|
@{$config{dso_asflags}},
|
|
|
|
@{$config{module_asflags}},
|
|
|
|
'$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
|
|
|
|
DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
|
|
|
|
$target{module_cppflags} || (),
|
|
|
|
@{$config{dso_cppflags}},
|
|
|
|
@{$config{module_cppflags}},
|
|
|
|
'$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
|
|
|
|
DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
|
|
|
|
$target{module_cflags} || (),
|
|
|
|
@{$config{dso_cflags}},
|
|
|
|
@{$config{module_cflags}},
|
|
|
|
'$(CNF_CFLAGS)', '$(CFLAGS)') -}
|
|
|
|
DSO_LDFLAGS={- join(' ', $target{dso_lflags} || (),
|
|
|
|
$target{module_ldflags} || (),
|
|
|
|
@{$config{dso_lflags}},
|
|
|
|
@{$config{module_ldflags}},
|
|
|
|
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
|
|
|
|
DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
|
|
|
|
BIN_ASFLAGS={- join(' ', $target{bin_asflags} || (),
|
|
|
|
@{$config{bin_asflags}},
|
|
|
|
'$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
|
|
|
|
BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
|
|
|
|
@{$config{bin_cppflags}},
|
|
|
|
'$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
|
|
|
|
BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
|
|
|
|
@{$config{bin_cflags}},
|
|
|
|
'$(CNF_CFLAGS)', '$(CFLAGS)') -}
|
|
|
|
BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
|
|
|
|
@{$config{bin_lflags}},
|
|
|
|
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
|
|
|
|
BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
|
|
|
|
|
|
|
|
# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
|
|
|
|
CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
|
|
|
|
$cppflags2 =~ s|([\\"])|\\$1|g;
|
2018-03-09 19:39:01 +08:00
|
|
|
join(' ', $lib_cppflags || (), $cppflags2 || (),
|
|
|
|
$cppflags1 || ()) -}
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
PERLASM_SCHEME= {- $target{perlasm_scheme} -}
|
|
|
|
|
|
|
|
PROCESSOR= {- $config{processor} -}
|
|
|
|
|
|
|
|
# The main targets ###################################################
|
|
|
|
|
2017-04-22 21:06:35 +08:00
|
|
|
{- dependmagic('all'); -}: build_libs_nodep build_engines_nodep build_programs_nodep
|
|
|
|
{- dependmagic('build_libs'); -}: build_libs_nodep
|
|
|
|
{- dependmagic('build_engines'); -}: build_engines_nodep
|
|
|
|
{- dependmagic('build_programs'); -}: build_programs_nodep
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2017-04-22 21:06:35 +08:00
|
|
|
build_generated: $(GENERATED_MANDATORY)
|
2016-07-06 09:07:16 +08:00
|
|
|
build_libs_nodep: $(LIBS) {- join(" ",map { shlib_import($_) } @{$unified_info{libraries}}) -}
|
2016-03-02 19:29:56 +08:00
|
|
|
build_engines_nodep: $(ENGINES)
|
2016-07-08 23:58:36 +08:00
|
|
|
build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2016-07-08 23:58:36 +08:00
|
|
|
# Kept around for backward compatibility
|
|
|
|
build_apps build_tests: build_programs
|
|
|
|
|
2017-06-16 09:46:41 +08:00
|
|
|
# Convenience target to prebuild all generated files, not just the mandatory
|
|
|
|
# ones
|
|
|
|
build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- output_off() if $disabled{makedepend}; "" -}
|
2018-07-10 20:12:33 +08:00
|
|
|
@$(ECHO) "Warning: consider configuring with no-makedepend, because if"
|
|
|
|
@$(ECHO) " target system doesn't have $(PERL),"
|
|
|
|
@$(ECHO) " then make will fail..."
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- output_on() if $disabled{makedepend}; "" -}
|
2017-06-16 09:46:41 +08:00
|
|
|
|
2016-04-18 20:09:36 +08:00
|
|
|
test: tests
|
2017-04-22 21:06:35 +08:00
|
|
|
{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- output_off() if $disabled{tests}; "" -}
|
2017-10-09 23:57:13 +08:00
|
|
|
-mkdir $(BLDDIR)\test\test-runs
|
2016-03-02 19:29:56 +08:00
|
|
|
set SRCTOP=$(SRCDIR)
|
|
|
|
set BLDTOP=$(BLDDIR)
|
2017-10-09 23:57:13 +08:00
|
|
|
set RESULT_D=$(BLDDIR)\test\test-runs
|
2016-03-02 19:29:56 +08:00
|
|
|
set PERL=$(PERL)
|
2018-01-19 15:24:29 +08:00
|
|
|
set OPENSSL_ENGINES=$(MAKEDIR)\engines
|
2016-11-04 00:08:10 +08:00
|
|
|
set OPENSSL_DEBUG_MEMORY=on
|
2016-05-25 17:58:19 +08:00
|
|
|
"$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
2018-07-10 20:12:33 +08:00
|
|
|
@$(ECHO) "Tests are not supported with your chosen Configure options"
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- output_on() if !$disabled{tests}; "" -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
|
|
|
list-tests:
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- output_off() if $disabled{tests}; "" -}
|
2016-06-17 06:23:43 +08:00
|
|
|
@set SRCTOP=$(SRCDIR)
|
2016-05-25 17:58:19 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
2018-07-10 20:12:33 +08:00
|
|
|
@$(ECHO) "Tests are not supported with your chosen Configure options"
|
2018-07-11 17:05:15 +08:00
|
|
|
@{- output_on() if !$disabled{tests}; "" -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2016-03-17 17:08:25 +08:00
|
|
|
install: install_sw install_ssldirs install_docs
|
|
|
|
|
|
|
|
uninstall: uninstall_docs uninstall_sw
|
|
|
|
|
2016-03-10 08:51:53 +08:00
|
|
|
libclean:
|
2018-03-23 05:55:35 +08:00
|
|
|
"$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """{.,apps,test,fuzz}/$$1.*"""; } @ARGV" $(SHLIBS)
|
|
|
|
-del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb
|
2016-03-10 08:51:53 +08:00
|
|
|
|
|
|
|
clean: libclean
|
2017-06-08 14:02:26 +08:00
|
|
|
{- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
|
|
|
|
-del /Q /F $(ENGINES)
|
|
|
|
-del /Q /F $(SCRIPTS)
|
2018-04-15 18:07:17 +08:00
|
|
|
-del /Q /F $(GENERATED_MANDATORY)
|
2016-06-17 06:23:43 +08:00
|
|
|
-del /Q /F $(GENERATED)
|
2018-05-06 23:34:04 +08:00
|
|
|
-del /Q /S /F *.d *.obj *.pdb *.ilk *.manifest
|
|
|
|
-del /Q /S /F engines\*.lib engines\*.exp
|
|
|
|
-del /Q /S /F apps\*.lib apps\*.rc apps\*.res apps\*.exp
|
|
|
|
-del /Q /S /F test\*.exp
|
2018-04-15 18:07:17 +08:00
|
|
|
-rmdir /Q /S test\test-runs
|
2016-03-10 08:51:53 +08:00
|
|
|
|
2016-06-14 04:02:11 +08:00
|
|
|
distclean: clean
|
|
|
|
-del /Q /F configdata.pm
|
|
|
|
-del /Q /F makefile
|
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
depend:
|
2018-07-11 17:05:15 +08:00
|
|
|
@ {- output_off() if $disabled{makedepend}; "" -}
|
2018-03-16 01:06:18 +08:00
|
|
|
@ "$(PERL)" "$(SRCDIR)\util\add-depends.pl" "VC"
|
2018-07-11 17:05:15 +08:00
|
|
|
@ {- output_on() if $disabled{makedepend}; "" -}
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2016-03-17 17:08:25 +08:00
|
|
|
# Install helper targets #############################################
|
|
|
|
|
|
|
|
install_sw: all install_dev install_engines install_runtime
|
|
|
|
|
|
|
|
uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
|
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
install_docs: install_html_docs
|
2016-03-17 17:08:25 +08:00
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
uninstall_docs: uninstall_html_docs
|
2016-03-17 17:08:25 +08:00
|
|
|
|
|
|
|
install_ssldirs:
|
2016-06-28 19:20:21 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
|
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
|
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
|
2016-05-25 17:58:19 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
|
2016-08-02 05:18:25 +08:00
|
|
|
"$(OPENSSLDIR)\openssl.cnf.dist"
|
|
|
|
@IF NOT EXIST "$(OPENSSLDIR)\openssl.cnf" \
|
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
|
|
|
|
"$(OPENSSLDIR)\openssl.cnf"
|
2016-05-25 17:58:19 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(OPENSSLDIR)\misc"
|
2016-09-10 06:05:41 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
|
|
|
|
"$(OPENSSLDIR)\ct_log_list.cnf.dist"
|
|
|
|
@IF NOT EXIST "$(OPENSSLDIR)\ct_log_list.cnf" \
|
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
|
|
|
|
"$(OPENSSLDIR)\ct_log_list.cnf"
|
2016-03-17 17:08:25 +08:00
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
install_dev: install_runtime_libs
|
2018-07-10 20:12:33 +08:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
|
|
|
@$(ECHO) "*** Installing development files"
|
2016-06-28 19:20:21 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
|
2018-10-15 23:38:26 +08:00
|
|
|
@{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2016-07-15 03:11:46 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
|
|
|
|
"$(INSTALLTOP)\include\openssl"
|
2018-10-15 23:38:26 +08:00
|
|
|
@{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2018-05-19 13:09:19 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \
|
|
|
|
"$(SRCDIR)\include\openssl\*.h" \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(INSTALLTOP)\include\openssl"
|
2018-07-05 21:38:28 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(BLDDIR)\include\openssl\*.h" \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(INSTALLTOP)\include\openssl"
|
2018-02-23 19:10:42 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)"
|
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)"
|
2016-05-13 00:08:21 +08:00
|
|
|
@if "$(SHLIBS)"=="" \
|
2018-02-23 19:10:42 +08:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)"
|
2016-03-17 17:08:25 +08:00
|
|
|
|
|
|
|
uninstall_dev:
|
|
|
|
|
|
|
|
install_engines:
|
2018-07-10 20:12:33 +08:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
|
|
|
@$(ECHO) "*** Installing engines"
|
2016-06-28 19:20:21 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
|
2016-03-17 17:08:25 +08:00
|
|
|
@if not "$(ENGINES)"=="" \
|
2016-07-08 20:52:09 +08:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
|
2016-05-13 00:08:21 +08:00
|
|
|
@if not "$(ENGINES)"=="" \
|
2016-07-08 20:52:09 +08:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
|
2016-03-17 17:08:25 +08:00
|
|
|
|
|
|
|
uninstall_engines:
|
|
|
|
|
2018-10-25 15:09:20 +08:00
|
|
|
install_runtime: install_programs
|
|
|
|
|
|
|
|
install_runtime_libs:
|
2018-07-10 20:12:33 +08:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
2018-10-25 15:09:20 +08:00
|
|
|
@$(ECHO) "*** Installing runtime libraries"
|
2016-06-28 19:20:21 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
|
2016-03-17 17:08:25 +08:00
|
|
|
@if not "$(SHLIBS)"=="" \
|
2016-07-08 20:52:09 +08:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
|
2016-05-13 00:08:21 +08:00
|
|
|
@if not "$(SHLIBS)"=="" \
|
2016-07-08 20:52:09 +08:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(INSTALLTOP)\bin"
|
2018-10-25 15:09:20 +08:00
|
|
|
|
|
|
|
install_programs: install_runtime_libs
|
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
|
|
|
@$(ECHO) "*** Installing runtime programs"
|
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
|
2016-07-08 20:52:09 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-07-08 20:52:09 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-05-25 17:58:19 +08:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
|
2016-06-28 19:20:21 +08:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-03-17 17:08:25 +08:00
|
|
|
|
|
|
|
uninstall_runtime:
|
|
|
|
|
2016-06-17 06:23:43 +08:00
|
|
|
install_html_docs:
|
|
|
|
"$(PERL)" "$(SRCDIR)\util\process_docs.pl" \
|
2016-06-28 19:20:21 +08:00
|
|
|
"--destdir=$(INSTALLTOP)\html" --type=html
|
2016-06-17 06:23:43 +08:00
|
|
|
|
|
|
|
uninstall_html_docs:
|
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
# Building targets ###################################################
|
|
|
|
|
2016-09-18 02:50:56 +08:00
|
|
|
configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
|
2018-07-10 20:12:33 +08:00
|
|
|
@$(ECHO) "Detected changed: $?"
|
2018-02-03 03:33:13 +08:00
|
|
|
"$(PERL)" configdata.pm -r
|
2018-07-10 20:12:33 +08:00
|
|
|
@$(ECHO) "**************************************************"
|
|
|
|
@$(ECHO) "*** ***"
|
|
|
|
@$(ECHO) "*** Please run the same make command again ***"
|
|
|
|
@$(ECHO) "*** ***"
|
|
|
|
@$(ECHO) "**************************************************"
|
2016-03-24 03:33:29 +08:00
|
|
|
@exit 1
|
2016-03-02 19:29:56 +08:00
|
|
|
|
2018-01-30 06:17:43 +08:00
|
|
|
reconfigure reconf:
|
2018-02-03 03:33:13 +08:00
|
|
|
"$(PERL)" configdata.pm -r
|
2018-01-30 06:17:43 +08:00
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
{-
|
|
|
|
use File::Basename;
|
|
|
|
use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
|
|
|
|
|
|
|
|
# Helper function to figure out dependencies on libraries
|
|
|
|
# It takes a list of library names and outputs a list of dependencies
|
|
|
|
sub compute_lib_depends {
|
|
|
|
if ($disabled{shared}) {
|
2017-04-18 22:24:23 +08:00
|
|
|
return map { lib($_) } @_;
|
2016-03-02 19:29:56 +08:00
|
|
|
}
|
2017-04-18 22:24:23 +08:00
|
|
|
return map { shlib_import($_) or lib($_) } @_;
|
2016-03-02 19:29:56 +08:00
|
|
|
}
|
|
|
|
|
2016-03-07 21:12:45 +08:00
|
|
|
sub generatesrc {
|
|
|
|
my %args = @_;
|
2018-03-04 06:07:14 +08:00
|
|
|
my ($gen0, @gens) = @{$args{generator}};
|
|
|
|
my $generator = '"'.$gen0.'"'.join('', map { " $_" } @gens);
|
2016-05-25 17:58:19 +08:00
|
|
|
my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
|
|
|
|
my $incs = join("", map { " /I \"$_\"" } @{$args{incs}});
|
2016-10-14 23:10:05 +08:00
|
|
|
my $defs = join("", map { " /D".$_ } @{$args{defs}});
|
2016-05-25 17:58:19 +08:00
|
|
|
my $deps = @{$args{deps}} ?
|
|
|
|
'"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
|
2016-03-07 21:12:45 +08:00
|
|
|
|
2018-09-30 20:44:59 +08:00
|
|
|
if ($args{src} =~ /\.ld$/) {
|
|
|
|
(my $target = $args{src}) =~ s/\.ld$/$defext/;
|
|
|
|
my $mkdef = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "mkdef.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
2018-10-04 23:41:12 +08:00
|
|
|
my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
|
|
|
|
my $ord_name =
|
|
|
|
$args{generator}->[1] || basename($args{product}, $dsoext);
|
2018-09-30 20:44:59 +08:00
|
|
|
return <<"EOF";
|
2018-10-04 23:41:12 +08:00
|
|
|
$target: $args{generator}->[0] $deps $mkdef
|
|
|
|
\$(PERL) $mkdef$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS windows > $target
|
2018-09-30 20:44:59 +08:00
|
|
|
EOF
|
|
|
|
} elsif ($args{src} !~ /\.[sS]$/) {
|
|
|
|
my $target = $args{src};
|
2016-06-14 04:02:11 +08:00
|
|
|
if ($args{generator}->[0] =~ m|^.*\.in$|) {
|
|
|
|
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "dofile.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
|
|
|
return <<"EOF";
|
|
|
|
$target: "$args{generator}->[0]" $deps
|
|
|
|
"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
|
|
|
"-o$target{build_file}" $generator > \$@
|
|
|
|
EOF
|
|
|
|
} else {
|
|
|
|
return <<"EOF";
|
2016-05-25 17:58:19 +08:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
|
|
|
"\$(PERL)"$generator_incs $generator > \$@
|
2016-03-07 21:12:45 +08:00
|
|
|
EOF
|
2016-06-14 04:02:11 +08:00
|
|
|
}
|
2016-03-07 21:12:45 +08:00
|
|
|
} else {
|
2018-09-30 20:44:59 +08:00
|
|
|
(my $target = $args{src}) =~ s/\.[sS]$/.asm/;
|
2016-03-07 21:12:45 +08:00
|
|
|
if ($args{generator}->[0] =~ /\.pl$/) {
|
2016-05-25 17:58:19 +08:00
|
|
|
$generator = '"$(PERL)"'.$generator_incs.' '.$generator;
|
2016-03-07 21:12:45 +08:00
|
|
|
} elsif ($args{generator}->[0] =~ /\.S$/) {
|
|
|
|
$generator = undef;
|
|
|
|
} else {
|
|
|
|
die "Generator type for $src unknown: $generator\n";
|
|
|
|
}
|
|
|
|
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-14 03:32:42 +08:00
|
|
|
my $cppflags = $incs;
|
2018-02-22 23:33:58 +08:00
|
|
|
$cppflags .= {
|
2018-09-10 08:28:39 +08:00
|
|
|
shlib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
2018-02-22 23:33:58 +08:00
|
|
|
lib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => ' $(DSO_CFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => ' $(BIN_CFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
2016-03-07 21:12:45 +08:00
|
|
|
if (defined($generator)) {
|
|
|
|
# If the target is named foo.S in build.info, we want to
|
|
|
|
# end up generating foo.s in two steps.
|
|
|
|
if ($args{src} =~ /\.S$/) {
|
|
|
|
return <<"EOF";
|
2016-05-25 17:58:19 +08:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
2016-03-07 21:12:45 +08:00
|
|
|
set ASM=\$(AS)
|
|
|
|
$generator \$@.S
|
2016-10-14 23:10:05 +08:00
|
|
|
\$(CPP) $cppflags $defs \$@.S > \$@.i && move /Y \$@.i \$@
|
2016-03-07 21:12:45 +08:00
|
|
|
del /Q \$@.S
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
# Otherwise....
|
|
|
|
return <<"EOF";
|
2016-05-25 17:58:19 +08:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
2016-03-07 21:12:45 +08:00
|
|
|
set ASM=\$(AS)
|
|
|
|
$generator \$@
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
return <<"EOF";
|
2016-05-25 17:58:19 +08:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
2016-10-14 23:10:05 +08:00
|
|
|
\$(CPP) $incs $cppflags $defs "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
|
2016-03-07 21:12:45 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-02 19:29:56 +08:00
|
|
|
sub src2obj {
|
|
|
|
my %args = @_;
|
2016-03-24 03:33:29 +08:00
|
|
|
my @srcs = map { (my $x = $_) =~ s/\.s$/.asm/; $x
|
|
|
|
} ( @{$args{srcs}} );
|
2016-05-25 17:58:19 +08:00
|
|
|
my $srcs = '"'.join('" "', @srcs).'"';
|
|
|
|
my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
|
|
|
|
my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
|
2016-10-14 23:10:05 +08:00
|
|
|
my $defs = join("", map { " /D".$_ } @{$args{defs}});
|
2018-09-10 08:28:39 +08:00
|
|
|
my $cflags = { shlib => ' $(LIB_CFLAGS)',
|
|
|
|
lib => ' $(LIB_CFLAGS)',
|
Harmonize the make variables across all known platforms families
The make variables LIB_CFLAGS, DSO_CFLAGS and so on were used in
addition to CFLAGS and so on. This works without problem on Unix and
Windows, where options with different purposes (such as -D and -I) can
appear anywhere on the command line and get accumulated as they come.
This is not necessarely so on VMS. For example, macros must all be
collected and given through one /DEFINE, and the same goes for
inclusion directories (/INCLUDE).
So, to harmonize all platforms, we repurpose make variables starting
with LIB_, DSO_ and BIN_ to be all encompassing variables that
collects the corresponding values from CFLAGS, CPPFLAGS, DEFINES,
INCLUDES and so on together with possible config target values
specific for libraries DSOs and programs, and use them instead of the
general ones everywhere.
This will, for example, allow VMS to use the exact same generators for
generated files that go through cpp as all other platforms, something
that has been impossible to do safely before now.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5357)
2018-02-14 03:32:42 +08:00
|
|
|
dso => ' $(DSO_CFLAGS)',
|
|
|
|
bin => ' $(BIN_CFLAGS)' } -> {$args{intent}};
|
2018-01-23 20:54:55 +08:00
|
|
|
$cflags .= $incs;
|
2018-09-10 08:28:39 +08:00
|
|
|
$cflags .= { shlib => ' $(LIB_CPPFLAGS)',
|
|
|
|
lib => ' $(LIB_CPPFLAGS)',
|
2018-01-23 20:54:55 +08:00
|
|
|
dso => ' $(DSO_CPPFLAGS)',
|
|
|
|
bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}};
|
2018-09-10 08:28:39 +08:00
|
|
|
my $asflags = { shlib => ' $(LIB_ASFLAGS)',
|
|
|
|
lib => ' $(LIB_ASFLAGS)',
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
dso => ' $(DSO_ASFLAGS)',
|
|
|
|
bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
|
2016-03-02 19:29:56 +08:00
|
|
|
my $makedepprog = $config{makedepprog};
|
2017-12-04 21:27:58 +08:00
|
|
|
if ($srcs[0] =~ /\.rc$/) {
|
|
|
|
return <<"EOF";
|
|
|
|
$args{obj}: $deps
|
|
|
|
\$(RC) \$(RCOUTFLAG)\$\@ $srcs
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
(my $obj = $args{obj}) =~ s|\.o$||;
|
2016-03-02 19:29:56 +08:00
|
|
|
if ($srcs[0] =~ /\.asm$/) {
|
|
|
|
return <<"EOF";
|
|
|
|
$obj$objext: $deps
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
\$(AS) $asflags \$(ASOUTFLAG)\$\@ $srcs
|
2018-04-11 16:11:07 +08:00
|
|
|
EOF
|
|
|
|
} elsif ($srcs[0] =~ /.S$/) {
|
|
|
|
return <<"EOF";
|
|
|
|
$obj$objext: $deps
|
2016-10-14 23:10:05 +08:00
|
|
|
\$(CC) /EP /D__ASSEMBLER__ $cflags $defs $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
|
2016-03-02 19:29:56 +08:00
|
|
|
EOF
|
|
|
|
}
|
2018-10-23 16:35:48 +08:00
|
|
|
my $recipe = <<"EOF";
|
2016-03-19 07:05:25 +08:00
|
|
|
$obj$objext: $deps
|
2016-10-14 23:10:05 +08:00
|
|
|
\$(CC) $cflags $defs -c \$(COUTFLAG)\$\@ $srcs
|
2016-03-02 19:29:56 +08:00
|
|
|
EOF
|
2018-10-23 16:35:48 +08:00
|
|
|
$recipe .= <<"EOF" unless $disabled{makedepend};
|
2016-10-14 23:10:05 +08:00
|
|
|
\$(CC) $cflags $defs /Zs /showIncludes $srcs 2>&1 > $obj$depext
|
2018-10-23 16:35:48 +08:00
|
|
|
EOF
|
|
|
|
return $recipe;
|
2016-03-02 19:29:56 +08:00
|
|
|
}
|
|
|
|
|
2018-10-21 17:03:02 +08:00
|
|
|
# We *know* this routine is only called when we've configure 'shared'.
|
|
|
|
# Also, note that even though the import library built here looks like
|
|
|
|
# a static library, it really isn't.
|
2018-09-12 16:59:06 +08:00
|
|
|
sub obj2shlib {
|
2016-03-02 19:29:56 +08:00
|
|
|
my %args = @_;
|
|
|
|
my $lib = $args{lib};
|
2017-12-04 21:27:58 +08:00
|
|
|
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x }
|
2018-01-15 05:39:20 +08:00
|
|
|
grep { $_ =~ m/\.(?:o|res)$/ }
|
2017-12-04 21:27:58 +08:00
|
|
|
@{$args{objs}};
|
2018-09-30 20:44:59 +08:00
|
|
|
my @defs = map { (my $x = $_) =~ s|\.ld$||; "$x$defext" }
|
|
|
|
grep { $_ =~ /\.ld$/ }
|
|
|
|
@{$args{objs}};
|
2017-12-04 21:27:58 +08:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
die "More than one exported symbols list" if scalar @defs > 1;
|
|
|
|
my $linklibs = join("", map { "$_\n" } @deps);
|
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $deps = join(" ", @objs, @defs, @deps);
|
2018-10-21 17:03:02 +08:00
|
|
|
my $import = shlib_import($lib);
|
|
|
|
my $dll = shlib($lib);
|
2017-12-04 21:27:58 +08:00
|
|
|
my $shared_def = join("", map { " /def:$_" } @defs);
|
2016-03-02 19:29:56 +08:00
|
|
|
return <<"EOF"
|
2018-10-21 17:03:02 +08:00
|
|
|
# The import library may look like a static library, but it is not.
|
|
|
|
# We MUST make the import library depend on the DLL, in case someone
|
|
|
|
# mistakenly removes the latter.
|
|
|
|
$import: $dll
|
|
|
|
$dll: $deps
|
|
|
|
IF EXIST $full.manifest DEL /F /Q $full.manifest
|
2018-05-14 23:06:04 +08:00
|
|
|
IF EXIST \$@ DEL /F /Q \$@
|
2016-03-12 16:38:20 +08:00
|
|
|
\$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
|
2018-10-21 17:03:02 +08:00
|
|
|
/implib:$import \$(LDOUTFLAG)$dll$shared_def @<< || (DEL /Q \$(\@B).* $import && EXIT 1)
|
2017-12-04 21:27:58 +08:00
|
|
|
$objs
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
$linklibs\$(LIB_EX_LIBS)
|
2016-03-02 19:29:56 +08:00
|
|
|
<<
|
2018-10-21 17:03:02 +08:00
|
|
|
IF EXIST $dll.manifest \\
|
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$dll.manifest \$(MTOUTFLAG)$dll
|
|
|
|
IF EXIST apps\\$dll DEL /Q /F apps\\$dll
|
|
|
|
IF EXIST test\\$dll DEL /Q /F test\\$dll
|
|
|
|
IF EXIST fuzz\\$dll DEL /Q /F fuzz\\$dll
|
|
|
|
COPY $dll apps
|
|
|
|
COPY $dll test
|
|
|
|
COPY $dll fuzz
|
2016-03-02 19:29:56 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2dso {
|
|
|
|
my %args = @_;
|
|
|
|
my $dso = $args{lib};
|
2016-03-02 23:12:22 +08:00
|
|
|
my $dso_n = basename($dso);
|
2018-10-04 23:41:12 +08:00
|
|
|
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x }
|
|
|
|
grep { $_ =~ m/\.(?:o|res)$/ }
|
|
|
|
@{$args{objs}};
|
|
|
|
my @defs = map { (my $x = $_) =~ s|\.ld$|$defext|; $x }
|
|
|
|
grep { $_ =~ /\.ld$/ }
|
|
|
|
@{$args{objs}};
|
2017-12-04 21:27:58 +08:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $linklibs = join("", map { "$_\n" } @deps);
|
2018-10-04 23:41:12 +08:00
|
|
|
my $deps = join(" ", @objs, @defs, @deps);
|
|
|
|
my $shared_def = join("", map { " /def:$_" } @defs);
|
2016-03-02 19:29:56 +08:00
|
|
|
return <<"EOF";
|
|
|
|
$dso$dsoext: $deps
|
2016-07-14 15:23:36 +08:00
|
|
|
IF EXIST $dso$dsoext.manifest DEL /F /Q $dso$dsoext.manifest
|
2018-10-04 23:41:12 +08:00
|
|
|
\$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \\
|
|
|
|
\$(LDOUTFLAG)$dso$dsoext$shared_def @<< || (DEL /Q \$(\@B).* $dso.* && EXIT 1)
|
2017-12-04 21:27:58 +08:00
|
|
|
$objs
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
$linklibs \$(DSO_EX_LIBS)
|
2016-03-02 19:29:56 +08:00
|
|
|
<<
|
2016-07-14 15:23:36 +08:00
|
|
|
IF EXIST $dso$dsoext.manifest \\
|
2016-07-15 18:57:27 +08:00
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso$dsoext.manifest \$(MTOUTFLAG)$dso$dsoext
|
2016-03-02 19:29:56 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2lib {
|
2017-04-18 22:24:23 +08:00
|
|
|
my %args = @_;
|
2018-10-25 21:55:15 +08:00
|
|
|
my $lib = lib($args{lib});
|
2017-12-04 21:27:58 +08:00
|
|
|
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x } @{$args{objs}};
|
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $deps = join(" ", @objs);
|
2016-03-02 19:29:56 +08:00
|
|
|
return <<"EOF";
|
2018-10-25 21:55:15 +08:00
|
|
|
$lib: $deps
|
|
|
|
\$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib @<<
|
2017-12-04 21:27:58 +08:00
|
|
|
$objs
|
2016-03-02 19:29:56 +08:00
|
|
|
<<
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2bin {
|
|
|
|
my %args = @_;
|
|
|
|
my $bin = $args{bin};
|
2017-12-04 21:27:58 +08:00
|
|
|
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x } @{$args{objs}};
|
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $linklibs = join("", map { "$_\n" } @deps);
|
|
|
|
my $deps = join(" ", @objs, @deps);
|
2016-03-02 19:29:56 +08:00
|
|
|
return <<"EOF";
|
|
|
|
$bin$exeext: $deps
|
2016-07-14 15:23:36 +08:00
|
|
|
IF EXIST $bin$exeext.manifest DEL /F /Q $bin$exeext.manifest
|
2016-03-02 23:12:22 +08:00
|
|
|
\$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin$exeext @<<
|
2017-12-04 21:27:58 +08:00
|
|
|
$objs
|
|
|
|
setargv.obj
|
Make "make variables" config attributes for overridable flags
With the support of "make variables" comes the possibility for the
user to override them. However, we need to make a difference between
defaults that we use (and that should be overridable by the user) and
flags that are crucial for building OpenSSL (should not be
overridable).
Typically, overridable flags are those setting optimization levels,
warnings levels, that kind of thing, while non-overridable flags are,
for example, macros that indicate aspects of how the config target
should be treated, such as L_ENDIAN and B_ENDIAN.
We do that differentiation by allowing upper case attributes in the
config targets, named exactly like the "make variables" we support,
and reserving the lower case attributes for non-overridable project
flags.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5534)
2018-03-07 03:35:30 +08:00
|
|
|
$linklibs\$(BIN_EX_LIBS)
|
2016-03-02 19:29:56 +08:00
|
|
|
<<
|
2016-07-14 15:23:36 +08:00
|
|
|
IF EXIST $bin$exeext.manifest \\
|
2016-07-15 18:57:27 +08:00
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin$exeext.manifest \$(MTOUTFLAG)$bin$exeext
|
2016-03-02 19:29:56 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub in2script {
|
|
|
|
my %args = @_;
|
|
|
|
my $script = $args{script};
|
2016-05-25 17:58:19 +08:00
|
|
|
my $sources = '"'.join('" "', @{$args{sources}}).'"';
|
2016-03-02 19:29:56 +08:00
|
|
|
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "dofile.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
|
|
|
return <<"EOF";
|
|
|
|
$script: $sources
|
2016-05-25 17:58:19 +08:00
|
|
|
"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
2016-03-02 19:29:56 +08:00
|
|
|
"-o$target{build_file}" $sources > "$script"
|
2016-04-03 04:26:38 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub generatedir {
|
|
|
|
my %args = @_;
|
|
|
|
my $dir = $args{dir};
|
|
|
|
my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
|
|
|
|
my @actions = ();
|
|
|
|
my %extinfo = ( dso => $dsoext,
|
|
|
|
lib => $libext,
|
|
|
|
bin => $exeext );
|
|
|
|
|
2018-10-21 17:11:04 +08:00
|
|
|
# We already have a 'test' target, and the top directory is just plain
|
|
|
|
# silly
|
|
|
|
return if $dir eq "test" || $dir eq ".";
|
|
|
|
|
2016-04-03 04:26:38 +08:00
|
|
|
foreach my $type (("dso", "lib", "bin", "script")) {
|
|
|
|
next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
|
2016-06-28 20:02:44 +08:00
|
|
|
# For lib object files, we could update the library. However,
|
|
|
|
# LIB on Windows doesn't work that way, so we won't create any
|
|
|
|
# actions for it, and the dependencies are already taken care of.
|
|
|
|
if ($type ne "lib") {
|
2016-04-03 04:26:38 +08:00
|
|
|
foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
|
|
|
|
if (dirname($prod) eq $dir) {
|
|
|
|
push @deps, $prod.$extinfo{$type};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
my $deps = join(" ", @deps);
|
|
|
|
my $actions = join("\n", "", @actions);
|
|
|
|
return <<"EOF";
|
2018-10-21 17:11:04 +08:00
|
|
|
$dir $dir\\ : $deps$actions
|
2016-03-02 19:29:56 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
"" # Important! This becomes part of the template result.
|
|
|
|
-}
|