aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2019-08-07 13:38:38 +0200
committerPawel Wieczorek <p.wieczorek2@samsung.com>2019-08-07 14:35:08 +0200
commitab8186eb931abc8ae8664d377e8e7685c4cb2292 (patch)
tree0affad475969ff9e908ee23b1081513f912e4364
parent2b5b2e0ff77608cfdfc8a949076860672b38b93f (diff)
k8s: Add Makefile targets for external dependencies
Building "check" binary now requires several external dependencies. To minimize setup effort, convenience make targets were provided. Issue-ID: SECCOM-235 Change-Id: Iec74c0652a5ed3a90d4504216b00ef20bdb7e81f Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
-rw-r--r--test/security/k8s/.gitignore5
-rw-r--r--test/security/k8s/Makefile19
2 files changed, 20 insertions, 4 deletions
diff --git a/test/security/k8s/.gitignore b/test/security/k8s/.gitignore
index 3db554d59..6f63a3aa1 100644
--- a/test/security/k8s/.gitignore
+++ b/test/security/k8s/.gitignore
@@ -1,2 +1,7 @@
# Built binaries
/bin/check
+
+# Go packages, sources (except this project)
+/pkg/
+/src/*
+!/src/check/
diff --git a/test/security/k8s/Makefile b/test/security/k8s/Makefile
index b42e48acc..e7f978fc2 100644
--- a/test/security/k8s/Makefile
+++ b/test/security/k8s/Makefile
@@ -1,5 +1,7 @@
PROJECT = check
BIN_DIR = bin
+SRC_DIR = src
+PKG_DIR = pkg
BIN = check
all: run
@@ -10,15 +12,24 @@ run: build
build: $(BIN)
$(BIN): export GOPATH = $(shell pwd)
-$(BIN):
+$(BIN): deps
go install $(PROJECT)/cmd/$(BIN)
+deps: export GOPATH = $(shell pwd)
+deps:
+ go get $(PROJECT)/...
+
+clean_deps: export GOPATH = $(shell pwd)
+clean_deps:
+ go clean -i -r $(PROJECT)/... 2>/dev/null || true
+
test: export GOPATH = $(shell pwd)
test:
go test $(PROJECT)/...
-clean:
- -rm $(BIN_DIR)/$(BIN)
+clean: clean_deps
-rmdir $(BIN_DIR)
+ rm -rf $(PKG_DIR)
+ find $(SRC_DIR) -mindepth 1 -maxdepth 1 ! -name $(PROJECT) -exec rm -rf {} +
-.PHONY: all run build test clean $(BIN)
+.PHONY: all run build deps clean_deps test clean $(BIN)