forked from mixbytes/haya
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
49 lines (40 loc) · 1.52 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
# default OS; possible values: ubuntu, centos
os := ubuntu
# guess organization and project name by root directory name
root_dir := $(shell basename "$(dir $(abspath $(lastword $(MAKEFILE_LIST))))" )
org := $(shell case "$(root_dir)" in (daobet*) echo daocasino ;; (haya*) echo mixbytes ;; esac )
project := $(shell case "$(root_dir)" in (daobet*) echo daobet ;; (haya*) echo haya ;; esac )
build_env_img_name := $(org)/$(project).build-env.$(os)
contracts_env_img_name := $(org)/$(project)-with-cdt.$(os)
default: help
.PHONY: help
help:
@echo "Targets:"
@echo
@echo " build-env-img : build $(build_env_img_name) docker image"
@echo " (add 'os=centos' option to build for CentOS)"
@echo " contracts-env-img : build $(contracts_env_img_name) docker image"
@echo " (add 'os=centos' option to build for CentOS)"
@echo
@echo " tags : generate tags file via ctags"
@echo " clean : remove all build artifacts (build/*)"
.PHONY: build-env-img
build-env-img:
docker build \
--build-arg project="$(project)" \
--target node-build-env \
--tag "$(build_env_img_name)" \
-f cicd/Dockerfile.build-env.$(os) .
.PHONY: contracts-env-img
contracts-env-img:
docker build \
--build-arg project="$(project)" \
--target node-with-cdt \
--tag "$(contracts_env_img_name)" \
-f cicd/Dockerfile.build-env.$(os) .
.PHONY: tags
tags:
ctags -R --exclude=plugins/telemetry_plugin/lib/prometheus-cpp/3rdparty --exclude=build .
.PHONY: clean
clean:
rm -rf build/*