-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathMakefile.am
More file actions
152 lines (133 loc) · 4.43 KB
/
Copy pathMakefile.am
File metadata and controls
152 lines (133 loc) · 4.43 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
# includes append to these:
bin_PROGRAMS =
noinst_HEADERS =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
noinst_PROGRAMS =
nobase_include_HEADERS =
check_PROGRAMS =
dist_noinst_SCRIPTS =
#includes additional rules from aminclude.am
@INC_AMINCLUDE@
DISTCLEANFILES = aminclude.am wolfssh-config
exampledir = $(docdir)/example
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = LICENSING README.md ChangeLog.md
include src/include.am
include wolfssh/include.am
include apps/include.am
include examples/include.am
include tests/include.am
include keys/include.am
include ide/include.am
include scripts/include.am
TEST_EXTENSIONS = .test
check_SCRIPTS = $(dist_noinst_SCRIPTS)
TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
test: check
maintainer-clean-local:
-rm Makefile.in
-rm aclocal.m4
-rm build-aux/compile
-rm build-aux/config.guess
-rm build-aux/config.sub
-rm build-aux/depcomp
-rm build-aux/install-sh
-rm build-aux/ltmain.sh
-rm build-aux/missing
-rm wolfssh-config
-rmdir build-aux
-rm configure
-rm config.log
-rm config.status
-rm config.in
-rm m4/libtool.m4
-rm m4/ltoptions.m4
-rm m4/ltsugar.m4
-rm m4/ltversion.m4
-rm m4/lt~obsolete.m4
find . -type f -name '*~' -exec rm -f '{}' \;
-rm -f @PACKAGE@-*.tar.gz
-rm -f @PACKAGE@-*.rpm
install-exec-local: install-generic-config
install-generic-config:
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) @GENERIC_CONFIG@ $(DESTDIR)$(bindir)
uninstall-local:
-rm -f $(DESTDIR)$(bindir)/@GENERIC_CONFIG@
merge-clean:
@find ./ | $(GREP) \.gcda | xargs rm -f
@find ./ | $(GREP) \.gcno | xargs rm -f
@find ./ | $(GREP) \.gz | xargs rm -f
@find ./ | $(GREP) \.orig | xargs rm -f
@find ./ | $(GREP) \.rej | xargs rm -f
@find ./ | $(GREP) \.rpm | xargs rm -f
@find ./ | $(GREP) \.THIS | xargs rm -f
@find ./ | $(GREP) \.OTHER | xargs rm -f
@find ./ | $(GREP) \.BASE | xargs rm -f
@find ./ | $(GREP) \~$$ | xargs rm -f
# SBOM generation (CRA compliance)
SBOM_CDX = wolfssh-$(PACKAGE_VERSION).cdx.json
SBOM_SPDX = wolfssh-$(PACKAGE_VERSION).spdx.json
SBOM_SPDX_TV = wolfssh-$(PACKAGE_VERSION).spdx
sbomdir = $(datadir)/doc/$(PACKAGE)
.PHONY: sbom install-sbom uninstall-sbom
sbom:
@if test -z "$(PYTHON3)"; then \
echo ""; \
echo "ERROR: 'python3' not found in PATH. Cannot generate SBOM."; \
echo ""; \
exit 1; \
fi
@if test -z "$(PYSPDXTOOLS)"; then \
echo ""; \
echo "ERROR: 'pyspdxtools' not found in PATH. Cannot validate SBOM."; \
echo " Install: pip install spdx-tools"; \
echo ""; \
exit 1; \
fi
@if test -z "$(WOLFSSL_DIR)"; then \
echo ""; \
echo "ERROR: WOLFSSL_DIR is not set. Cannot locate gen-sbom."; \
echo " Re-run: make sbom WOLFSSL_DIR=/path/to/wolfssl"; \
echo ""; \
exit 1; \
fi
@if test ! -f "$(WOLFSSL_DIR)/scripts/gen-sbom"; then \
echo ""; \
echo "ERROR: $(WOLFSSL_DIR)/scripts/gen-sbom not found."; \
echo " Use a wolfSSL tree that includes SBOM support."; \
echo ""; \
exit 1; \
fi
rm -rf $(abs_builddir)/_sbom_staging $(abs_builddir)/_sbom_defines.h
$(MAKE) install DESTDIR=$(abs_builddir)/_sbom_staging
$(CC) -dM -E -I$(srcdir) $(CPPFLAGS) -x c /dev/null \
> $(abs_builddir)/_sbom_defines.h
@set -e; \
_so=$$(ls $(abs_builddir)/_sbom_staging$(libdir)/libwolfssh.so.[0-9]*.[0-9]*.[0-9]* 2>/dev/null | head -1); \
test -n "$$_so" || { echo "ERROR: libwolfssh.so not found in staging dir" >&2; exit 1; }; \
$(PYTHON3) $(WOLFSSL_DIR)/scripts/gen-sbom \
--name wolfssh \
--version $(PACKAGE_VERSION) \
--supplier "wolfSSL Inc." \
--license-file $(srcdir)/LICENSING \
--options-h $(abs_builddir)/_sbom_defines.h \
--lib "$$_so" \
$(if $(SBOM_LICENSE_OVERRIDE),--license-override $(SBOM_LICENSE_OVERRIDE)) \
$(if $(SBOM_LICENSE_TEXT),--license-text $(SBOM_LICENSE_TEXT)) \
--cdx-out $(abs_builddir)/$(SBOM_CDX) \
--spdx-out $(abs_builddir)/$(SBOM_SPDX)
rm -rf $(abs_builddir)/_sbom_staging $(abs_builddir)/_sbom_defines.h
$(PYSPDXTOOLS) --infile $(abs_builddir)/$(SBOM_SPDX) \
--outfile $(abs_builddir)/$(SBOM_SPDX_TV)
install-sbom: sbom
$(MKDIR_P) $(DESTDIR)$(sbomdir)
$(INSTALL_DATA) $(SBOM_CDX) $(DESTDIR)$(sbomdir)/
$(INSTALL_DATA) $(SBOM_SPDX) $(DESTDIR)$(sbomdir)/
$(INSTALL_DATA) $(SBOM_SPDX_TV) $(DESTDIR)$(sbomdir)/
uninstall-sbom:
-rm -f $(DESTDIR)$(sbomdir)/$(SBOM_CDX)
-rm -f $(DESTDIR)$(sbomdir)/$(SBOM_SPDX)
-rm -f $(DESTDIR)$(sbomdir)/$(SBOM_SPDX_TV)
CLEANFILES = $(SBOM_CDX) $(SBOM_SPDX) $(SBOM_SPDX_TV)