xref: /linux/net/wireless/Makefile (revision c771600c6af14749609b49565ffb4cac2959710d)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2704232c2SJohannes Bergobj-$(CONFIG_CFG80211) += cfg80211.o
3730eeb17SJohannes Bergobj-y += tests/
4704232c2SJohannes Berg
53d23e349SJohannes Bergobj-$(CONFIG_WEXT_CORE) += wext-core.o
63d23e349SJohannes Bergobj-$(CONFIG_WEXT_PROC) += wext-proc.o
73d23e349SJohannes Bergobj-$(CONFIG_WEXT_PRIV) += wext-priv.o
83d23e349SJohannes Berg
959bbb6f7SJohannes Bergcfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o
106e0bd6c3SRostislav Lisovycfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o ocb.o
119bb7e0f2SJohannes Bergcfg80211-y += pmsr.o
12e691ac2fSRafał Miłeckicfg80211-$(CONFIG_OF) += of.o
131ac61302SLuis R. Rodriguezcfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o
143d23e349SJohannes Bergcfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o
15b1439236SJohannes Berg
1614e8a3c4SBeni LevCFLAGS_trace.o := -I$(src)
1790a53e44SJohannes Berg
1890a53e44SJohannes Bergcfg80211-$(CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS) += shipped-certs.o
1990a53e44SJohannes Bergifneq ($(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR),)
2090a53e44SJohannes Bergcfg80211-y += extra-certs.o
2190a53e44SJohannes Bergendif
2290a53e44SJohannes Berg
23*b1992c37SMasahiro Yamada$(obj)/shipped-certs.c: $(sort $(wildcard $(src)/certs/*.hex))
241188e2a9SArnd Bergmann	@$(kecho) "  GEN     $@"
253df15f34SJohannes Berg	$(Q)(echo '#include "reg.h"'; \
26715a1233SJohannes Berg	  echo 'const u8 shipped_regdb_certs[] = {'; \
27b5642479SJohannes Berg	  echo | cat - $^ ; \
28715a1233SJohannes Berg	  echo '};'; \
29715a1233SJohannes Berg	  echo 'unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);'; \
3004a7279fSJohannes Berg	 ) > $@
3190a53e44SJohannes Berg
32a12f7634SJohannes Berg$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR) \
33bf6b980fSJohannes Berg		      $(sort $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR)/*.x509))
341188e2a9SArnd Bergmann	@$(kecho) "  GEN     $@"
353df15f34SJohannes Berg	$(Q)(set -e; \
36715a1233SJohannes Berg	  allf=""; \
37715a1233SJohannes Berg	  for f in $^ ; do \
3832b5a2c9SMaxim Mikityanskiy	      test -f $$f || continue;\
39715a1233SJohannes Berg	      # similar to hexdump -v -e '1/1 "0x%.2x," "\n"' \
40715a1233SJohannes Berg	      thisf=$$(od -An -v -tx1 < $$f | \
41715a1233SJohannes Berg	                   sed -e 's/ /\n/g' | \
42715a1233SJohannes Berg	                   sed -e 's/^[0-9a-f]\+$$/\0/;t;d' | \
43715a1233SJohannes Berg	                   sed -e 's/^/0x/;s/$$/,/'); \
44715a1233SJohannes Berg	      # file should not be empty - maybe command substitution failed? \
45715a1233SJohannes Berg	      test ! -z "$$thisf";\
46715a1233SJohannes Berg	      allf=$$allf$$thisf;\
47715a1233SJohannes Berg	  done; \
48715a1233SJohannes Berg	  ( \
49715a1233SJohannes Berg	      echo '#include "reg.h"'; \
50715a1233SJohannes Berg	      echo 'const u8 extra_regdb_certs[] = {'; \
51715a1233SJohannes Berg	      echo "$$allf"; \
52715a1233SJohannes Berg	      echo '};'; \
53715a1233SJohannes Berg	      echo 'unsigned int extra_regdb_certs_len = sizeof(extra_regdb_certs);'; \
545d324073SThierry Reding	  ) > $@)
5504a7279fSJohannes Berg
5604a7279fSJohannes Bergclean-files += shipped-certs.c extra-certs.c
57