Makefile 662 B

123456789101112131415161718
  1. # SPDX-License-Identifier: GPL-2.0
  2. # Ensure drm headers are self-contained and pass kernel-doc
  3. hdrtest-files := \
  4. $(shell cd $(src) && find * -name '*.h' 2>/dev/null)
  5. always-$(CONFIG_DRM_HEADER_TEST) += \
  6. $(patsubst %.h,%.hdrtest, $(hdrtest-files))
  7. # Include the header twice to detect missing include guard.
  8. quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
  9. cmd_hdrtest = \
  10. $(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
  11. PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
  12. touch $@
  13. $(obj)/%.hdrtest: $(src)/%.h FORCE
  14. $(call if_changed_dep,hdrtest)