Skip to content

Conversation

@harp-intel
Copy link
Contributor

This pull request refactors and improves the tools/Makefile to make the build process for various tools more robust, maintainable, and efficient. The changes introduce reusable repository targets, standardized options for wget and git clone, and ensure idempotent builds for both x86_64 and aarch64 architectures. The Makefile now avoids redundant downloads and builds, and provides clearer structure for future maintenance.

Key improvements include:

Build Process Refactoring and Idempotency

  • Introduced repo-specific targets (e.g., dmidecode-repo, ethtool-repo, etc.) and changed tool targets to copy from these repos, avoiding repeated downloads and enabling idempotent builds. Now, tools are only rebuilt if their binaries are missing. [1] [2] [3]
  • Added checks to print messages when a tool is already built, reducing unnecessary work and improving clarity for users running the Makefile multiple times. [1] [2]

Download and Clone Options Standardization

  • Defined WGET_OPTS and GIT_CLONE_OPTS variables to standardize retry logic, timeouts, and shallow clone behavior for all downloads and git clones, improving reliability and speed. Applied these options throughout the Makefile. [1] [2] [3]

Version Handling and Consistency

  • Removed unnecessary quotes from version variables, making version handling more consistent and compatible with Makefile syntax. [1] [2] [3] [4]
  • Ensured all tools are checked out at specific versions/tags/commits, improving reproducibility and stability of builds. [1] [2] [3]

Architecture Support and Static Builds

  • Ensured all tools have clear targets for both x86_64 and aarch64, with proper cross-compilation flags and static build options where needed. [1] [2] [3]

Miscellaneous Improvements

  • Added new .PHONY targets for better Makefile hygiene and parallelization.
  • Improved source tarball handling for libraries required for static linking, using standardized download options.

These changes collectively make the build system more reliable, maintainable, and easier for future contributors to understand and extend.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel requested a review from Copilot December 30, 2025 05:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the tools/Makefile to improve build reliability, efficiency, and maintainability by introducing idempotent builds, standardized download/clone options, and cleaner dependency management.

Key changes:

  • Introduced repository-specific targets (e.g., dmidecode-repo) to separate cloning from building, enabling idempotent builds and avoiding redundant downloads
  • Standardized wget and git clone operations with retry logic and timeout options via WGET_OPTS and GIT_CLONE_OPTS variables
  • Removed unnecessary quotes from version variables for consistency with Makefile conventions

@harp-intel harp-intel merged commit cd2cafb into main Dec 30, 2025
5 checks passed
@harp-intel harp-intel deleted the tools-build-improve branch December 30, 2025 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants