virtiofsd/Makefile
German Maglione 03d9cbf2c5 Add a Makefile to create source files
Signed-off-by: German Maglione <gmaglione@redhat.com>
2024-07-17 16:51:33 +02:00

23 lines
619 B
Makefile

NAME := virtiofsd
VERSION ?= $(shell grep Version: virtiofsd.spec | tr -d ' ' | cut -f2 -d:)
.PHONY: all down-crate vendor clean
all: down-crate vendor clean
down-crate:
@echo Downloading version $(VERSION)
curl -L https://crates.io/api/v1/crates/$(NAME)/$(VERSION)/download -o $(NAME)-$(VERSION).crate
vendor:
# After vendorize we need to remove winapi/windows binaries
tar xf $(NAME)-$(VERSION).crate && \
pushd $(NAME)-$(VERSION) && \
cargo vendor && \
find vendor/ -name *.a -print0 | xargs -0 rm && \
tar Jcvf ../$(NAME)-$(VERSION)-vendor.tar.xz vendor/ && \
popd
clean:
rm -rf $(NAME)-$(VERSION)