runsvinit/zombietest/Makefile

28 lines
758 B
Makefile
Raw Normal View History

2015-10-07 13:39:45 +00:00
GO ?= go
SUDO ?=
RMCONTAINER ?= --rm
2015-09-28 20:46:18 +00:00
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-07 13:39:45 +00:00
$(SUDO) docker run $(RMCONTAINER) -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