forked from rancher/elemental-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
155 lines (125 loc) · 2.66 KB
/
Makefile
File metadata and controls
155 lines (125 loc) · 2.66 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#
# cOS-toolkit Makefile
#
#
#----------------------- global variables -----------------------
#
# Path to luet binary
#
export LUET?=$(shell which luet 2> /dev/null)
ifeq ("$(LUET)","")
LUET="/usr/bin/luet"
endif
#
# Path to jq binary
#
export JQ?=$(shell which jq 2> /dev/null)
ifeq ("$(JQ)","")
JQ="/usr/bin/jq"
endif
#
# Path to yq binary
#
export YQ?=$(shell which yq 2> /dev/null)
ifeq ("$(YQ)","")
YQ="/usr/bin/yq"
endif
#
# Path to luet-makeiso binary
#
export MAKEISO?=$(shell which luet-makeiso 2> /dev/null)
ifeq ("$(MAKEISO)","")
MAKEISO="/usr/bin/luet-makeiso"
endif
#
# Path to luet-mtree binary
#
export MTREE?=$(shell which luet-mtree 2> /dev/null)
ifeq ("$(MTREE)","")
MTREE="/usr/bin/luet-mtree"
endif
#
# Output for "make publish-repo" and base for "make iso"
#
FINAL_REPO?=quay.io/costoolkit/releases-$(FLAVOR)
#
# Location of package tree
#
TREE?=$(ROOT_DIR)/packages
#
# Directory of Makefile
#
export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
#
# OS flavor to build
#
FLAVOR?=green
#
# folder for build artefacts
#
DESTINATION?=$(ROOT_DIR)/build
#
# yaml specification of build targets
#
export MANIFEST?=$(ROOT_DIR)/manifest.yaml
#
# Arguments to packer for creating the ISO
#
PACKER_ARGS?=
#
# Used by .iso, .test, and .run
#
ISO?=$(shell ls $(ROOT_DIR)/*.iso 2> /dev/null)
#----------------------- end global variables -----------------------
#----------------------- default target -----------------------
all: deps build
#----------------------- includes -----------------------
include make/Makefile.build
include make/Makefile.iso
include make/Makefile.run
include make/Makefile.test
include make/Makefile.images
#----------------------- targets -----------------------
deps: $(LUET) $(YQ) $(JQ) $(MAKEISO) $(MTREE)
as_root:
ifneq ($(shell id -u), 0)
@echo "Please run 'make $@' as root"
@exit 1
endif
$(LUET):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(ROOT_DIR)/scripts/get_luet.sh
endif
$(YQ):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/yq
endif
$(JQ):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y utils/jq
endif
$(MAKEISO):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/luet-makeiso
endif
$(MTREE):
ifneq ($(shell id -u), 0)
@echo "'$@' is missing and you must be root to install it."
@exit 1
else
$(LUET) install -y toolchain/luet-mtree
endif
clean: clean_build clean_iso clean_run clean_test
rm -rf $(ROOT_DIR)/*.sha256