-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
43 lines (32 loc) · 894 Bytes
/
Makefile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## Folder content generated files
BUILD_FOLDER = ./build
## command
GO = go
GO_VENDOR = go mod
MKDIR_P = mkdir -p
## Random Alphanumeric String
SECRET_KEY = $(shell cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
## UNAME
UNAME := $(shell uname)
################################################
.PHONY: all
all: build
.PHONY: pre-build
pre-build:
$(MAKE) download
.PHONY: build
build: pre-build
$(MAKE) src.build
.PHONY: clean
clean:
$(RM) -rf $(BUILD_FOLDER)
## vendor/ #####################################
.PHONY: download
download:
$(GO_VENDOR) vendor
## src/ ########################################
.PHONY: src.build
src.build:
$(MKDIR_P) $(BUILD_FOLDER)/pkg/cmd/sample-container-runtime/
GO111MODULE=on $(GO) build -mod=vendor -v -o $(BUILD_FOLDER)/pkg/cmd/sample-container-runtime/sample-container-runtime \
./cmd/container-runtime