Deduplicate build files (Makefile + per-test Makefiles)#176
Merged
Conversation
Two pieces of pure duplication in the build system: - `src/Makefile` defined `TARGET_LIBRARIES` twice, identically. Remove the second (dead) copy. - The eight `test/<name>_test/Makefile` files were byte-for-byte identical except for the test name. Replace them with a shared `test/test.mk` that derives the test name from its directory (`$(notdir $(CURDIR))`); each per-test Makefile is now just `include ../test.mk`. The test build contract is unchanged: `test/common.jl` still invokes `make -sC test/<name> prefix=... CFLAGS=... LDFLAGS=...` and gets `$(prefix)/<name>$(EXE)` built and `run`-able. Note: the deeper packaging gap from the review (no pkg-config/CMake config export) is intentionally left for a separate follow-up, since shipping per-interface/per-target headers makes a correct `.pc` non-trivial. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two pieces of pure duplication in the build system:
src/MakefiledefinedTARGET_LIBRARIEStwice, identically — the second copy was dead. Removed it.Eight
test/<name>_test/Makefilefiles were byte-for-byte identical except for the test name (~100 lines of boilerplate). Replaced with a sharedtest/test.mkthat derives the test name from its directory ($(notdir $(CURDIR))). Each per-test Makefile is now a single line:include ../test.mkContract preserved
test/common.jlstill invokesmake -sC test/<name> prefix=... CFLAGS=... LDFLAGS=...and gets$(prefix)/<name>$(EXE)built andrun-able. Verified by building the library and compiling/linking a real test binary against it through the new shared rule.Out of scope (follow-up)
The review also flagged the lack of a
pkg-config/CMake config export. That's left for a separate PR: LBT ships per-interface (LP64/ILP64) and per-target headers, so a correct.pcis non-trivial and deserves its own discussion.Draft for review.