1b1fb9a63SFam Zheng# Makefile for VM tests 2b1fb9a63SFam Zheng 3b1fb9a63SFam Zheng.PHONY: vm-build-all 4b1fb9a63SFam Zheng 5*1bd26988SFam ZhengIMAGES := ubuntu.i386 freebsd netbsd openbsd centos 6b1fb9a63SFam ZhengIMAGE_FILES := $(patsubst %, tests/vm/%.img, $(IMAGES)) 7b1fb9a63SFam Zheng 8b1fb9a63SFam Zheng.PRECIOUS: $(IMAGE_FILES) 9b1fb9a63SFam Zheng 10b1fb9a63SFam Zhengvm-test: 11b1fb9a63SFam Zheng @echo "vm-test: Test QEMU in preconfigured virtual machines" 12b1fb9a63SFam Zheng @echo 13b1fb9a63SFam Zheng @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" 14b1fb9a63SFam Zheng @echo " vm-build-freebsd - Build QEMU in FreeBSD VM" 15b1fb9a63SFam Zheng @echo " vm-build-netbsd - Build QEMU in NetBSD VM" 16b1fb9a63SFam Zheng @echo " vm-build-openbsd - Build QEMU in OpenBSD VM" 17*1bd26988SFam Zheng @echo " vm-build-centos - Build QEMU in CentOS VM, with Docker" 18b1fb9a63SFam Zheng 19b1fb9a63SFam Zhengvm-build-all: $(addprefix vm-build-, $(IMAGES)) 20b1fb9a63SFam Zheng 21b1fb9a63SFam Zhengtests/vm/%.img: $(SRC_PATH)/tests/vm/% \ 22b1fb9a63SFam Zheng $(SRC_PATH)/tests/vm/basevm.py \ 23b1fb9a63SFam Zheng $(SRC_PATH)/tests/vm/Makefile.include 24b1fb9a63SFam Zheng $(call quiet-command, \ 25b1fb9a63SFam Zheng $< \ 26b1fb9a63SFam Zheng $(if $(V)$(DEBUG), --debug) \ 27b1fb9a63SFam Zheng --image "$@" \ 28b1fb9a63SFam Zheng --force \ 29b1fb9a63SFam Zheng --build-image $@, \ 30b1fb9a63SFam Zheng " VM-IMAGE $*") 31b1fb9a63SFam Zheng 32b1fb9a63SFam Zheng 33b1fb9a63SFam Zheng# Build in VM $(IMAGE) 34b1fb9a63SFam Zhengvm-build-%: tests/vm/%.img 35b1fb9a63SFam Zheng $(call quiet-command, \ 36b1fb9a63SFam Zheng $(SRC_PATH)/tests/vm/$* \ 37b1fb9a63SFam Zheng $(if $(V)$(DEBUG), --debug) \ 38b1fb9a63SFam Zheng $(if $(DEBUG), --interactive) \ 39b1fb9a63SFam Zheng $(if $(J),--jobs $(J)) \ 40b1fb9a63SFam Zheng --image "$<" \ 41b1fb9a63SFam Zheng --build-qemu $(SRC_PATH), \ 42b1fb9a63SFam Zheng " VM-BUILD $*") 43b1fb9a63SFam Zheng 44