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