diff --git a/configure.py b/configure.py index 96a1c255573..297897edf37 100755 --- a/configure.py +++ b/configure.py @@ -2192,6 +2192,8 @@ def test_exe_extra_ldflags(): 'build_fuzzers': options.build_fuzzers, 'build_examples': 'examples' in options.build_targets, + 'build_cli': 'cli' in options.build_targets, + 'build_tests': 'tests' in options.build_targets, 'build_coverage' : options.with_coverage_info, diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in index 6895950b4a6..ec4bfa7149d 100644 --- a/src/build-data/makefile.in +++ b/src/build-data/makefile.in @@ -36,12 +36,9 @@ INSTALLED_LIB_DIR = %{libdir} all: %{all_targets} # Executable targets -CLI = %{cli_exe} -TEST = %{test_exe} + LIBRARIES = %{library_targets} -cli: $(CLI) -tests: $(TEST) libs: $(LIBRARIES) docs: %{doc_stamp_file} @@ -63,27 +60,33 @@ distclean: install: %{install_targets} "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/install.py" --build-dir="%{build_dir}" -check: tests - "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/check.py" --build-dir="%{build_dir}" - fmt: "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/dev_tools/run_clang_format.py" tidy: "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/dev_tools/run_clang_tidy.py" --only-changed-files -# Object Files -LIBOBJS = %{join lib_objs} - -CLIOBJS = %{join cli_objs} +%{if build_cli} -TESTOBJS = %{join test_objs} +CLI = %{cli_exe} +cli: $(CLI) -# Executable targets +CLIOBJS = %{join cli_objs} $(CLI): $(LIBRARIES) $(CLIOBJS) $(EXE_LINK_CMD) $(ABI_FLAGS) $(CLIOBJS) $(BUILD_DIR_LINK_PATH) $(LANG_EXE_FLAGS) $(LDFLAGS) $(EXE_LINKS_TO) %{output_to_exe}$@ +%{endif} + +%{if build_tests} + +TEST = %{test_exe} +tests: $(TEST) +check: tests + "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/check.py" --build-dir="%{build_dir}" + +TESTOBJS = %{join test_objs} + $(TEST): $(LIBRARIES) $(TESTOBJS) $(EXE_LINK_CMD) $(ABI_FLAGS) $(TESTOBJS) $(BUILD_DIR_LINK_PATH) $(LANG_EXE_FLAGS) $(LDFLAGS) %{test_exe_extra_ldflags} $(EXE_LINKS_TO) %{output_to_exe}$@ @@ -121,6 +124,8 @@ bogo_shim: %{out_dir}/botan_bogo_shim # Library targets +LIBOBJS = %{join lib_objs} + %{if build_static_lib} %{out_dir}/%{static_lib_name}: $(LIBOBJS)