File: Makefile

package info (click to toggle)
golang-github-checkpoint-restore-go-criu 7.2.0%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 1,796 kB
  • sloc: makefile: 231; ansic: 195; python: 137; sh: 110
file content (27 lines) | stat: -rw-r--r-- 547 bytes parent folder | download
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
GO ?= go
CRIU ?= criu
CRIT_SRC := $(shell find . -type f -name '*.go')
CRIT_CLI := cmd/main.go

bin/crit: $(CRIT_SRC)
	$(GO) build ${GOFLAGS} -o $@ $(CRIT_CLI)

../test/loop/loop:
	$(MAKE) -C ../test/loop

test-imgs: ../test/loop/loop
	$(eval PID := $(shell ../test/loop/loop))
	mkdir -p $@
	$(CRIU) dump -v4 -o dump.log -D $@ -t $(PID)
	$(CRIU) restore -v4 -o restore.log -D $@ -d
	pkill -9 loop

unit-test: test-imgs
	$(eval GOFLAGS ?= -cover)
	$(GO) test ${GOFLAGS} -v ./...

clean:
	@rm -f bin/crit
	@rm -rf test-imgs

.PHONY: unit-test clean