Makefile: Create dynamic build targets#1438
Merged
jabrown85 merged 1 commit intobuildpacks:mainfrom Jan 10, 2025
Merged
Conversation
Contributor
|
Nice - I'm not sure which approach I prefer either. I think I'm fine with either approach having only seen the diff for the dynamic one here. This PR will have to wait until we've release a last windows lifecycle release in the next week or two. |
c813b1c to
2a95f27
Compare
Signed-off-by: Robert Gogolok <robert.gogolok@stackit.cloud>
2a95f27 to
89aeb9c
Compare
jabrown85
approved these changes
Jan 10, 2025
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.
Summary
Use a Makefile function to create dynamic build targets so it's simple to add new GOOS/GOARCH combinations if required. The duplication of Makefile code is reduced.
Related
#1171
Context
My 'overall goal' is still to get some FreeBSD support as attempted in #1271 and #1087 .
I thought it might make sense to help out with #1171 and come up with a simpler Makefile so that other GOOS/GOARCH can be added more easily. I'm not a Makefile expert.
I've left windows out since it might get removed soon.
I've left out the darwin build targets for the time being.
Other Makefile targets like the package targets can be implemented in a similar way once this attempt is accepted of being worth it.
I wonder (and this contradicts this attempt in this PR) whether the Makefile should just work with GOOS and GOARCH set outside the Makefile and the .github workflows to create releases should actually have several
make build(or make package or ...) runs to create individual binaries/packages/whatsoever.For this PR and the attempt at making the Makefile more dynamic I see the following advantages and disadvantages:
Advantages
Disadvantages