1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
arch = $(shell dpkg-architecture -qDEB_HOST_ARCH)
changes = adequate-testpkg_1_$(arch).changes
.PHONY: all
all: $(changes)
$(info Run "make run" as root.)
$(info Alternatively, if you have user-mode-linux installed, you can try "make run-uml" as normal user.)
$(info )@:
.PHONY: changes
changes: $(changes)
$(changes):
cd testpkg && debian/rules debian/control
cd testpkg && dpkg-buildpackage -b -us -uc
.PHONY: run
run: $(changes)
./run-tests $(<)
.PHONY: run-uml
run-uml: $(changes)
fallocate -l 1G uml-guest-swap
linux init=$(CURDIR)/uml-guest-init \
$(shell printf '%s' '$(CURDIR)' | base64 -w0 | tr = _) \
$(shell printf '%s' '$(<)' | base64 -w0 | tr = _) \
rootfstype=hostfs ubd0=uml-guest-swap mem=128M quiet con=null,fd:1 \
| cat
.PHONY: clean
clean:
cd testpkg && debian/rules clean
$(RM) testpkg/debian/control
rm -f *.changes *.buildinfo *.deb
rm -f uml-guest-swap
# vim:ts=4 sts=4 sw=4 noet
|