1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 2704232c2SJohannes Bergobj-$(CONFIG_CFG80211) += cfg80211.o 37e272fcfSJohn W. Linvilleobj-$(CONFIG_LIB80211) += lib80211.o 4274bfb8dSJohn W. Linvilleobj-$(CONFIG_LIB80211_CRYPT_WEP) += lib80211_crypt_wep.o 5274bfb8dSJohn W. Linvilleobj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o 6274bfb8dSJohn W. Linvilleobj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o 7704232c2SJohannes Berg 83d23e349SJohannes Bergobj-$(CONFIG_WEXT_CORE) += wext-core.o 93d23e349SJohannes Bergobj-$(CONFIG_WEXT_PROC) += wext-proc.o 103d23e349SJohannes Bergobj-$(CONFIG_WEXT_SPY) += wext-spy.o 113d23e349SJohannes Bergobj-$(CONFIG_WEXT_PRIV) += wext-priv.o 123d23e349SJohannes Berg 1359bbb6f7SJohannes Bergcfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o 146e0bd6c3SRostislav Lisovycfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o ocb.o 159bb7e0f2SJohannes Bergcfg80211-y += pmsr.o 16e691ac2fSRafał Miłeckicfg80211-$(CONFIG_OF) += of.o 171ac61302SLuis R. Rodriguezcfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o 183d23e349SJohannes Bergcfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o 19b1439236SJohannes Berg 2014e8a3c4SBeni LevCFLAGS_trace.o := -I$(src) 2190a53e44SJohannes Berg 2290a53e44SJohannes Bergcfg80211-$(CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS) += shipped-certs.o 2390a53e44SJohannes Bergifneq ($(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR),) 2490a53e44SJohannes Bergcfg80211-y += extra-certs.o 2590a53e44SJohannes Bergendif 2690a53e44SJohannes Berg 2704a7279fSJohannes Berg$(obj)/shipped-certs.c: $(wildcard $(srctree)/$(src)/certs/*.hex) 281188e2a9SArnd Bergmann @$(kecho) " GEN $@" 293df15f34SJohannes Berg $(Q)(echo '#include "reg.h"'; \ 30715a1233SJohannes Berg echo 'const u8 shipped_regdb_certs[] = {'; \ 31b5642479SJohannes Berg echo | cat - $^ ; \ 32715a1233SJohannes Berg echo '};'; \ 33715a1233SJohannes Berg echo 'unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);'; \ 3404a7279fSJohannes Berg ) > $@ 3590a53e44SJohannes Berg 36*a12f7634SJohannes Berg$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR) \ 37129ab0d2SMasahiro Yamada $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR)/*.x509) 381188e2a9SArnd Bergmann @$(kecho) " GEN $@" 393df15f34SJohannes Berg $(Q)(set -e; \ 40715a1233SJohannes Berg allf=""; \ 41715a1233SJohannes Berg for f in $^ ; do \ 4232b5a2c9SMaxim Mikityanskiy test -f $$f || continue;\ 43715a1233SJohannes Berg # similar to hexdump -v -e '1/1 "0x%.2x," "\n"' \ 44715a1233SJohannes Berg thisf=$$(od -An -v -tx1 < $$f | \ 45715a1233SJohannes Berg sed -e 's/ /\n/g' | \ 46715a1233SJohannes Berg sed -e 's/^[0-9a-f]\+$$/\0/;t;d' | \ 47715a1233SJohannes Berg sed -e 's/^/0x/;s/$$/,/'); \ 48715a1233SJohannes Berg # file should not be empty - maybe command substitution failed? \ 49715a1233SJohannes Berg test ! -z "$$thisf";\ 50715a1233SJohannes Berg allf=$$allf$$thisf;\ 51715a1233SJohannes Berg done; \ 52715a1233SJohannes Berg ( \ 53715a1233SJohannes Berg echo '#include "reg.h"'; \ 54715a1233SJohannes Berg echo 'const u8 extra_regdb_certs[] = {'; \ 55715a1233SJohannes Berg echo "$$allf"; \ 56715a1233SJohannes Berg echo '};'; \ 57715a1233SJohannes Berg echo 'unsigned int extra_regdb_certs_len = sizeof(extra_regdb_certs);'; \ 585d324073SThierry Reding ) > $@) 5904a7279fSJohannes Berg 6004a7279fSJohannes Bergclean-files += shipped-certs.c extra-certs.c 61