Makefile 988 B

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