include xhyve.mk

# Downloads xhyve files to make this library Go gettable.
# It also applies a patch to rename the main function so we can use xhyve
# as a library instead.
upstream:
	git clone https://github.com/mist64/xhyve.git vendor/xhyve
	-cd vendor/xhyve; patch -N -p1 < ../../xhyve.patch
	find . \( -name \*.orig -o -name \*.rej \) -delete
	for file in $(SRC); do \
		cp -f $$file $$(basename $$file) ; \
	done
	cp -r vendor/xhyve/include include

clean:
	rm -rf *.c vendor include

.PHONY: upstream clean

include xhyve.mk

build:
	go build -o xhyve cmd/xhyve/main.go

clone-xhyve:
	-git clone https://github.com/xhyve-xyz/xhyve.git vendor/xhyve

sync: clone-xhyve apply-patch
	find . \( -name \*.orig -o -name \*.rej \) -delete
	for file in $(SRC); do \
		cp -f $$file $$(basename $$file) ; \
	done
	cp -r vendor/xhyve/include include

apply-patch:
	-cd vendor/xhyve; patch -N -p1 < ../../xhyve.patch

generate-patch: apply-patch
	cd vendor/xhyve; git diff > ../../xhyve.patch

clean:
	rm -rf *.c vendor include

.PHONY: build clone-xhyve sync apply-patch generate-patch clean

Change upstream to latest of xhyve-xyz/xhyve
Change upstream to latest of xhyve-xyz/xhyve

Signed-off-by: Koichi Shiraishi <2e5bdfebde234ed3509bcfc18121c70b6631e207@gmail.com>
