Makefile 1.9 KB

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