-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (78 loc) · 2.41 KB
/
Makefile
File metadata and controls
98 lines (78 loc) · 2.41 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
# Edge Orchestration-I API Makefile
# SPDX-FileCopyrightText: (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
.DEFAULT_GOAL := help
.PHONY: build test lint license help generate
##### Variables #####
# Defining the shell, users and groups
SHELL := bash -e -o pipefail
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
# Project variables
PROJECT_NAME := hook-os
BINARY_NAME := hook-os
# Code versions, tags, and so on
VERSION ?= $(shell cat VERSION)
VERSION_MAJOR ?= $(shell cut -c 1 VERSION)
IMG_NAME ?= ${PROJECT_NAME}
IMG_VERSION ?= $(VERSION)
GIT_COMMIT ?= $(shell git rev-parse HEAD)
# Create the virtualenv with python tools installed
VENV_NAME = venv_hookos
$(VENV_NAME): requirements.txt
echo "Creating virtualenv $@"
python3 -m venv $@;\
. ./$@/bin/activate; set -u;\
python3 -m pip install --upgrade pip;\
python3 -m pip install -r requirements.txt
all:
@# Help: Runs build, lint, test stages
build lint test
build:
@# Help: Runs build stage
@echo "---MAKEFILE BUILD---"
@echo "--Updated step below--"
chmod +x build_hookos.sh && bash build_hookos.sh && rm -rf hook.hook-default-amd64.yaml
@echo "---END MAKEFILE Build---"
dev-build:
@# Help: Runs build stage
@echo "---MAKEFILE DEV BUILD---"
@echo "--Updated step below--"
chmod +x build_hookos.sh && bash -x build_hookos.sh
@echo "---END MAKEFILE Build---"
lint-ci: license
# Maintenance and lint targets
license: $(VENV_NAME) ## Check licensing with the reuse tool.
. ./$</bin/activate; set -u;\
reuse --version;\
reuse --root . lint
lint:
@# Help: Runs lint stage
@echo "---MAKEFILE LINT---"
echo $@
@echo "---END MAKEFILE LINT---"
test:
@# Help: Runs test stage
@echo "---MAKEFILE TEST---"
echo $@
@echo "---END MAKEFILE TEST---"
coverage:
@# Help: Runs coverage stage
@echo "---MAKEFILE COVERAGE---"
echo $@
@echo "---END MAKEFILE COVERAGE---"
list:
@# Help: displays make targets
help
clean:
@# Help: displays make targets
sudo rm -rf out
rm -rf cache kernel/patches-5.10.y
help:
@printf "%-20s %s\n" "Target" "Description"
@printf "%-20s %s\n" "------" "-----------"
@make -pqR : 2>/dev/null \
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \
| sort \
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$' \
| xargs -I _ sh -c 'printf "%-20s " _; make _ -nB | (grep -i "^# Help:" || echo "") | tail -1 | sed "s/^# Help: //g"'