aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-12-01 00:19:58 -0500
committerJack Lloyd <[email protected]>2017-12-01 04:22:28 -0500
commit7e5ce9d4df54da881417bdbf2b9c4329081f10f6 (patch)
treebdab5c0c41909cefb0af8eb87420d85c33eeba7b /src/build-data
parenta201a07ea17b003bd0b373eadbfbc7711610505e (diff)
Merge the gnumake and nmake makefiles
Diffstat (limited to 'src/build-data')
-rw-r--r--src/build-data/cc/clang.txt6
-rw-r--r--src/build-data/cc/ekopath.txt4
-rw-r--r--src/build-data/cc/gcc.txt10
-rw-r--r--src/build-data/cc/hpcc.txt4
-rw-r--r--src/build-data/cc/icc.txt4
-rw-r--r--src/build-data/cc/msvc.txt7
-rw-r--r--src/build-data/cc/pgi.txt6
-rw-r--r--src/build-data/cc/sunstudio.txt4
-rw-r--r--src/build-data/cc/xlc.txt2
-rw-r--r--src/build-data/makefile.in117
-rw-r--r--src/build-data/makefile/gmake.in67
-rw-r--r--src/build-data/makefile/header.in57
-rw-r--r--src/build-data/makefile/nmake.in42
13 files changed, 133 insertions, 197 deletions
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt
index cfff2e2eb..ec4da317d 100644
--- a/src/build-data/cc/clang.txt
+++ b/src/build-data/cc/clang.txt
@@ -19,13 +19,11 @@ stack_protector_flags "-fstack-protector"
visibility_build_flags "-fvisibility=hidden"
visibility_attribute '__attribute__((visibility("default")))'
-makefile_style gmake
-
<so_link_commands>
-darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(INSTALLED_LIB_DIR)/$(SONAME_ABI) -current_version $(DARWIN_CURRENT_VER) -compatibility_version $(DARWIN_COMPATIBILITY_VER)"
+darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(INSTALLED_LIB_DIR)/{soname_abi} -current_version {darwin_so_current_ver} -compatibility_version {darwin_so_compat_ver}"
# The default works for GNU ld and several other Unix linkers
-default -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME_ABI)"
+default -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"
</so_link_commands>
<binary_link_commands>
diff --git a/src/build-data/cc/ekopath.txt b/src/build-data/cc/ekopath.txt
index c127b78f8..dedbaaf61 100644
--- a/src/build-data/cc/ekopath.txt
+++ b/src/build-data/cc/ekopath.txt
@@ -12,10 +12,8 @@ ar_options "-ar -o"
shared_flags "-fPIC"
-makefile_style gmake
-
<so_link_commands>
-default -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME_ABI)"
+default -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"
</so_link_commands>
<mach_opt>
diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt
index 88e7089ce..17b477db8 100644
--- a/src/build-data/cc/gcc.txt
+++ b/src/build-data/cc/gcc.txt
@@ -25,16 +25,14 @@ sanitizer_flags "-D_GLIBCXX_DEBUG -fsanitize=address"
visibility_build_flags "-fvisibility=hidden"
visibility_attribute '__attribute__((visibility("default")))'
-makefile_style gmake
-
<so_link_commands>
# The default works for GNU ld and several other Unix linkers
-default -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME_ABI)"
+default -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"
# Darwin, HP-UX and Solaris linkers use different syntax
-darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(LIBDIR)/$(SONAME_ABI)"
-hpux -> "$(CXX) -shared -fPIC -Wl,+h,$(SONAME_ABI)"
-solaris -> "$(CXX) -shared -fPIC -Wl,-h,$(SONAME_ABI)"
+darwin -> "$(CXX) -dynamiclib -fPIC -install_name $(INSTALLED_LIB_DIR)/{soname_abi}"
+hpux -> "$(CXX) -shared -fPIC -Wl,+h,{soname_abi}"
+solaris -> "$(CXX) -shared -fPIC -Wl,-h,{soname_abi}"
# AIX and OpenBSD don't use sonames at all
aix -> "$(CXX) -shared -fPIC"
diff --git a/src/build-data/cc/hpcc.txt b/src/build-data/cc/hpcc.txt
index aa305bf82..cbe50c37d 100644
--- a/src/build-data/cc/hpcc.txt
+++ b/src/build-data/cc/hpcc.txt
@@ -7,8 +7,6 @@ optimization_flags "+O2"
warning_flags "+w"
shared_flags "+Z"
-makefile_style gmake
-
<mach_abi_linking>
hppa1.0 -> "+DAportable"
hppa1.1 -> "+DA1.1"
@@ -16,5 +14,5 @@ hppa2.0 -> "+DA2.0W"
</mach_abi_linking>
<so_link_commands>
-default -> "$(CXX) +Z -b -Wl,+h,$(SONAME_ABI)" # Documented in cc(1), but not CC(1) (?)
+default -> "$(CXX) +Z -b -Wl,+h,{soname_abi}" # Documented in cc(1), but not CC(1) (?)
</so_link_commands>
diff --git a/src/build-data/cc/icc.txt b/src/build-data/cc/icc.txt
index cdc250187..f50ea6d11 100644
--- a/src/build-data/cc/icc.txt
+++ b/src/build-data/cc/icc.txt
@@ -9,8 +9,6 @@ lang_flags "-std=c++0x"
warning_flags "-w1"
shared_flags "-fPIC"
-makefile_style gmake
-
<mach_opt>
pentium3 -> "-march=pentium3"
pentium4 -> "-march=pentium4"
@@ -23,5 +21,5 @@ westmere -> "-march=core2"
</mach_opt>
<so_link_commands>
-default -> "$(CXX) -fPIC -shared -Wl,-soname,$(SONAME_ABI)"
+default -> "$(CXX) -fPIC -shared -Wl,-soname,{soname_abi}"
</so_link_commands>
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt
index 51608dcfa..6df218a4f 100644
--- a/src/build-data/cc/msvc.txt
+++ b/src/build-data/cc/msvc.txt
@@ -3,7 +3,9 @@ macro_name MSVC
binary_name cl
linker_name link
-output_to_option "/Fo"
+output_to_object "/Fo"
+output_to_exe "/OUT:"
+
add_include_dir_option "/I"
add_lib_dir_option "/LIBPATH:"
add_lib_option ""
@@ -27,8 +29,7 @@ visibility_attribute "__declspec(dllimport)"
ar_command lib
ar_options "/nologo"
-
-makefile_style nmake
+ar_output_to "/OUT:"
<isa_flags>
sse2 -> ""
diff --git a/src/build-data/cc/pgi.txt b/src/build-data/cc/pgi.txt
index e8c65ea3a..213a69d27 100644
--- a/src/build-data/cc/pgi.txt
+++ b/src/build-data/cc/pgi.txt
@@ -5,11 +5,9 @@ binary_name pgCC
optimization_flags "-fast -Minline"
shared_flags "-fPIC"
-makefile_style gmake
-
<so_link_commands>
-linux -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME_ABI)"
-solaris -> "$(CXX) -G -fPIC -Wl,-h,$(SONAME_ABI)"
+linux -> "$(CXX) -shared -fPIC -Wl,-soname,{soname_abi}"
+solaris -> "$(CXX) -G -fPIC -Wl,-h,{soname_abi}"
</so_link_commands>
<mach_opt>
diff --git a/src/build-data/cc/sunstudio.txt b/src/build-data/cc/sunstudio.txt
index fd87533a5..38f9d828c 100644
--- a/src/build-data/cc/sunstudio.txt
+++ b/src/build-data/cc/sunstudio.txt
@@ -11,10 +11,8 @@ lang_flags "-std=c++11 +p -features=extensions -D__FUNCTION__=__func__"
ar_command CC
ar_options "-xar -o"
-makefile_style gmake
-
<so_link_commands>
-default -> "$(CXX) -G -h$(SONAME_ABI)"
+default -> "$(CXX) -G -h{soname_abi}"
</so_link_commands>
<mach_opt>
diff --git a/src/build-data/cc/xlc.txt b/src/build-data/cc/xlc.txt
index 28620b7e1..c28fdb1a0 100644
--- a/src/build-data/cc/xlc.txt
+++ b/src/build-data/cc/xlc.txt
@@ -6,8 +6,6 @@ optimization_flags "-O2"
lang_flags "-std=c++11"
-makefile_style gmake
-
<mach_opt>
power8 -> "-qarch=pwr8"
power9 -> "-qarch=pwr9"
diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in
new file mode 100644
index 000000000..d89d1cccd
--- /dev/null
+++ b/src/build-data/makefile.in
@@ -0,0 +1,117 @@
+# Paths to relevant programs
+
+CXX = %{cxx} %{cxx_abi_flags}
+LINKER = %{linker}
+AR = %{ar_command}
+PYTHON_EXE = %{python_exe}
+
+# Compiler Flags
+
+LANG_FLAGS = %{cc_lang_flags}
+CXXFLAGS = %{cc_compile_flags}
+WARN_FLAGS = %{cc_warning_flags}
+SO_OBJ_FLAGS = %{shared_flags}
+
+LIB_LINK_CMD = %{lib_link_cmd}
+EXE_LINK_CMD = %{exe_link_cmd}
+
+LIB_LINKS_TO = %{link_to}
+EXE_LINKS_TO = %{link_to_botan} $(LIB_LINKS_TO)
+
+LIB_FLAGS = $(SO_OBJ_FLAGS) $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)
+EXE_FLAGS = $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)
+
+SCRIPTS_DIR = %{scripts_dir}
+INSTALLED_LIB_DIR = %{prefix}/%{libdir}
+
+CLI_POST_LINK_CMD = %{cli_post_link_cmd}
+TEST_POST_LINK_CMD = %{test_post_link_cmd}
+
+# The primary target
+all: libs cli tests
+
+# Executable targets
+CLI = %{cli_exe}
+TEST = %{test_exe}
+LIBRARIES = %{library_targets}
+
+cli: $(CLI)
+tests: $(TEST)
+libs: $(LIBRARIES)
+
+# Misc targets
+
+clean:
+ $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}"
+
+distclean:
+ $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}" --distclean
+
+install: $(CLI) docs
+ $(PYTHON_EXE) $(SCRIPTS_DIR)/install.py --prefix=%{prefix} --build-dir="%{build_dir}" --bindir=%{bindir} --libdir=%{libdir} --docdir=%{docdir} --includedir=%{includedir}
+
+docs:
+%{build_doc_commands}
+
+# Object Files
+LIBOBJS = %{lib_objs}
+
+CLIOBJS = %{cli_objs}
+
+TESTOBJS = %{test_objs}
+
+# Build Commands
+%{lib_build_cmds}
+
+%{cli_build_cmds}
+
+%{test_build_cmds}
+
+# Library targets
+
+$(CLI): $(LIBRARIES) $(CLIOBJS)
+ $(EXE_LINK_CMD) $(LDFLAGS) $(CLIOBJS) $(EXE_LINKS_TO) %{output_to_exe}$@
+ $(CLI_POST_LINK_CMD)
+
+$(TEST): $(LIBRARIES) $(TESTOBJS)
+ $(EXE_LINK_CMD) $(LDFLAGS) $(TESTOBJS) $(EXE_LINKS_TO) %{output_to_exe}$@
+ $(TEST_POST_LINK_CMD)
+
+%{if build_static_lib}
+
+%{out_dir}/%{static_lib_name}: $(LIBOBJS)
+ $(AR) %{ar_options} %{ar_output_to}$@ $(LIBOBJS)
+
+%{endif}
+
+%{if build_unix_shared_lib}
+
+%{out_dir}/%{shared_lib_name}: $(LIBOBJS)
+ $(LIB_LINK_CMD) $(LDFLAGS) $(LIBOBJS) $(LIB_LINKS_TO) %{output_to_exe}$@
+ cd %{out_dir} && ln -fs %{shared_lib_name} %{soname_base}
+ cd %{out_dir} && ln -fs %{shared_lib_name} %{soname_patch}
+
+%{endif}
+
+%{if build_msvc_shared_lib}
+
+%{out_dir}/%{shared_lib_name}: $(LIBOBJS)
+ $(LIB_LINK_CMD) $(LDFLAGS) $(LIBOBJS) $(LIB_LINKS_TO) %{output_to_exe}$@
+
+%{endif}
+
+%{if build_fuzzers}
+
+%{fuzzer_build_cmds}
+
+FUZZERS=%{fuzzer_bin}
+
+fuzzers: libs $(FUZZERS)
+
+fuzzer_corpus:
+ git clone --depth=1 https://github.com/randombit/crypto-corpus.git fuzzer_corpus
+
+fuzzer_corpus_zip: fuzzer_corpus
+ ./src/scripts/create_corpus_zip.py fuzzer_corpus %{fuzzobj_dir}
+
+%{endif}
diff --git a/src/build-data/makefile/gmake.in b/src/build-data/makefile/gmake.in
deleted file mode 100644
index 97084c7d8..000000000
--- a/src/build-data/makefile/gmake.in
+++ /dev/null
@@ -1,67 +0,0 @@
-%{header_in}
-
-# Object Files
-LIBOBJS = %{lib_objs}
-
-CLIOBJS = %{cli_objs}
-
-TESTOBJS = %{test_objs}
-
-# Build Commands
-%{lib_build_cmds}
-
-%{cli_build_cmds}
-
-%{test_build_cmds}
-
-# Library targets
-
-$(CLI): $(LIBRARIES) $(CLIOBJS)
- $(CLI_LINK_CMD) $(LDFLAGS) $(CLIOBJS) $(CLI_LINKS_TO) -o $(CLI)
- $(CLI_POST_LINK_CMD)
-
-$(TEST): $(LIBRARIES) $(TESTOBJS)
- $(TEST_LINK_CMD) $(LDFLAGS) $(TESTOBJS) $(TEST_LINKS_TO) -o $(TEST)
- $(TEST_POST_LINK_CMD)
-
-%{if build_static_lib}
-
-%{out_dir}/%{static_lib_name}: $(LIBOBJS)
- $(AR) %{ar_options} $@ $(LIBOBJS)
-
-%{endif}
-
-%{if build_shared_lib}
-
-SONAME_ABI = %{soname_abi}
-DARWIN_COMPATIBILITY_VER = %{version_packed}.%{abi_rev}.0
-DARWIN_CURRENT_VER = %{version_packed}.%{abi_rev}.%{version_patch}
-
-%{out_dir}/%{shared_lib_name}: $(LIBOBJS)
- $(LIB_LINK_CMD) $(LDFLAGS) $(LIBOBJS) $(LIB_LINKS_TO) -o $@
- cd %{out_dir} && ln -fs %{shared_lib_name} %{soname_base}
- cd %{out_dir} && ln -fs %{shared_lib_name} %{soname_patch}
-
-%{endif}
-
-%{if build_fuzzers}
-
-# Fuzzer build commands
-
-FUZZER_LINK_CMD = %{fuzzer_link_cmd}
-FUZZER_LINKS_TO = %{link_to_botan} $(LIB_LINKS_TO) %{fuzzer_libs}
-FUZZER_FLAGS = $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)
-
-%{fuzzer_build_cmds}
-
-FUZZERS=%{fuzzer_bin}
-
-fuzzers: libs $(FUZZERS)
-
-fuzzer_corpus:
- git clone --depth=1 https://github.com/randombit/crypto-corpus.git fuzzer_corpus
-
-fuzzer_corpus_zip: fuzzer_corpus
- ./src/scripts/create_corpus_zip.py fuzzer_corpus %{fuzzobj_dir}
-
-%{endif}
diff --git a/src/build-data/makefile/header.in b/src/build-data/makefile/header.in
deleted file mode 100644
index 95f39aca5..000000000
--- a/src/build-data/makefile/header.in
+++ /dev/null
@@ -1,57 +0,0 @@
-# Paths to relevant programs
-
-CXX = %{cxx} %{cxx_abi_flags}
-LINKER = %{linker}
-AR = %{ar_command}
-PYTHON_EXE = %{python_exe}
-
-# Compiler Flags
-
-LANG_FLAGS = %{cc_lang_flags}
-CXXFLAGS = %{cc_compile_flags}
-WARN_FLAGS = %{cc_warning_flags}
-SO_OBJ_FLAGS = %{shared_flags}
-
-LIB_LINK_CMD = %{lib_link_cmd}
-CLI_LINK_CMD = %{cli_link_cmd}
-TEST_LINK_CMD = %{test_link_cmd}
-
-LIB_LINKS_TO = %{link_to}
-CLI_LINKS_TO = %{link_to_botan} $(LIB_LINKS_TO)
-TEST_LINKS_TO = %{link_to_botan} $(LIB_LINKS_TO)
-
-LIB_FLAGS = $(SO_OBJ_FLAGS) $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)
-CLI_FLAGS = $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)
-TEST_FLAGS = $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)
-
-SCRIPTS_DIR = %{scripts_dir}
-INSTALLED_LIB_DIR = %{prefix}/%{libdir}
-
-CLI_POST_LINK_CMD = %{cli_post_link_cmd}
-TEST_POST_LINK_CMD = %{test_post_link_cmd}
-
-# The primary target
-all: libs cli tests
-
-# Executable targets
-CLI = %{cli_exe}
-TEST = %{test_exe}
-LIBRARIES = %{library_targets}
-
-cli: $(CLI)
-tests: $(TEST)
-libs: $(LIBRARIES)
-
-# Misc targets
-
-clean:
- $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}"
-
-distclean:
- $(PYTHON_EXE) $(SCRIPTS_DIR)/cleanup.py --build-dir="%{build_dir}" --distclean
-
-install: $(CLI) docs
- $(PYTHON_EXE) $(SCRIPTS_DIR)/install.py --prefix=%{prefix} --build-dir="%{build_dir}" --bindir=%{bindir} --libdir=%{libdir} --docdir=%{docdir} --includedir=%{includedir}
-
-docs:
-%{build_doc_commands}
diff --git a/src/build-data/makefile/nmake.in b/src/build-data/makefile/nmake.in
deleted file mode 100644
index dbd1a5af7..000000000
--- a/src/build-data/makefile/nmake.in
+++ /dev/null
@@ -1,42 +0,0 @@
-%{header_in}
-
-# Object Files
-LIBOBJS = %{lib_objs}
-
-CLIOBJS = %{cli_objs}
-
-TESTOBJS = %{test_objs}
-
-# Build Commands
-%{lib_build_cmds}
-
-%{cli_build_cmds}
-
-%{test_build_cmds}
-
-# LIB_FILENAME is always the .lib file, that is either a static lib or a
-# by-product of the DLL creation used to link the DLL into applications
-LIB_FILENAME = %{out_dir}/%{static_lib_name}
-
-# Link Commands
-$(CLI): $(LIBRARIES) $(CLIOBJS)
- $(CLI_LINK_CMD) /OUT:$@ $(CLIOBJS) $(LIB_FILENAME) $(CLI_LINKS_TO)
- $(CLI_POST_LINK_CMD)
-
-$(TEST): $(LIBRARIES) $(TESTOBJS)
- $(TEST_LINK_CMD) /OUT:$@ $(TESTOBJS) $(LIB_FILENAME) $(TEST_LINKS_TO)
- $(TEST_POST_LINK_CMD)
-
-%{if build_shared_lib}
-
-%{out_dir}/%{shared_lib_name}: $(LIBOBJS)
- $(LIB_LINK_CMD) /OUT:$@ $(LIBOBJS) $(LIB_LINKS_TO)
-
-%{endif}
-
-%{if build_static_lib}
-
-%{out_dir}/%{static_lib_name}: $(LIBOBJS)
- $(AR) %{ar_options} /OUT:$@ $(LIBOBJS)
-
-%{endif}