-
Notifications
You must be signed in to change notification settings - Fork 2.1k
chore(dev): split VERSION-dependent packaging targets into Makefile.packaging #25101
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| # Makefile.packaging | ||
| # | ||
| # Packaging and release targets for Vector. | ||
| # Separated from the main Makefile so that `cargo vdev version` (needed for | ||
| # VERSION) is only executed when packaging/release targets are invoked. | ||
| # | ||
| # Usage: | ||
| # make -f Makefile.packaging <target> | ||
| # | ||
| # These targets are also accessible via the main Makefile, which forwards | ||
| # packaging and release targets here automatically. | ||
|
|
||
| VDEV := cargo vdev | ||
|
|
||
| # Set version — only evaluated when this Makefile is loaded | ||
| export VERSION ?= $(shell command -v cargo >/dev/null && $(VDEV) version || echo unknown) | ||
|
|
||
| # Delegate cross-compilation prerequisites to the main Makefile | ||
| target/%/release/vector.tar.gz: | ||
| $(MAKE) $@ | ||
|
|
||
| ##@ Packaging | ||
|
|
||
| # archives | ||
| target/artifacts/vector-${VERSION}-%.tar.gz: export TRIPLE :=$(@:target/artifacts/vector-${VERSION}-%.tar.gz=%) | ||
| target/artifacts/vector-${VERSION}-%.tar.gz: override PROFILE =release | ||
| target/artifacts/vector-${VERSION}-%.tar.gz: target/%/release/vector.tar.gz | ||
| @echo "Built to ${<}, relocating to ${@}" | ||
| @mkdir -p target/artifacts/ | ||
| @cp -v \ | ||
| ${<} \ | ||
| ${@} | ||
|
|
||
| .PHONY: package-x86_64-unknown-linux-gnu-all | ||
| package-x86_64-unknown-linux-gnu-all: package-x86_64-unknown-linux-gnu package-deb-x86_64-unknown-linux-gnu package-rpm-x86_64-unknown-linux-gnu # .tar.gz, .deb, .rpm | ||
|
|
||
| .PHONY: package-x86_64-unknown-linux-musl-all | ||
| package-x86_64-unknown-linux-musl-all: package-x86_64-unknown-linux-musl # .tar.gz | ||
|
|
||
| .PHONY: package-aarch64-unknown-linux-musl-all | ||
| package-aarch64-unknown-linux-musl-all: package-aarch64-unknown-linux-musl # .tar.gz | ||
|
|
||
| .PHONY: package-aarch64-unknown-linux-gnu-all | ||
| package-aarch64-unknown-linux-gnu-all: package-aarch64-unknown-linux-gnu package-deb-aarch64 package-rpm-aarch64 # .tar.gz, .deb, .rpm | ||
|
|
||
| .PHONY: package-armv7-unknown-linux-gnueabihf-all | ||
| package-armv7-unknown-linux-gnueabihf-all: package-armv7-unknown-linux-gnueabihf package-deb-armv7-gnu package-rpm-armv7hl-gnu # .tar.gz, .deb, .rpm | ||
|
|
||
| .PHONY: package-armv7-unknown-linux-musleabihf-all | ||
| package-armv7-unknown-linux-musleabihf-all: package-armv7-unknown-linux-musleabihf # .tar.gz | ||
|
|
||
| .PHONY: package-arm-unknown-linux-gnueabi-all | ||
| package-arm-unknown-linux-gnueabi-all: package-arm-unknown-linux-gnueabi package-deb-arm-gnu # .tar.gz, .deb | ||
|
|
||
| .PHONY: package-arm-unknown-linux-musleabi-all | ||
| package-arm-unknown-linux-musleabi-all: package-arm-unknown-linux-musleabi # .tar.gz | ||
|
|
||
| .PHONY: package-x86_64-unknown-linux-gnu | ||
| package-x86_64-unknown-linux-gnu: target/artifacts/vector-${VERSION}-x86_64-unknown-linux-gnu.tar.gz ## Build an archive suitable for the `x86_64-unknown-linux-gnu` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-x86_64-unknown-linux-musl | ||
| package-x86_64-unknown-linux-musl: target/artifacts/vector-${VERSION}-x86_64-unknown-linux-musl.tar.gz ## Build an archive suitable for the `x86_64-unknown-linux-musl` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-aarch64-unknown-linux-musl | ||
| package-aarch64-unknown-linux-musl: target/artifacts/vector-${VERSION}-aarch64-unknown-linux-musl.tar.gz ## Build an archive suitable for the `aarch64-unknown-linux-musl` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-aarch64-unknown-linux-gnu | ||
| package-aarch64-unknown-linux-gnu: target/artifacts/vector-${VERSION}-aarch64-unknown-linux-gnu.tar.gz ## Build an archive suitable for the `aarch64-unknown-linux-gnu` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-armv7-unknown-linux-gnueabihf | ||
| package-armv7-unknown-linux-gnueabihf: target/artifacts/vector-${VERSION}-armv7-unknown-linux-gnueabihf.tar.gz ## Build an archive suitable for the `armv7-unknown-linux-gnueabihf` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-armv7-unknown-linux-musleabihf | ||
| package-armv7-unknown-linux-musleabihf: target/artifacts/vector-${VERSION}-armv7-unknown-linux-musleabihf.tar.gz ## Build an archive suitable for the `armv7-unknown-linux-musleabihf triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-arm-unknown-linux-gnueabi | ||
| package-arm-unknown-linux-gnueabi: target/artifacts/vector-${VERSION}-arm-unknown-linux-gnueabi.tar.gz ## Build an archive suitable for the `arm-unknown-linux-gnueabi` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| .PHONY: package-arm-unknown-linux-musleabi | ||
| package-arm-unknown-linux-musleabi: target/artifacts/vector-${VERSION}-arm-unknown-linux-musleabi.tar.gz ## Build an archive suitable for the `arm-unknown-linux-musleabi` triple. | ||
| @echo "Output to ${<}." | ||
|
|
||
| # debs | ||
|
|
||
| .PHONY: package-deb-x86_64-unknown-linux-gnu | ||
| package-deb-x86_64-unknown-linux-gnu: package-x86_64-unknown-linux-gnu ## Build the x86_64 GNU deb package | ||
| TARGET=x86_64-unknown-linux-gnu $(VDEV) package deb | ||
|
|
||
| .PHONY: package-deb-x86_64-unknown-linux-musl | ||
| package-deb-x86_64-unknown-linux-musl: package-x86_64-unknown-linux-musl ## Build the x86_64 GNU deb package | ||
| TARGET=x86_64-unknown-linux-musl $(VDEV) package deb | ||
|
|
||
| .PHONY: package-deb-aarch64 | ||
| package-deb-aarch64: package-aarch64-unknown-linux-gnu ## Build the aarch64 deb package | ||
| TARGET=aarch64-unknown-linux-gnu $(VDEV) package deb | ||
|
|
||
| .PHONY: package-deb-armv7-gnu | ||
| package-deb-armv7-gnu: package-armv7-unknown-linux-gnueabihf ## Build the armv7-unknown-linux-gnueabihf deb package | ||
| TARGET=armv7-unknown-linux-gnueabihf $(VDEV) package deb | ||
|
|
||
| .PHONY: package-deb-arm-gnu | ||
| package-deb-arm-gnu: package-arm-unknown-linux-gnueabi ## Build the arm-unknown-linux-gnueabi deb package | ||
| TARGET=arm-unknown-linux-gnueabi $(VDEV) package deb | ||
|
|
||
| # rpms | ||
|
|
||
| .PHONY: package-rpm-x86_64-unknown-linux-gnu | ||
| package-rpm-x86_64-unknown-linux-gnu: package-x86_64-unknown-linux-gnu ## Build the x86_64 rpm package | ||
| TARGET=x86_64-unknown-linux-gnu $(VDEV) package rpm | ||
|
|
||
| .PHONY: package-rpm-x86_64-unknown-linux-musl | ||
| package-rpm-x86_64-unknown-linux-musl: package-x86_64-unknown-linux-musl ## Build the x86_64 musl rpm package | ||
| TARGET=x86_64-unknown-linux-musl $(VDEV) package rpm | ||
|
|
||
| .PHONY: package-rpm-aarch64 | ||
| package-rpm-aarch64: package-aarch64-unknown-linux-gnu ## Build the aarch64 rpm package | ||
| TARGET=aarch64-unknown-linux-gnu $(VDEV) package rpm | ||
|
|
||
| .PHONY: package-rpm-armv7hl-gnu | ||
| package-rpm-armv7hl-gnu: package-armv7-unknown-linux-gnueabihf ## Build the armv7hl-unknown-linux-gnueabihf rpm package | ||
| TARGET=armv7-unknown-linux-gnueabihf ARCH=armv7hl $(VDEV) package rpm | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.