Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. HOSTCC ?= gcc
  15. HOSTLD ?= ld
  16. HOSTAR ?= ar
  17. export HOSTCC HOSTLD HOSTAR
  18. ifeq ($(V),1)
  19. Q =
  20. else
  21. Q = @
  22. endif
  23. export Q srctree CC LD
  24. MAKEFLAGS := --no-print-directory
  25. build := -f $(srctree)/tools/build/Makefile.build dir=. obj
  26. all: $(OUTPUT)fixdep
  27. clean:
  28. $(call QUIET_CLEAN, fixdep)
  29. $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
  30. $(Q)rm -f $(OUTPUT)fixdep
  31. $(OUTPUT)fixdep-in.o: FORCE
  32. $(Q)$(MAKE) $(build)=fixdep
  33. $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
  34. $(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
  35. FORCE:
  36. .PHONY: FORCE