Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve --build-targets= option #4189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
31 changes: 18 additions & 13 deletions src/build-data/makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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}$@

Expand Down Expand Up @@ -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)
Expand Down
Loading