Skip to content

Commit

Permalink
test: add makefile for test/loop
Browse files Browse the repository at this point in the history
To reduce code duplication, we add a Makefile for building the
`loop` executable.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Apr 15, 2023
1 parent 26575dd commit 53fe990
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ gen-proto:
bin/crit: cmd/cli.go
$(GO) build ${GOFLAGS} -o $@ $^

../test/loop/loop: ../test/loop/loop.c
$(CC) $^ -o $@
../test/loop/loop:
$(MAKE) -C ../test/loop

test-imgs: ../test/loop/loop
$(eval PID := $(shell ../test/loop/loop))
Expand Down
5 changes: 2 additions & 3 deletions test/crit/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CC ?= gcc
GO ?= go
CRIU ?= criu

Expand All @@ -22,8 +21,8 @@ test-imgs: ../loop/loop
../../crit/bin/crit:
$(MAKE) -C ../../crit bin/crit GOFLAGS="${GOFLAGS}"

../loop/loop: ../loop/loop.c
$(CC) $^ -o $@
../loop/loop:
$(MAKE) -C ../loop

crit-test: main.go
$(GO) build -v -o $@ $^
Expand Down
4 changes: 4 additions & 0 deletions test/loop/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CC ?= gcc

loop: loop.c
$(CC) $^ -o $@

0 comments on commit 53fe990

Please sign in to comment.