2016-03-02 11:29:56 +00:00
|
|
|
##
|
|
|
|
## Makefile for OpenSSL
|
|
|
|
##
|
|
|
|
## {- join("\n## ", @autowarntext) -}
|
|
|
|
{-
|
2018-10-23 12:36:23 +00:00
|
|
|
our $sover_dirname = platform->shlib_version_as_filename();
|
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
|
|
|
|
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} -}
|
|
|
|
|
2018-12-06 23:32:43 +00:00
|
|
|
VERSION={- "$config{full_version}" -}
|
2016-03-02 11:29:56 +00:00
|
|
|
MAJOR={- $config{major} -}
|
|
|
|
MINOR={- $config{minor} -}
|
|
|
|
|
Switch to MAJOR.MINOR.PATCH versioning and version 3.0.0-dev
We're strictly use version numbers of the form MAJOR.MINOR.PATCH.
Letter releases are things of days past.
The most central change is that we now express the version number with
three macros, one for each part of the version number:
OPENSSL_VERSION_MAJOR
OPENSSL_VERSION_MINOR
OPENSSL_VERSION_PATCH
We also provide two additional macros to express pre-release and build
metadata information (also specified in semantic versioning):
OPENSSL_VERSION_PRE_RELEASE
OPENSSL_VERSION_BUILD_METADATA
To get the library's idea of all those values, we introduce the
following functions:
unsigned int OPENSSL_version_major(void);
unsigned int OPENSSL_version_minor(void);
unsigned int OPENSSL_version_patch(void);
const char *OPENSSL_version_pre_release(void);
const char *OPENSSL_version_build_metadata(void);
Additionally, for shared library versioning (which is out of scope in
semantic versioning, but that we still need):
OPENSSL_SHLIB_VERSION
We also provide a macro that contains the release date. This is not
part of the version number, but is extra information that we want to
be able to display:
OPENSSL_RELEASE_DATE
Finally, also provide the following convenience functions:
const char *OPENSSL_version_text(void);
const char *OPENSSL_version_text_full(void);
The following macros and functions are deprecated, and while currently
existing for backward compatibility, they are expected to disappear:
OPENSSL_VERSION_NUMBER
OPENSSL_VERSION_TEXT
OPENSSL_VERSION
OpenSSL_version_num()
OpenSSL_version()
Also, this function is introduced to replace OpenSSL_version() for all
indexes except for OPENSSL_VERSION:
OPENSSL_info()
For configuration, the option 'newversion-only' is added to disable all
the macros and functions that are mentioned as deprecated above.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7724)
2018-09-27 13:56:35 +00:00
|
|
|
SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
|
2016-03-02 11:29:56 +00:00
|
|
|
|
2018-10-23 12:36:23 +00:00
|
|
|
LIBS={- join(" ", map { ( platform->sharedlib_import($_), platform->staticlib($_) ) } @{$unified_info{libraries}}) -}
|
|
|
|
SHLIBS={- join(" ", map { platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
|
|
|
|
SHLIBPDBS={- join(" ", map { platform->sharedlibpdb($_) // () } @{$unified_info{libraries}}) -}
|
2019-01-30 23:06:50 +00:00
|
|
|
MODULES={- join(" ", map { platform->dso($_) } @{$unified_info{modules}}) -}
|
|
|
|
MODULEPDBS={- join(" ", map { platform->dsopdb($_) } @{$unified_info{modules}}) -}
|
2018-10-23 12:36:23 +00:00
|
|
|
PROGRAMS={- our @PROGRAMS = map { platform->bin($_) } @{$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}; "" -}
|
2018-10-23 12:36:23 +00:00
|
|
|
DEPS={- join(" ", map { platform->isobj($_) ? platform->dep($_) : () }
|
2016-03-02 11:29:56 +00:00
|
|
|
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
|
2018-10-23 12:36:23 +00:00
|
|
|
join(" ", map { platform->convertext($_) } @generated) -}
|
|
|
|
|
2018-11-07 10:02:06 +00:00
|
|
|
INSTALL_LIBS={-
|
|
|
|
join(" ", map { quotify1(platform->sharedlib_import($_)
|
|
|
|
// platform->staticlib($_)) }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}})
|
|
|
|
-}
|
|
|
|
INSTALL_SHLIBS={-
|
|
|
|
join(" ", map { my $x = platform->sharedlib($_);
|
|
|
|
$x ? quotify_l($x) : () }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}})
|
|
|
|
-}
|
|
|
|
INSTALL_SHLIBPDBS={-
|
|
|
|
join(" ", map { my $x = platform->sharedlibpdb($_);
|
|
|
|
$x ? quotify_l($x) : () }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{libraries}})
|
|
|
|
-}
|
|
|
|
INSTALL_ENGINES={-
|
|
|
|
join(" ", map { quotify1(platform->dso($_)) }
|
2019-01-30 23:06:50 +00:00
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{$_}->{engine} }
|
|
|
|
@{$unified_info{modules}})
|
2018-11-07 10:02:06 +00:00
|
|
|
-}
|
|
|
|
INSTALL_ENGINEPDBS={-
|
|
|
|
join(" ", map { quotify1(platform->dsopdb($_)) }
|
2019-01-30 23:06:50 +00:00
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{$_}->{engine} }
|
|
|
|
@{$unified_info{modules}})
|
2018-11-07 10:02:06 +00:00
|
|
|
-}
|
|
|
|
INSTALL_PROGRAMS={-
|
|
|
|
join(" ", map { quotify1(platform->bin($_)) }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{programs}})
|
|
|
|
-}
|
|
|
|
INSTALL_PROGRAMPDBS={-
|
|
|
|
join(" ", map { quotify1(platform->binpdb($_)) }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst} }
|
|
|
|
@{$unified_info{programs}})
|
|
|
|
-}
|
Build: use attributes to indicate installed script classes
We have two classes of scripts to be installed, those that are
installed as "normal" programs, and those that are installed as "misc"
scripts. These classes are installed in different locations, so the
build file templates must pay attention.
Because we didn't have the tools to indicate what scripts go where, we
had these scripts hard coded in the build template files, with the
maintenance issues that may cause. Now that we have attributes, those
can be used to classify the installed scripts, and have the build file
templates simply check the attributes to know what's what.
Furthermore, the 'tsget.pl' script exists both as 'tsget.pl' and
'tsget', which is done by installing a symbolic link (or copy). This
link name is now given through an attribute, which results in even
less hard coding in the Unix Makefile template.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7581)
2018-11-07 10:05:17 +00:00
|
|
|
BIN_SCRIPTS={-
|
|
|
|
join(" ", map { quotify1($_) }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& !$unified_info{attributes}->{$_}->{misc} }
|
|
|
|
@{$unified_info{scripts}})
|
|
|
|
-}
|
|
|
|
MISC_SCRIPTS={-
|
|
|
|
join(" ", map { quotify1($_) }
|
|
|
|
grep { !$unified_info{attributes}->{$_}->{noinst}
|
|
|
|
&& $unified_info{attributes}->{$_}->{misc} }
|
|
|
|
@{$unified_info{scripts}})
|
|
|
|
-}
|
2016-07-08 12:52:09 +00:00
|
|
|
|
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 -}
|
2019-03-13 12:24:17 +00:00
|
|
|
MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath);
|
2019-02-05 22:18:50 +00:00
|
|
|
our $modulesprefix = catdir($prefix,$libdir);
|
|
|
|
our ($modulesprefix_dev, $modulesprefix_dir,
|
|
|
|
$modulesprefix_file) =
|
|
|
|
splitpath($modulesprefix, 1);
|
|
|
|
our $modulesdir_dev = $modulesprefix_dev;
|
|
|
|
our $modulesdir_dir =
|
|
|
|
catdir($modulesprefix_dir, "ossl-modules");
|
|
|
|
our $modulesdir = catpath($modulesdir_dev, $modulesdir_dir);
|
|
|
|
our $enginesdir_dev = $modulesprefix_dev;
|
2019-03-13 12:24:17 +00:00
|
|
|
our $enginesdir_dir =
|
2019-02-05 22:18:50 +00:00
|
|
|
catdir($modulesprefix_dir, "engines-$sover_dirname");
|
|
|
|
our $enginesdir = catpath($enginesdir_dev, $enginesdir_dir);
|
|
|
|
$modulesdir_dev -}
|
|
|
|
MODULESDIR_dir={- canonpath($modulesdir_dir) -}
|
|
|
|
ENGINESDIR_dev={- $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)
|
2019-02-05 22:18:50 +00:00
|
|
|
MODULESDIR=$(DESTDIR)$(MODULESDIR_dir)
|
2016-06-28 11:20:21 +00:00
|
|
|
!ELSE
|
|
|
|
INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
|
|
|
|
OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
|
|
|
|
ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
|
2019-02-05 22:18:50 +00:00
|
|
|
MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir)
|
2016-06-28 11:20:21 +00:00
|
|
|
!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\"",
|
2019-02-05 22:18:50 +00:00
|
|
|
"ENGINESDIR=\"$enginesdir\"",
|
|
|
|
"MODULESDIR=\"$modulesdir\""),
|
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 ###################################################
|
|
|
|
|
2019-01-30 23:06:50 +00:00
|
|
|
{- dependmagic('all'); -}: build_libs_nodep build_modules_nodep build_programs_nodep
|
2017-04-22 13:06:35 +00:00
|
|
|
{- dependmagic('build_libs'); -}: build_libs_nodep
|
2019-01-30 23:06:50 +00:00
|
|
|
{- dependmagic('build_modules'); -}: build_modules_nodep
|
2017-04-22 13:06:35 +00:00
|
|
|
{- 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)
|
2018-10-23 12:36:23 +00:00
|
|
|
build_libs_nodep: $(LIBS) {- join(" ",map { platform->sharedlib_import($_) // () } @{$unified_info{libraries}}) -}
|
2019-01-30 23:06:50 +00:00
|
|
|
build_modules_nodep: $(MODULES)
|
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
|
2019-01-30 23:06:50 +00:00
|
|
|
{- dependmagic('tests'); -}: build_programs_nodep build_modules_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) -}
|
2019-01-30 23:06:50 +00:00
|
|
|
-del /Q /F $(MODULES)
|
2017-06-08 06:02:26 +00:00
|
|
|
-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 #############################################
|
|
|
|
|
2018-11-07 15:13:57 +00:00
|
|
|
install_sw: install_dev install_engines install_runtime
|
2016-03-17 09:08:25 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2018-10-25 07:09:20 +00:00
|
|
|
install_dev: install_runtime_libs
|
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:
|
|
|
|
|
2019-01-30 23:06:50 +00:00
|
|
|
install_engines: install_runtime_libs build_modules
|
2018-07-10 12:12:33 +00:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
2019-01-30 23:06:50 +00:00
|
|
|
@$(ECHO) "*** Installing ENGINE modules"
|
2016-06-28 11:20:21 +00:00
|
|
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
|
2019-01-30 23:06:50 +00:00
|
|
|
@if not "$(INSTALL_ENGINES)"=="" \
|
2016-07-08 12:52:09 +00:00
|
|
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
|
2019-01-30 23:06:50 +00:00
|
|
|
@if not "$(INSTALL_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:
|
|
|
|
|
2018-10-25 07:09:20 +00:00
|
|
|
install_runtime: install_programs
|
|
|
|
|
2018-11-07 15:13:57 +00:00
|
|
|
install_runtime_libs: build_libs
|
2018-07-10 12:12:33 +00:00
|
|
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
2018-10-25 07:09:20 +00:00
|
|
|
@$(ECHO) "*** Installing runtime libraries"
|
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"
|
2018-10-25 07:09:20 +00:00
|
|
|
|
2018-11-07 15:13:57 +00:00
|
|
|
install_programs: install_runtime_libs build_programs
|
2018-10-25 07:09:20 +00:00
|
|
|
@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 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}) {
|
2018-10-23 12:36:23 +00:00
|
|
|
return map { platform->staticlib($_) } @_;
|
2016-03-02 11:29:56 +00:00
|
|
|
}
|
2018-10-23 12:36:23 +00:00
|
|
|
return map { platform->sharedlib_import($_) // platform->staticlib($_) } @_;
|
2016-03-02 11:29:56 +00:00
|
|
|
}
|
|
|
|
|
2016-03-07 13:12:45 +00:00
|
|
|
sub generatesrc {
|
|
|
|
my %args = @_;
|
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}});
|
2016-10-14 15:10:05 +00:00
|
|
|
my $defs = join("", map { " /D".$_ } @{$args{defs}});
|
2016-05-25 09:58:19 +00:00
|
|
|
my $deps = @{$args{deps}} ?
|
|
|
|
'"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
|
2016-03-07 13:12:45 +00:00
|
|
|
|
2018-10-23 12:36:23 +00:00
|
|
|
if (platform->isdef($args{src})) {
|
|
|
|
my $target = platform->def($args{src});
|
2018-09-30 12:44:59 +00:00
|
|
|
my $mkdef = abs2rel(rel2abs(catfile($config{sourcedir},
|
|
|
|
"util", "mkdef.pl")),
|
|
|
|
rel2abs($config{builddir}));
|
2018-10-04 15:41:12 +00:00
|
|
|
my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
|
|
|
|
my $ord_name =
|
2018-10-23 12:36:23 +00:00
|
|
|
$args{generator}->[1] || platform->dsoname($args{product});
|
2018-09-30 12:44:59 +00:00
|
|
|
return <<"EOF";
|
2018-10-04 15:41:12 +00:00
|
|
|
$target: $args{generator}->[0] $deps $mkdef
|
|
|
|
\$(PERL) $mkdef$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS windows > $target
|
2018-09-30 12:44:59 +00:00
|
|
|
EOF
|
2018-10-23 12:36:23 +00:00
|
|
|
} elsif (!platform->isasm($args{src})) {
|
2018-09-30 12:44:59 +00:00
|
|
|
my $target = $args{src};
|
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 {
|
2018-10-23 12:36:23 +00:00
|
|
|
my $target = platform->asm($args{src});
|
2016-03-07 13:12:45 +00:00
|
|
|
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 .= {
|
2018-09-10 00:28:39 +00:00
|
|
|
shlib => ' $(LIB_CFLAGS) $(LIB_CPPFLAGS)',
|
2018-02-22 15:33:58 +00:00
|
|
|
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
|
2016-10-14 15:10:05 +00:00
|
|
|
\$(CPP) $cppflags $defs \$@.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
|
2016-10-14 15:10:05 +00:00
|
|
|
\$(CPP) $incs $cppflags $defs "$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 {
|
2019-03-19 13:43:31 +00:00
|
|
|
my $asmext = platform->asmext();
|
2016-03-02 11:29:56 +00:00
|
|
|
my %args = @_;
|
2019-03-19 13:43:31 +00:00
|
|
|
my @srcs =
|
|
|
|
map { my $x = $_;
|
|
|
|
(platform->isasm($x) && grep { $x eq $_ } @generated)
|
|
|
|
? platform->asm($x) : $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}});
|
2016-10-14 15:10:05 +00:00
|
|
|
my $defs = join("", map { " /D".$_ } @{$args{defs}});
|
2018-09-10 00:28:39 +00: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-13 19:32:42 +00:00
|
|
|
dso => ' $(DSO_CFLAGS)',
|
|
|
|
bin => ' $(BIN_CFLAGS)' } -> {$args{intent}};
|
2018-01-23 12:54:55 +00:00
|
|
|
$cflags .= $incs;
|
2018-09-10 00:28:39 +00:00
|
|
|
$cflags .= { shlib => ' $(LIB_CPPFLAGS)',
|
|
|
|
lib => ' $(LIB_CPPFLAGS)',
|
2018-01-23 12:54:55 +00:00
|
|
|
dso => ' $(DSO_CPPFLAGS)',
|
|
|
|
bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}};
|
2018-09-10 00:28:39 +00: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-06 19:35:30 +00:00
|
|
|
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$/) {
|
2018-10-23 12:36:23 +00:00
|
|
|
my $res = platform->res($args{obj});
|
2017-12-04 13:27:58 +00:00
|
|
|
return <<"EOF";
|
2018-10-23 12:36:23 +00:00
|
|
|
$res: $deps
|
2017-12-04 13:27:58 +00:00
|
|
|
\$(RC) \$(RCOUTFLAG)\$\@ $srcs
|
|
|
|
EOF
|
|
|
|
}
|
2018-10-23 12:36:23 +00:00
|
|
|
my $obj = platform->obj($args{obj});
|
2019-01-22 11:17:36 +00:00
|
|
|
my $dep = platform->dep($args{obj});
|
2019-03-19 13:43:31 +00:00
|
|
|
if ($srcs[0] =~ /\Q${asmext}\E$/) {
|
2016-03-02 11:29:56 +00:00
|
|
|
return <<"EOF";
|
2018-10-23 12:36:23 +00:00
|
|
|
$obj: $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";
|
2018-10-23 12:36:23 +00:00
|
|
|
$obj: $deps
|
2016-10-14 15:10:05 +00:00
|
|
|
\$(CC) /EP /D__ASSEMBLER__ $cflags $defs $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
2018-10-23 08:35:48 +00:00
|
|
|
my $recipe = <<"EOF";
|
2018-10-23 12:36:23 +00:00
|
|
|
$obj: $deps
|
2016-10-14 15:10:05 +00:00
|
|
|
\$(CC) $cflags $defs -c \$(COUTFLAG)\$\@ $srcs
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
2018-10-23 08:35:48 +00:00
|
|
|
$recipe .= <<"EOF" unless $disabled{makedepend};
|
2018-10-23 12:36:23 +00:00
|
|
|
\$(CC) $cflags $defs /Zs /showIncludes $srcs 2>&1 > $dep
|
2018-10-23 08:35:48 +00:00
|
|
|
EOF
|
|
|
|
return $recipe;
|
2016-03-02 11:29:56 +00:00
|
|
|
}
|
|
|
|
|
2018-10-21 09:03:02 +00: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 08:59:06 +00:00
|
|
|
sub obj2shlib {
|
2016-03-02 11:29:56 +00:00
|
|
|
my %args = @_;
|
|
|
|
my $lib = $args{lib};
|
2018-10-23 12:36:23 +00:00
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) || platform->isres($_) }
|
2017-12-04 13:27:58 +00:00
|
|
|
@{$args{objs}};
|
2018-10-23 12:36:23 +00:00
|
|
|
my @defs = map { platform->def($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2018-09-30 12:44:59 +00:00
|
|
|
@{$args{objs}};
|
2017-12-04 13:27:58 +00: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-23 12:36:23 +00:00
|
|
|
my $import = platform->sharedlib_import($lib);
|
|
|
|
my $dll = platform->sharedlib($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"
|
2018-10-21 09:03:02 +00: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 15:06:04 +00:00
|
|
|
IF EXIST \$@ DEL /F /Q \$@
|
2016-03-12 08:38:20 +00:00
|
|
|
\$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
|
2018-10-21 09:03:02 +00:00
|
|
|
/implib:$import \$(LDOUTFLAG)$dll$shared_def @<< || (DEL /Q \$(\@B).* $import && EXIT 1)
|
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\$(LIB_EX_LIBS)
|
2016-03-02 11:29:56 +00:00
|
|
|
<<
|
2018-10-21 09:03:02 +00: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 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2dso {
|
|
|
|
my %args = @_;
|
2018-10-23 12:36:23 +00:00
|
|
|
my $dso = platform->dso($args{lib});
|
|
|
|
my $dso_n = platform->dsoname($args{lib});
|
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) || platform->isres($_) }
|
2018-10-04 15:41:12 +00:00
|
|
|
@{$args{objs}};
|
2018-10-23 12:36:23 +00:00
|
|
|
my @defs = map { platform->def($_) }
|
|
|
|
grep { platform->isdef($_) }
|
2018-10-04 15:41:12 +00:00
|
|
|
@{$args{objs}};
|
2017-12-04 13:27:58 +00:00
|
|
|
my @deps = compute_lib_depends(@{$args{deps}});
|
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $linklibs = join("", map { "$_\n" } @deps);
|
2018-10-04 15:41:12 +00:00
|
|
|
my $deps = join(" ", @objs, @defs, @deps);
|
|
|
|
my $shared_def = join("", map { " /def:$_" } @defs);
|
2016-03-02 11:29:56 +00:00
|
|
|
return <<"EOF";
|
2018-10-23 12:36:23 +00:00
|
|
|
$dso: $deps
|
|
|
|
IF EXIST $dso.manifest DEL /F /Q $dso.manifest
|
2018-10-04 15:41:12 +00:00
|
|
|
\$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \\
|
2018-10-23 12:36:23 +00:00
|
|
|
\$(LDOUTFLAG)$dso$shared_def @<< || (DEL /Q \$(\@B).* $dso_n.* && EXIT 1)
|
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
|
|
|
<<
|
2018-10-23 12:36:23 +00:00
|
|
|
IF EXIST $dso.manifest \\
|
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso.manifest \$(MTOUTFLAG)$dso
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2lib {
|
2017-04-18 14:24:23 +00:00
|
|
|
my %args = @_;
|
2018-10-23 12:36:23 +00:00
|
|
|
my $lib = platform->staticlib($args{lib});
|
|
|
|
my @objs = map { platform->obj($_) } @{$args{objs}};
|
2017-12-04 13:27:58 +00:00
|
|
|
my $objs = join("\n", @objs);
|
|
|
|
my $deps = join(" ", @objs);
|
2016-03-02 11:29:56 +00:00
|
|
|
return <<"EOF";
|
2018-10-25 13:55:15 +00:00
|
|
|
$lib: $deps
|
|
|
|
\$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib @<<
|
2017-12-04 13:27:58 +00:00
|
|
|
$objs
|
2016-03-02 11:29:56 +00:00
|
|
|
<<
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
sub obj2bin {
|
|
|
|
my %args = @_;
|
2018-10-23 12:36:23 +00:00
|
|
|
my $bin = platform->bin($args{bin});
|
|
|
|
my @objs = map { platform->convertext($_) }
|
|
|
|
grep { platform->isobj($_) || platform->isres($_) }
|
|
|
|
@{$args{objs}};
|
2017-12-04 13:27:58 +00:00
|
|
|
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";
|
2018-10-23 12:36:23 +00:00
|
|
|
$bin: $deps
|
|
|
|
IF EXIST $bin.manifest DEL /F /Q $bin.manifest
|
|
|
|
\$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin @<<
|
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
|
|
|
<<
|
2018-10-23 12:36:23 +00:00
|
|
|
IF EXIST $bin.manifest \\
|
|
|
|
\$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin.manifest \$(MTOUTFLAG)$bin
|
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};
|
2018-10-23 12:36:23 +00:00
|
|
|
my @deps = map { platform->convertext($_) } @{$args{deps}};
|
2016-04-02 20:26:38 +00:00
|
|
|
my @actions = ();
|
2018-10-23 12:36:23 +00:00
|
|
|
my %extinfo = ( dso => platform->dsoext(),
|
|
|
|
lib => platform->libext(),
|
|
|
|
bin => platform->binext() );
|
2016-04-02 20:26:38 +00:00
|
|
|
|
2018-10-21 09:11:04 +00:00
|
|
|
# We already have a 'test' target, and the top directory is just plain
|
|
|
|
# silly
|
|
|
|
return if $dir eq "test" || $dir eq ".";
|
|
|
|
|
2016-04-02 20:26:38 +00:00
|
|
|
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";
|
2018-10-21 09:11:04 +00:00
|
|
|
$dir $dir\\ : $deps$actions
|
2016-03-02 11:29:56 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
"" # Important! This becomes part of the template result.
|
|
|
|
-}
|