-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (65 loc) · 2.44 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#Defining variables
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /usr/bin/env bash
OUT_DIR ?= _output
BIN_DIR := $(OUT_DIR)/bin
PRINT_HELP ?=
PREFIX ?= /usr/local/sysadm
REGISTRYvER ?= v2.7.0
BUILD_IMAGE ?=
DEPLOY ?=
IMAGEVER ?= v1.4
# DEPLOYTYPE is one of "", "k8s","k8scurl","rsync", "compose"
DEPLOYTYPE ?=
WHAT ?=
.PHONY: all
ifeq ($(PRINT_HELP),y)
all:
build/help_info.sh all
else
all:
build/build.sh "$(WHAT)" "$(BUILD_IMAGE)" "$(IMAGEVER)" "$(DEPLOY)" "$(DEPLOYTYPE)"
endif
.PHONY: apiserver
apiserver:
$(info Now building apiserver package. apiserver binary file will be placed into "$(BIN_DIR)")
build/build.sh "apiserver" "$(BUILD_IMAGE)" "$(IMAGEVER)" "$(DEPLOY)" "$(DEPLOYTYPE)"
.PHONY: sysadm
sysadm:
$(info Now building sysadm package. sysadm binary file will be placed into "$(BIN_DIR)")
build/build.sh "sysadm" "$(BUILD_IMAGE)" "$(IMAGEVER)" "$(DEPLOY)" "$(DEPLOYTYPE)"
# go build -o $(BIN_DIR)/sysadm
.PHONY: registryctl
registryctl:
$(info Now building registryctl package. registryctl binary file will be placed into "$(BIN_DIR)")
build/build.sh "registryctl" "$(BUILD_IMAGE)" "$(IMAGEVER)" "$(DEPLOY)" "$(DEPLOYTYPE)"
.PHONY: agent
agent:
$(info Now building agent package. agent binary file will be placed into "$(BIN_DIR)")
build/build.sh "agent" "$(BUILD_IMAGE)" "$(IMAGEVER)" "$(DEPLOY)" "$(DEPLOYTYPE)"
.PHONY: registry
registry:
$(info Now building registry binary package. registry binary package file will be placed into "$(BIN_DIR)")
build/build_registry_binary.sh $(REGISTRYvER)
ifeq ($(BUILD_IMAGE),y)
build/build_registry_image.sh $(IMAGEVER) "$(DEPLOYTYPE)"
endif
.PHONY: infrastructure
infrastructure:
$(info Now building infrastructure package. infrastructure binary file will be placed into "$(BIN_DIR)")
build/build.sh "infrastructure" "$(BUILD_IMAGE)" "$(IMAGEVER)" "$(DEPLOY)" "$(DEPLOYTYPE)"
.PHONY: install
install:
test -d '$(PREFIX)/bin' || mkdir -p '$(PREFIX)/bin'
install '$(BIN_DIR)/sysadm' '$(PREFIX)/bin/'
test -d '$(PREFIX)/conf' || mkdir -p '$(PREFIX)/conf'
install '$(OUT_DIR)/conf/config.yaml' '$(PREFIX)/conf/'
test -d '$(PREFIX)/logs' || mkdir -p '$(PREFIX)/logs'
test -d '$(PREFIX)/formstmpl' || mkdir -p '$(PREFIX)/formstmpl'
install '$(OUT_DIR)/formstmpl/*' '$(PREFIX)/formstmpl'
test -d '$(PREFIX)/html' || mkdir -p '$(PREFIX)/html'
install '$(OUT_DIR)/html/*' '$(PREFIX)/html'
.PHONY: clean
clean:
$(info Cleaning building cached files.....)
rm $(BIN_DIR)/*