xref: /linux-6.15/net/wireless/Makefile (revision 02f220b5)
1# SPDX-License-Identifier: GPL-2.0
2obj-$(CONFIG_CFG80211) += cfg80211.o
3obj-y += tests/
4
5obj-$(CONFIG_WEXT_CORE) += wext-core.o
6obj-$(CONFIG_WEXT_PROC) += wext-proc.o
7obj-$(CONFIG_WEXT_SPY) += wext-spy.o
8obj-$(CONFIG_WEXT_PRIV) += wext-priv.o
9
10cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o
11cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o ocb.o
12cfg80211-y += pmsr.o
13cfg80211-$(CONFIG_OF) += of.o
14cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o
15cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o
16
17CFLAGS_trace.o := -I$(src)
18
19cfg80211-$(CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS) += shipped-certs.o
20ifneq ($(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR),)
21cfg80211-y += extra-certs.o
22endif
23
24$(obj)/shipped-certs.c: $(sort $(wildcard $(src)/certs/*.hex))
25	@$(kecho) "  GEN     $@"
26	$(Q)(echo '#include "reg.h"'; \
27	  echo 'const u8 shipped_regdb_certs[] = {'; \
28	  echo | cat - $^ ; \
29	  echo '};'; \
30	  echo 'unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);'; \
31	 ) > $@
32
33$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR) \
34		      $(sort $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR)/*.x509))
35	@$(kecho) "  GEN     $@"
36	$(Q)(set -e; \
37	  allf=""; \
38	  for f in $^ ; do \
39	      test -f $$f || continue;\
40	      # similar to hexdump -v -e '1/1 "0x%.2x," "\n"' \
41	      thisf=$$(od -An -v -tx1 < $$f | \
42	                   sed -e 's/ /\n/g' | \
43	                   sed -e 's/^[0-9a-f]\+$$/\0/;t;d' | \
44	                   sed -e 's/^/0x/;s/$$/,/'); \
45	      # file should not be empty - maybe command substitution failed? \
46	      test ! -z "$$thisf";\
47	      allf=$$allf$$thisf;\
48	  done; \
49	  ( \
50	      echo '#include "reg.h"'; \
51	      echo 'const u8 extra_regdb_certs[] = {'; \
52	      echo "$$allf"; \
53	      echo '};'; \
54	      echo 'unsigned int extra_regdb_certs_len = sizeof(extra_regdb_certs);'; \
55	  ) > $@)
56
57clean-files += shipped-certs.c extra-certs.c
58