2015-09-28 20:46:18 +00:00
|
|
|
GO?=go
|
|
|
|
SUDO?=
|
|
|
|
RM?=--rm
|
|
|
|
|
2015-09-28 20:30:44 +00:00
|
|
|
.PHONY: test clean
|
|
|
|
|
|
|
|
test: .test.uptodate
|
|
|
|
./test.bash
|
|
|
|
|
|
|
|
.test.uptodate: runsvinit zombie run-zombie Dockerfile
|
2015-09-28 20:46:18 +00:00
|
|
|
$(SUDO) docker build -t zombietest .
|
2015-09-28 20:30:44 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
runsvinit: ../*.go
|
2015-09-28 20:46:18 +00:00
|
|
|
env GOOS=linux GOARCH=amd64 $(GO) build -o $@ github.com/peterbourgon/runsvinit
|
2015-09-28 20:30:44 +00:00
|
|
|
|
|
|
|
zombie: .build.uptodate
|
2015-10-01 01:04:55 +00:00
|
|
|
$(SUDO) docker run $$RM -v $(shell pwd):/mount zombietest-build cc -Wall -Werror -o /mount/zombie /zombie.c
|
2015-09-28 20:30:44 +00:00
|
|
|
|
|
|
|
.build.uptodate: build/zombie.c build/Dockerfile
|
2015-09-28 20:46:18 +00:00
|
|
|
$(SUDO) docker build -t zombietest-build build/
|
2015-09-28 20:30:44 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf .test.uptodate .build.uptodate runsvinit zombie
|
2015-09-28 20:46:18 +00:00
|
|
|
$(SUDO) docker stop zombietest zombietest-build >/dev/null 2>&1 || true
|
|
|
|
$(SUDO) docker rm zombietest zombietest-build >/dev/null 2>&1 || true
|