Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # SPDX-License-Identifier: GPL-2.0
  2. ifeq ($(srctree),)
  3. srctree := $(patsubst %/,%,$(dir $(CURDIR)))
  4. srctree := $(patsubst %/,%,$(dir $(srctree)))
  5. endif
  6. include $(srctree)/tools//scripts/Makefile.include
  7. define allow-override
  8. $(if $(or $(findstring environment,$(origin $(1))),\
  9. $(findstring command line,$(origin $(1)))),,\
  10. $(eval $(1) = $(2)))
  11. endef
  12. $(call allow-override,CC,$(CROSS_COMPILE)gcc)
  13. $(call allow-override,LD,$(CROSS_COMPILE)ld)
  14. export HOSTCC HOSTLD HOSTAR
  15. ifeq ($(V),1)
  16. Q =
  17. else
  18. Q = @
  19. endif
  20. export Q srctree CC LD
  21. MAKEFLAGS := --no-print-directory
  22. build := -f $(srctree)/tools/build/Makefile.build dir=. obj
  23. all: $(OUTPUT)fixdep
  24. clean:
  25. $(call QUIET_CLEAN, fixdep)
  26. $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
  27. $(Q)rm -f $(OUTPUT)fixdep
  28. $(OUTPUT)fixdep-in.o: FORCE
  29. $(Q)$(MAKE) $(build)=fixdep
  30. $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
  31. $(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
  32. FORCE:
  33. .PHONY: FORCE