2016-03-02 11:29:56 +00:00
|
|
|
##
|
|
|
|
## Makefile for OpenSSL
|
|
|
|
##
|
|
|
|
## {- join("\n## ", @autowarntext) -}
|
|
|
|
{-
|
|
|
|
our $objext = $target{obj_extension} || ".obj";
|
2017-12-04 13:27:58 +00:00
|
|
|
our $resext = $target{res_extension} || ".res";
|
2016-03-02 11:29:56 +00:00
|
|
|
our $depext = $target{dep_extension} || ".d";
|
|
|
|
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 08:13:41 +00:00
|
|
|
(our $sover_dirname = $config{shlib_version_number}) =~ s|\.|_|g;
|
2016-07-06 16:37:52 +00:00
|
|
|
|
2018-03-03 21:26:45 +00:00
|
|
|
my $build_scheme = $target{build_scheme};
|
|
|
|
my $install_flavour = $build_scheme->[$#$build_scheme]; # last element
|
2016-03-17 09:08:25 +00:00
|
|
|
my $win_installenv =
|
2018-03-03 21:26:45 +00:00
|
|
|
$install_flavour eq "VC-WOW" ? "ProgramFiles(x86)"
|
|
|
|
: "ProgramW6432";
|
2016-03-17 09:08:25 +00:00
|
|
|
my $win_commonenv =
|
2018-03-03 21:26:45 +00:00
|
|
|
$install_flavour eq "VC-WOW" ? "CommonProgramFiles(x86)"
|
|
|
|
: "CommonProgramW6432";
|
2016-03-17 09:08:25 +00:00
|
|
|
our $win_installroot =
|
2018-03-03 21:26:45 +00:00
|
|
|
defined($ENV{$win_installenv}) ? $win_installenv : 'ProgramFiles';
|
2016-03-17 09:08:25 +00:00
|
|
|
our $win_commonroot =
|
2018-03-03 21:26:45 +00:00
|
|
|
defined($ENV{$win_commonenv}) ? $win_commonenv : 'CommonProgramFiles';
|
2016-05-06 10:45:50 +00:00
|
|
|
|
|
|
|
# expand variables early
|
|
|
|
$win_installroot = $ENV{$win_installroot};
|
|
|
|
$win_commonroot = $ENV{$win_commonroot};
|
2016-03-17 09:08:25 +00:00
|
|
|
|
2016-03-02 11:29:56 +00:00
|
|
|
sub shlib {
|
|
|
|
my $lib = shift;
|
2017-04-18 14:24:23 +00:00
|
|
|
return () if $disabled{shared} || $lib =~ /\.a$/;
|
|
|
|
return () unless defined $unified_info{sharednames}->{$lib};
|
2016-03-02 11:29:56 +00:00
|
|
|
return $unified_info{sharednames}->{$lib} . $shlibext;
|
|
|
|
}
|
|
|
|
|
2017-04-18 14:24:23 +00:00
|
|
|
sub lib {
|
|
|
|
(my $lib = shift) =~ s/\.a$//;
|
|
|
|
return $lib . $libext;
|
|
|
|
}
|
|
|
|
|
2016-03-02 11:29:56 +00:00
|
|
|
sub shlib_import {
|
|
|
|
my $lib = shift;
|
2017-04-18 14:24:23 +00:00
|
|
|
return () if $disabled{shared} || $lib =~ /\.a$/;
|
2016-03-02 11:29:56 +00:00
|
|
|
return $lib . $shlibextimport;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub dso {
|
|
|
|
my $dso = shift;
|
|
|
|
|
|
|
|
return $dso . $dsoext;
|
|
|
|
}
|
2017-04-22 13:06:35 +00:00
|
|
|
# This makes sure things get built in the order they need
|
|
|
|
# to. You're welcome.
|
|
|
|
sub dependmagic {
|
|
|
|
my $target = shift;
|
|
|
|
|
2018-02-07 21:40:32 +00:00
|
|
|
return "$target: build_generated\n\t\$(MAKE) /\$(MAKEFLAGS) depend && \$(MAKE) /\$(MAKEFLAGS) _$target\n_$target";
|
2017-04-22 13:06:35 +00:00
|
|
|
}
|
2016-03-02 11:29:56 +00: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} -}
|
|
|
|
|
2017-04-18 14:24:23 +00:00
|
|
|
LIBS={- join(" ", map { lib($_) } @{$unified_info{libraries}}) -}
|
2016-03-02 11:29:56 +00:00
|
|
|
SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
|
2016-05-12 16:08:21 +00:00
|
|
|
SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{libraries}}) -}
|
2016-03-02 11:29:56 +00:00
|
|
|
ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
|
2016-05-12 16:08:21 +00:00
|
|
|
ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{engines}}) -}
|
2017-06-08 06:02:26 +00:00
|
|
|
PROGRAMS={- our @PROGRAMS = map { $_.$exeext } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
|
2016-07-08 15:58:36 +00:00
|
|
|
PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
|
2016-03-02 11:29:56 +00:00
|
|
|
SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
|
2016-03-18 23:05:25 +00:00
|
|
|
{- output_off() if $disabled{makedepend}; "" -}
|
2016-03-02 11:29:56 +00:00
|
|
|
DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
|
|
|
|
grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
|
|
|
|
keys %{$unified_info{sources}}); -}
|
2016-03-18 23:05:25 +00:00
|
|
|
{- output_on() if $disabled{makedepend}; "" -}
|
2016-06-13 20:02:11 +00: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 11:13:22 +00:00
|
|
|
GENERATED={- # common0.tmpl provides @generated
|
|
|
|
join(" ", map { (my $x = $_) =~ s|\.[sS]$|.asm|; $x }
|
|
|
|
@generated) -}
|
2016-03-02 11:29:56 +00:00
|
|
|
|
2018-07-05 13:38:28 +00:00
|
|
|
INSTALL_LIBS={- join(" ", map { quotify1(lib($_)) } @{$unified_info{install}->{libraries}}) -}
|
2018-08-01 13:26:13 +00: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 13:38:28 +00: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 12:52:09 +00:00
|
|
|
{- output_off() if $disabled{apps}; "" -}
|
2018-07-05 13:38:28 +00:00
|
|
|
BIN_SCRIPTS="$(BLDDIR)\tools\c_rehash.pl"
|
|
|
|
MISC_SCRIPTS="$(BLDDIR)\apps\CA.pl" "$(BLDDIR)\apps\tsget.pl"
|
2016-07-08 12:52:09 +00:00
|
|
|
{- output_on() if $disabled{apps}; "" -}
|
|
|
|
|
2017-06-15 17:31:01 +00:00
|
|
|
APPS_OPENSSL={- use File::Spec::Functions;
|
2018-07-05 13:38:28 +00:00
|
|
|
"\"".catfile("apps","openssl")."\"" -}
|
2017-06-15 17:31:01 +00:00
|
|
|
|
2016-03-02 11:29:56 +00: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 11:20:21 +00:00
|
|
|
INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
|
|
|
|
#
|
|
|
|
use File::Spec::Functions qw(:DEFAULT splitpath);
|
2017-10-04 07:42:23 +00:00
|
|
|
our $prefix = canonpath($config{prefix}
|
|
|
|
|| "$win_installroot\\OpenSSL");
|
2016-06-28 11:20:21 +00:00
|
|
|
our ($prefix_dev, $prefix_dir, $prefix_file) =
|
2016-06-29 22:10:21 +00:00
|
|
|
splitpath($prefix, 1);
|
2016-06-28 11:20:21 +00:00
|
|
|
$prefix_dev -}
|
2017-10-04 07:42:23 +00:00
|
|
|
INSTALLTOP_dir={- canonpath($prefix_dir) -}
|
2016-06-28 11:20:21 +00:00
|
|
|
OPENSSLDIR_dev={- #
|
|
|
|
# The logic here is that if no --openssldir was given,
|
2017-06-11 11:10:15 +00:00
|
|
|
# OPENSSLDIR will get the value "$win_commonroot\\SSL".
|
2016-06-28 11:20:21 +00: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-06 17:43:59 +00:00
|
|
|
our $openssldir =
|
2016-06-28 11:20:21 +00:00
|
|
|
$config{openssldir} ?
|
|
|
|
(file_name_is_absolute($config{openssldir}) ?
|
2017-10-04 07:42:23 +00:00
|
|
|
canonpath($config{openssldir})
|
2016-06-28 11:20:21 +00:00
|
|
|
: catdir($prefix, $config{openssldir}))
|
2017-10-04 07:42:23 +00:00
|
|
|
: canonpath("$win_commonroot\\SSL");
|
2016-06-28 11:20:21 +00:00
|
|
|
our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
|
|
|
|
splitpath($openssldir, 1);
|
|
|
|
$openssldir_dev -}
|
2017-10-04 07:42:23 +00:00
|
|
|
OPENSSLDIR_dir={- canonpath($openssldir_dir) -}
|
2016-03-17 09:08:25 +00:00
|
|
|
LIBDIR={- our $libdir = $config{libdir} || "lib";
|
2018-02-23 11:10:42 +00:00
|
|
|
file_name_is_absolute($libdir) ? "" : $libdir -}
|
2016-06-28 11:20:21 +00:00
|
|
|
ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath);
|
2017-07-19 08:13:41 +00:00
|
|
|
our $enginesdir = catdir($prefix,$libdir,"engines-$sover_dirname");
|
2016-06-28 11:20:21 +00:00
|
|
|
our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
|
|
|
|
splitpath($enginesdir, 1);
|
|
|
|
$enginesdir_dev -}
|
2017-10-04 07:42:23 +00:00
|
|
|
ENGINESDIR_dir={- canonpath($enginesdir_dir) -}
|
2016-06-28 11:20:21 +00: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 11:29:56 +00:00
|
|
|
|
2018-02-23 11:10:42 +00: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-06 19:35:30 +00: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 11:29:56 +00:00
|
|
|
|
2018-07-08 10:00:06 +00:00
|
|
|
PERL={- $config{PERL} -}
|
2016-03-02 11:29:56 +00: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-06 19:35:30 +00: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 11:29:56 +00: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-06 19:35:30 +00:00
|
|
|
RC={- $config{RC} -}
|
2016-07-14 07:23:36 +00:00
|
|
|
|
2018-07-10 12:12:33 +00: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-06 19:35:30 +00: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 10:57:27 +00: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-06 19:35:30 +00: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 15:41:16 +00: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-06 19:35:30 +00: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 11:39:01 +00: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-06 19:35:30 +00:00
|
|
|
$target{shared_cppflag} || (),
|
2018-04-01 15:41:16 +00: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-06 19:35:30 +00:00
|
|
|
@{$target{lib_defines}},
|
|
|
|
@{$target{shared_defines}},
|
|
|
|
@{$config{lib_defines}},
|
2018-03-09 11:39:01 +00:00
|
|
|
@{$config{shared_defines}}),
|
2018-04-01 15:41:16 +00: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-06 19:35:30 +00:00
|
|
|
@{$target{lib_includes}},
|
|
|
|
@{$target{shared_includes}},
|
|
|
|
@{$config{lib_includes}},
|
|
|
|
@{$config{shared_includes}}),
|
|
|
|
@{$config{lib_cppflags}},
|
2018-03-09 11:39:01 +00:00
|
|
|
@{$config{shared_cppflag}});
|
|
|
|
join(' ', $lib_cppflags,
|
2018-04-01 15:41:16 +00:00
|
|
|
(map { '-D'.quotify1($_) }
|
2018-03-09 11:39:01 +00: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-06 19:35:30 +00: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 11:39:01 +00: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-06 19:35:30 +00:00
|
|
|
|
2016-03-02 11:29:56 +00:00
|
|
|
PERLASM_SCHEME= {- $target{perlasm_scheme} -}
|
|
|
|
|
|
|
|
PROCESSOR= {- $config{processor} -}
|
|
|
|
|
|
|
|
# The main targets ###################################################
|
|
|
|
|
2017-04-22 13:06:35 +00: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 11:29:56 +00:00
|
|
|
|
2017-04-22 13:06:35 +00:00
|
|
|
build_generated: $(GENERATED_MANDATORY)
|
2016-07-06 01:07:16 +00:00
|
|
|
build_libs_nodep: $(LIBS) {- join(" ",map { shlib_import($_) } @{$unified_info{libraries}}) -}
|
2016-03-02 11:29:56 +00:00
|
|
|
build_engines_nodep: $(ENGINES)
|
2016-07-08 15:58:36 +00:00
|
|
|
build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
|
2016-03-02 11:29:56 +00:00
|
|
|
|
2016-07-08 15:58:36 +00:00
|
|
|
# Kept around for backward compatibility
|
|
|
|
build_apps build_tests: build_programs
|
|
|
|
|
2017-06-16 01:46:41 +00:00
|
|
|
# Convenience target to prebuild all generated files, not just the mandatory
|
|
|
|
# ones
|
|
|
|
build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- output_off() if $disabled{makedepend}; "" -}
|
2018-07-10 12:12:33 +00: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 09:05:15 +00:00
|
|
|
@{- output_on() if $disabled{makedepend}; "" -}
|
2017-06-16 01:46:41 +00:00
|
|
|
|
2016-04-18 12:09:36 +00:00
|
|
|
test: tests
|
2017-04-22 13:06:35 +00:00
|
|
|
{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- output_off() if $disabled{tests}; "" -}
|
2017-10-09 15:57:13 +00:00
|
|
|
-mkdir $(BLDDIR)\test\test-runs
|
2016-03-02 11:29:56 +00:00
|
|
|
set SRCTOP=$(SRCDIR)
|
|
|
|
set BLDTOP=$(BLDDIR)
|
2017-10-09 15:57:13 +00:00
|
|
|
set RESULT_D=$(BLDDIR)\test\test-runs
|
2016-03-02 11:29:56 +00:00
|
|
|
set PERL=$(PERL)
|
2018-01-19 07:24:29 +00:00
|
|
|
set OPENSSL_ENGINES=$(MAKEDIR)\engines
|
2016-11-03 16:08:10 +00:00
|
|
|
set OPENSSL_DEBUG_MEMORY=on
|
2016-05-25 09:58:19 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
2018-07-10 12:12:33 +00:00
|
|
|
@$(ECHO) "Tests are not supported with your chosen Configure options"
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- output_on() if !$disabled{tests}; "" -}
|
2016-03-02 11:29:56 +00:00
|
|
|
|
|
|
|
list-tests:
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- output_off() if $disabled{tests}; "" -}
|
2016-06-16 22:23:43 +00:00
|
|
|
@set SRCTOP=$(SRCDIR)
|
2016-05-25 09:58:19 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
|
2018-07-10 12:12:33 +00:00
|
|
|
@$(ECHO) "Tests are not supported with your chosen Configure options"
|
2018-07-11 09:05:15 +00:00
|
|
|
@{- output_on() if !$disabled{tests}; "" -}
|
2016-03-02 11:29:56 +00:00
|
|
|
|
2016-03-17 09:08:25 +00:00
|
|
|
install: install_sw install_ssldirs install_docs
|
|
|
|
|
|
|
|
uninstall: uninstall_docs uninstall_sw
|
|
|
|
|
2016-03-10 00:51:53 +00:00
|
|
|
libclean:
|
2018-03-22 21:55:35 +00: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 00:51:53 +00:00
|
|
|
|
|
|
|
clean: libclean
|
2017-06-08 06:02:26 +00:00
|
|
|
{- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
|
|
|
|
-del /Q /F $(ENGINES)
|
|
|
|
-del /Q /F $(SCRIPTS)
|
2018-04-15 10:07:17 +00:00
|
|
|
-del /Q /F $(GENERATED_MANDATORY)
|
2016-06-16 22:23:43 +00:00
|
|
|
-del /Q /F $(GENERATED)
|
2018-05-06 15:34:04 +00: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 10:07:17 +00:00
|
|
|
-rmdir /Q /S test\test-runs
|
2016-03-10 00:51:53 +00:00
|
|
|
|
2016-06-13 20:02:11 +00:00
|
|
|
distclean: clean
|
|
|
|
-del /Q /F configdata.pm
|
|
|
|
-del /Q /F makefile
|
|
|
|
|
2016-03-02 11:29:56 +00:00
|
|
|
depend:
|
2018-07-11 09:05:15 +00:00
|
|
|
@ {- output_off() if $disabled{makedepend}; "" -}
|
2018-03-15 17:06:18 +00:00
|
|
|
@ "$(PERL)" "$(SRCDIR)\util\add-depends.pl" "VC"
|
2018-07-11 09:05:15 +00:00
|
|
|
@ {- output_on() if $disabled{makedepend}; "" -}
|
2016-03-02 11:29:56 +00:00
|
|
|
|
2016-03-17 09:08:25 +00:00
|
|
|
# Install helper targets #############################################
|
|
|
|
|
|
|
|
install_sw: all install_dev install_engines install_runtime
|
|
|
|
|
|
|
|
uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
|
|
|
|
|
2016-06-16 22:23:43 +00:00
|
|
|
install_docs: install_html_docs
|
2016-03-17 09:08:25 +00:00
|
|
|
|
2016-06-16 22:23:43 +00:00
|
|
|
uninstall_docs: uninstall_html_docs
|
2016-03-17 09:08:25 +00:00
|
|
|
|
|
|
|
install_ssldirs:
|
2016-06-28 11:20:21 +00: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 09:58:19 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
|
2016-08-01 21:18:25 +00: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 09:58:19 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(OPENSSLDIR)\misc"
|
2016-09-09 22:05:41 +00: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 09:08:25 +00:00
|
|
|
|
|
|
|
install_dev:
|
2018-07-10 12:12:33 +00:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
|
|
|
@$(ECHO) "*** Installing development files"
|
2016-06-28 11:20:21 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
|
2018-10-15 15:38:26 +00:00
|
|
|
@{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2016-07-14 19:11:46 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
|
|
|
|
"$(INSTALLTOP)\include\openssl"
|
2018-10-15 15:38:26 +00:00
|
|
|
@{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
|
2018-05-19 05:09:19 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \
|
|
|
|
"$(SRCDIR)\include\openssl\*.h" \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(INSTALLTOP)\include\openssl"
|
2018-07-05 13:38:28 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(BLDDIR)\include\openssl\*.h" \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(INSTALLTOP)\include\openssl"
|
2018-02-23 11:10:42 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)"
|
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)"
|
2016-05-12 16:08:21 +00:00
|
|
|
@if "$(SHLIBS)"=="" \
|
2018-02-23 11:10:42 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)"
|
2016-03-17 09:08:25 +00:00
|
|
|
|
|
|
|
uninstall_dev:
|
|
|
|
|
|
|
|
install_engines:
|
2018-07-10 12:12:33 +00:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
|
|
|
@$(ECHO) "*** Installing engines"
|
2016-06-28 11:20:21 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
|
2016-03-17 09:08:25 +00:00
|
|
|
@if not "$(ENGINES)"=="" \
|
2016-07-08 12:52:09 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
|
2016-05-12 16:08:21 +00:00
|
|
|
@if not "$(ENGINES)"=="" \
|
2016-07-08 12:52:09 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
|
2016-03-17 09:08:25 +00:00
|
|
|
|
|
|
|
uninstall_engines:
|
|
|
|
|
|
|
|
install_runtime:
|
2018-07-10 12:12:33 +00:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
|
|
|
@$(ECHO) "*** Installing runtime files"
|
2016-06-28 11:20:21 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
|
2016-03-17 09:08:25 +00:00
|
|
|
@if not "$(SHLIBS)"=="" \
|
2016-07-08 12:52:09 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
|
2016-05-12 16:08:21 +00:00
|
|
|
@if not "$(SHLIBS)"=="" \
|
2016-07-08 12:52:09 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-07-08 12:52:09 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-07-08 12:52:09 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-05-25 09:58:19 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
|
2016-06-28 11:20:21 +00:00
|
|
|
"$(INSTALLTOP)\bin"
|
2016-03-17 09:08:25 +00:00
|
|
|
|
|
|
|
uninstall_runtime:
|
|
|
|
|
2016-06-16 22:23:43 +00:00
|
|
|
install_html_docs:
|
|
|
|
"$(PERL)" "$(SRCDIR)\util\process_docs.pl" \
|
2016-06-28 11:20:21 +00:00
|
|
|
"--destdir=$(INSTALLTOP)\html" --type=html
|
2016-06-16 22:23:43 +00:00
|
|
|
|
|
|
|
uninstall_html_docs:
|
|
|
|
|
2016-03-02 11:29:56 +00:00
|
|
|
# Building targets ###################################################
|
|
|
|
|
2016-09-17 18:50:56 +00:00
|
|
|
configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
|
2018-07-10 12:12:33 +00:00
|
|
|
@$(ECHO) "Detected changed: $?"
|
2018-02-02 19:33:13 +00:00
|
|
|
"$(PERL)" configdata.pm -r
|
2018-07-10 12:12:33 +00:00
|
|
|
@$(ECHO) "**************************************************"
|
|
|
|
@$(ECHO) "*** ***"
|
|
|
|
@$(ECHO) "*** Please run the same make command again ***"
|
|
|
|
@$(ECHO) "*** ***"
|
|
|
|
@$(ECHO) "**************************************************"
|
2016-03-23 19:33:29 +00:00
|
|
|
@exit 1
|
2016-03-02 11:29:56 +00:00
|
|
|
|
2018-01-29 22:17:43 +00:00
|
|
|
reconfigure reconf:
|
2018-02-02 19:33:13 +00:00
|
|
|
"$(PERL)" configdata.pm -r
|
2018-01-29 22:17:43 +00:00
|
|
|
|
2016-03-02 11:29:56 +00: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 14:24:23 +00:00
|
|
|
return map { lib($_) } @_;
|
2016-03-02 11:29:56 +00:00
|
|
|
}
|
2017-04-18 14:24:23 +00:00
|
|
|
foreach (@_) {
|
|
|
|
(my $l = $_) =~ s/\.a$//;
|
|
|
|
die "Linking with static variants of shared libraries is not supported in this configuration\n"
|
|
|
|
if $l ne $_ && shlib($l);
|
|
|
|
}
|
|
|
|
return map { shlib_import($_) or lib($_) } @_;
|
2016-03-02 11:29:56 +00:00
|
|
|
}
|
|
|
|
|
2016-03-07 13:12:45 +00:00
|
|
|
sub generatesrc {
|
|
|
|
my %args = @_;
|
|
|
|
(my $target = $args{src}) =~ s/\.[sS]$/.asm/;
|
2018-03-03 22:07:14 +00:00
|
|
|
my ($gen0, @gens) = @{$args{generator}};
|
|
|
|
my $generator = '"'.$gen0.'"'.join('', map { " $_" } @gens);
|
2016-05-25 09:58:19 +00:00
|
|
|
my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
|
|
|
|
my $incs = join("", map { " /I \"$_\"" } @{$args{incs}});
|
|
|
|
my $deps = @{$args{deps}} ?
|
|
|
|
'"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
|
2016-03-07 13:12:45 +00:00
|
|
|
|
|
|
|
if ($target !~ /\.asm$/) {
|
2016-06-13 20:02:11 +00: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 09:58:19 +00:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
|
|
|
"\$(PERL)"$generator_incs $generator > \$@
|
2016-03-07 13:12:45 +00:00
|
|
|
EOF
|
2016-06-13 20:02:11 +00:00
|
|
|
}
|
2016-03-07 13:12:45 +00:00
|
|
|
} else {
|
|
|
|
if ($args{generator}->[0] =~ /\.pl$/) {
|
2016-05-25 09:58:19 +00:00
|
|
|
$generator = '"$(PERL)"'.$generator_incs.' '.$generator;
|
2016-03-07 13:12:45 +00: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-13 19:32:42 +00:00
|
|
|
my $cppflags = $incs;
|
2018-02-22 15:33:58 +00:00
|
|
|
$cppflags .= {
|
|
|
|
lib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
|
|
|
dso => ' $(DSO_CFLAGS) $(DSO_CPPFLAGS)',
|
|
|
|
bin => ' $(BIN_CFLAGS) $(BIN_CPPFLAGS)'
|
|
|
|
} -> {$args{intent}};
|
2016-03-07 13:12:45 +00: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 09:58:19 +00:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
2016-03-07 13:12:45 +00:00
|
|
|
set ASM=\$(AS)
|
|
|
|
$generator \$@.S
|
2018-02-13 19:04:35 +00:00
|
|
|
\$(CPP) $cppflags \$@.S > \$@.i && move /Y \$@.i \$@
|
2016-03-07 13:12:45 +00:00
|
|
|
del /Q \$@.S
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
# Otherwise....
|
|
|
|
return <<"EOF";
|
2016-05-25 09:58:19 +00:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
2016-03-07 13:12:45 +00:00
|
|
|
set ASM=\$(AS)
|
|
|
|
$generator \$@
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
return <<"EOF";
|
2016-05-25 09:58:19 +00:00
|
|
|
$target: "$args{generator}->[0]" $deps
|
2018-02-13 19:04:35 +00:00
|
|
|
\$(CPP) $incs $cppflags "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
|
2016-03-07 13:12:45 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-02 11:29:56 +00:00
|
|
|
sub src2obj {
|
|
|
|
my %args = @_;
|
2016-03-23 19:33:29 +00:00
|
|
|
my @srcs = map { (my $x = $_) =~ s/\.s$/.asm/; $x
|
|
|
|
} ( @{$args{srcs}} );
|
2016-05-25 09:58:19 +00:00
|
|
|
my $srcs = '"'.join('" "', @srcs).'"';
|
|
|
|
my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
|
|
|
|
my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
|
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-13 19:32:42 +00:00
|
|
|
my $cflags = { lib => ' $(LIB_CFLAGS)',
|
|
|
|
dso => ' $(DSO_CFLAGS)',
|
|
|
|
bin => ' $(BIN_CFLAGS)' } -> {$args{intent}};
|
2018-01-23 12:54:55 +00:00
|
|
|
$cflags .= $incs;
|
|
|
|
$cflags .= { lib => ' $(LIB_CPPFLAGS)',
|
|
|
|
dso => ' $(DSO_CPPFLAGS)',
|
|
|
|
bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}};
|
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-06 19:35:30 +00:00
|
|
|
my $asflags = { lib => ' $(LIB_ASFLAGS)',
|
|
|
|
dso => ' $(DSO_ASFLAGS)',
|
|
|
|
bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
|
2016-03-02 11:29:56 +00:00
|
|
|
my $makedepprog = $config{makedepprog};
|
2017-12-04 13:27:58 +00:00
|
|
|
if ($srcs[0] =~ /\.rc$/) {
|
|
|
|
return <<"EOF";
|
|
|
|
$args{obj}: $deps
|
|
|
|
\$(RC) \$(RCOUTFLAG)\$\@ $srcs
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
(my $obj = $args{obj}) =~ s|\.o$||;
|
2016-03-02 11:29:56 +00: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-06 19:35:30 +00:00
|
|
|
\$(AS) $asflags \$(ASOUTFLAG)\$\@ $srcs
|
2018-04-11 08:11:07 +00:00
|
|
|
EOF
|
|
|
|
} elsif ($srcs[0] =~ /.S$/) {
|
|
|
|
return <<"EOF";
|
|
|
|
$obj$objext: $deps
|
|
|
|
\$(CC) /EP /D__ASSEMBLER__ $cflags $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
2016-03-18 23:05:25 +00:00
|
|
|
return <<"EOF" if (!$disabled{makedepend});
|
2016-03-02 11:29:56 +00:00
|
|
|
$obj$depext: $deps
|
2018-03-15 17:06:18 +00:00
|
|
|
\$(CC) $cflags /Zs /showIncludes $srcs 2>&1 > $obj$depext
|
2016-03-02 11:29:56 +00:00
|
|
|
$obj$objext: $obj$depext
|
2018-03-15 20:37:32 +00:00
|
|
|
\$(CC) $cflags -c \$(COUTFLAG)\$\@ $srcs
|
2016-03-18 23:05:25 +00:00
|
|
|
EOF
|
|
|
|
return <<"EOF" if ($disabled{makedepend});
|
|
|
|
$obj$objext: $deps
|
2018-01-23 12:54:55 +00:00
|
|
|
\$(CC) $cflags -c \$(COUTFLAG)\$\@ $srcs
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
# On Unix, we build shlibs from static libs, so we're ignoring the
|
|
|
|
# object file array. We *know* this routine is only called when we've
|
|
|
|
# configure 'shared'.
|
|
|
|
sub libobj2shlib {
|
|
|
|
my %args = @_;
|
|
|
|
my $lib = $args{lib};
|
|
|
|
my $shlib = $args{shlib};
|
2017-12-04 13:27:58 +00:00
|
|
|
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x }
|
2018-01-14 21:39:20 +00:00
|
|
|
grep { $_ =~ m/\.(?:o|res)$/ }
|
2017-12-04 13:27:58 +00:00
|
|
|
@{$args{objs}};
|
|
|
|
my @defs = grep { $_ =~ /\.def$/ } @{$args{objs}};
|
|
|
|
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);
|
2016-03-02 11:29:56 +00:00
|
|
|
my $target = shlib_import($lib);
|
2017-12-04 13:27:58 +00:00
|
|
|
my $shared_def = join("", map { " /def:$_" } @defs);
|
2016-03-02 11:29:56 +00:00
|
|
|
return <<"EOF"
|
2017-12-04 13:27:58 +00:00
|
|
|
$target: $deps
|
2016-07-14 07:23:36 +00:00
|
|
|
IF EXIST $shlib$shlibext.manifest DEL /F /Q $shlib$shlibext.manifest
|
2018-05-14 15:06:04 +00:00
|
|
|
IF EXIST \$@ DEL /F /Q \$@
|
2016-03-12 08:38:20 +00:00
|
|
|
\$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
|
2017-12-04 13:27:58 +00:00
|
|
|
/implib:\$@ \$(LDOUTFLAG)$shlib$shlibext$shared_def @<< || (DEL /Q \$(\@B).* $shlib.* && EXIT 1)
|
|
|
|
$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-06 19:35:30 +00:00
|
|
|
$linklibs\$(LIB_EX_LIBS)
|
2016-03-02 11:29:56 +00:00
|
|
|
<<
|
2016-07-14 07:23:36 +00:00
|
|
|
IF EXIST $shlib$shlibext.manifest \\
|
2016-07-15 10:57:27 +00:00
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$shlib$shlibext.manifest \$(MTOUTFLAG)$shlib$shlibext
|
2016-05-23 07:36:02 +00:00
|
|
|
IF EXIST apps\\$shlib$shlibext DEL /Q /F apps\\$shlib$shlibext
|
|
|
|
IF EXIST test\\$shlib$shlibext DEL /Q /F test\\$shlib$shlibext
|
2017-08-16 13:33:13 +00:00
|
|
|
IF EXIST fuzz\\$shlib$shlibext DEL /Q /F fuzz\\$shlib$shlibext
|
2016-03-16 15:50:18 +00:00
|
|
|
COPY $shlib$shlibext apps
|
|
|
|
COPY $shlib$shlibext test
|
2017-08-16 13:33:13 +00:00
|
|
|
COPY $shlib$shlibext fuzz
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2dso {
|
|
|
|
my %args = @_;
|
|
|
|
my $dso = $args{lib};
|
2016-03-02 15:12:22 +00:00
|
|
|
my $dso_n = basename($dso);
|
2017-12-04 13:27:58 +00: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 11:29:56 +00:00
|
|
|
return <<"EOF";
|
|
|
|
$dso$dsoext: $deps
|
2016-07-14 07:23:36 +00:00
|
|
|
IF EXIST $dso$dsoext.manifest DEL /F /Q $dso$dsoext.manifest
|
2016-03-02 15:12:22 +00:00
|
|
|
\$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \$(LDOUTFLAG)$dso$dsoext /def:<< @<<
|
|
|
|
LIBRARY $dso_n
|
2016-03-02 11:29:56 +00:00
|
|
|
EXPORTS
|
|
|
|
bind_engine @1
|
|
|
|
v_check @2
|
|
|
|
<<
|
2017-12-04 13:27:58 +00: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-06 19:35:30 +00:00
|
|
|
$linklibs \$(DSO_EX_LIBS)
|
2016-03-02 11:29:56 +00:00
|
|
|
<<
|
2016-07-14 07:23:36 +00:00
|
|
|
IF EXIST $dso$dsoext.manifest \\
|
2016-07-15 10:57:27 +00:00
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso$dsoext.manifest \$(MTOUTFLAG)$dso$dsoext
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2lib {
|
2017-04-18 14:24:23 +00:00
|
|
|
my %args = @_;
|
|
|
|
my $lib = $args{lib};
|
|
|
|
|
2016-03-10 00:58:27 +00:00
|
|
|
# Because static libs and import libs are both named the same in native
|
|
|
|
# Windows, we can't have both. We skip the static lib in that case,
|
|
|
|
# as the shared libs are what we use anyway.
|
2017-04-18 14:24:23 +00:00
|
|
|
return "" unless $disabled{"shared"} || $lib =~ /\.a$/;
|
2016-03-10 00:58:27 +00:00
|
|
|
|
2017-04-18 14:24:23 +00:00
|
|
|
$lib =~ s/\.a$//;
|
2017-12-04 13:27:58 +00:00
|
|
|
my @objs = map { (my $x = $_) =~ s|\.o$|$objext|; $x } @{$args{objs}};
|
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $deps = join(" ", @objs);
|
2016-03-02 11:29:56 +00:00
|
|
|
return <<"EOF";
|
|
|
|
$lib$libext: $deps
|
|
|
|
\$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib$libext @<<
|
2017-12-04 13:27:58 +00:00
|
|
|
$objs
|
2016-03-02 11:29:56 +00:00
|
|
|
<<
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2bin {
|
|
|
|
my %args = @_;
|
|
|
|
my $bin = $args{bin};
|
2017-12-04 13:27:58 +00: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 11:29:56 +00:00
|
|
|
return <<"EOF";
|
|
|
|
$bin$exeext: $deps
|
2016-07-14 07:23:36 +00:00
|
|
|
IF EXIST $bin$exeext.manifest DEL /F /Q $bin$exeext.manifest
|
2016-03-02 15:12:22 +00:00
|
|
|
\$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin$exeext @<<
|
2017-12-04 13:27:58 +00: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-06 19:35:30 +00:00
|
|
|
$linklibs\$(BIN_EX_LIBS)
|
2016-03-02 11:29:56 +00:00
|
|
|
<<
|
2016-07-14 07:23:36 +00:00
|
|
|
IF EXIST $bin$exeext.manifest \\
|
2016-07-15 10:57:27 +00:00
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin$exeext.manifest \$(MTOUTFLAG)$bin$exeext
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub in2script {
|
|
|
|
my %args = @_;
|
|
|
|
my $script = $args{script};
|
2016-05-25 09:58:19 +00:00
|
|
|
my $sources = '"'.join('" "', @{$args{sources}}).'"';
|
2016-03-02 11:29:56 +00:00
|
|
|
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "dofile.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
|
|
|
return <<"EOF";
|
|
|
|
$script: $sources
|
2016-05-25 09:58:19 +00:00
|
|
|
"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
2016-03-02 11:29:56 +00:00
|
|
|
"-o$target{build_file}" $sources > "$script"
|
2016-04-02 20:26:38 +00: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 );
|
|
|
|
|
|
|
|
foreach my $type (("dso", "lib", "bin", "script")) {
|
|
|
|
next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
|
2016-06-28 12:02:44 +00: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-02 20:26:38 +00: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";
|
|
|
|
$args{dir} $args{dir}\\ : $deps$actions
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
"" # Important! This becomes part of the template result.
|
|
|
|
-}
|