-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
110 lines (83 loc) · 2.59 KB
/
Makefile
File metadata and controls
110 lines (83 loc) · 2.59 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
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
#
# SPDX-License-Identifier: Apache-2.0
PROJECTDIR = .
DIRS = \
src\
test\
test_modules\
include $(PROJECTDIR)/scripts/rules.mk
all: src
depend sdk src libs: lib bin deps.mk include/version.h .config
libs depend: FORCE
+cd src && $(MAKE) $@
libs: sdk
sdk: FORCE
+cd src && $(MAKE) libevp-app-sdk
pysdk: sdk
+cd src && $(MAKE) python-evp-app-sdk
lib bin:
mkdir -p $@
check: FORCE
$(MAKE) -f check.mk $@
check_test_config: FORCE
@if test "$(KBUILD_DEFCONFIG)" != "configs/unit-test-all-hubs-wasm.config";\
then\
echo "make: tests only can be executed using the unit-test-all-hubs-wasm configuration";\
echo "try make KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config" with a clean tree;\
exit 1;\
fi
test: check_test_config libs test_modules/tests pysdk
test_modules: sdk
# NOTE: Kept for backward compatibility with private tests
signed_test_modules: test_modules/signed
test_modules/tests: sdk
+cd test_modules && $(MAKE) elf wasm python
test_modules/wasm: sdk
+cd test_modules && $(MAKE) wasm
test_modules/elf:
+cd test_modules && $(MAKE) elf
test_modules/python:
+cd test_modules && $(MAKE) python
.PHONY: test_modules/python
test_modules/signed: test_modules
+cd test_modules && $(MAKE) signed
include/version.h: FORCE
@curhash=`awk '/AGENT_COMMIT_HASH/ {print $$3}' include/version.h 2>/dev/null` ;\
newhash=\"`git describe --always --abbrev=0 --dirty --match "NOT A TAG"`\";\
if test "$$curhash" != "$$newhash"; then\
trap "rm -f $$$$.tmp" EXIT INT TERM;\
(echo '#define AGENT_VERSION "$(VERSION)"';\
echo "#define AGENT_COMMIT_HASH $$newhash") > $$$$.tmp &&\
mv $$$$.tmp include/version.h;\
fi
config: .config
.config:
srctree=src/libevp-agent/linux \
KCONFIG_CONFIG=$(KBUILD_DEFCONFIG) \
python3 -m genconfig \
--config-out .config \
--header-path include/config.h
deps.mk: .config
$(SCRIPTDIR)/mkdeps.sh
cat $@
dist: all
$(SCRIPTDIR)/mk-agent-deb.sh -V $(VERSION) -a $(ARCH)
$(SCRIPTDIR)/mk-app-sdk-deb.sh -V $(SDK_VERSION) -a $(ARCH)
$(SCRIPTDIR)/mk-agent-sdk-deb.sh -V $(SDK_VERSION) -a $(ARCH)
clean:
cd test && $(MAKE) clean
rm -rf bin lib
rm -rf include/psa
rm -rf include/flatcc include/mbedtls
rm -rf include/sdkenc
rm -rf include/lib_export.h include/version.h include/parson.h
rm -f include/wasm_c_api.h include/wasm_export.h
rm -f libevp-app-sdk-*.tar.gz libevp-app-sdk-*.deb
rm -f compile_commands.json analysis.txt
rm -rf dist
distclean:
rm -f .config deps.mk
rm -f include/config.h
git submodule foreach \
'cd $$toplevel && git submodule deinit --force $$sm_path'