2015-09-23 10:33:58 +00:00
|
|
|
ifeq ($(srctree),)
|
2016-11-22 08:30:26 +00:00
|
|
|
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
|
2015-09-23 10:33:58 +00:00
|
|
|
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(srctree)/tools//scripts/Makefile.include
|
|
|
|
|
|
|
|
define allow-override
|
|
|
|
$(if $(or $(findstring environment,$(origin $(1))),\
|
|
|
|
$(findstring command line,$(origin $(1)))),,\
|
|
|
|
$(eval $(1) = $(2)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
|
|
|
|
$(call allow-override,LD,$(CROSS_COMPILE)ld)
|
|
|
|
|
2016-09-27 14:18:46 +00:00
|
|
|
HOSTCC ?= gcc
|
|
|
|
HOSTLD ?= ld
|
|
|
|
HOSTAR ?= ar
|
|
|
|
|
|
|
|
export HOSTCC HOSTLD HOSTAR
|
|
|
|
|
2015-09-23 10:33:58 +00:00
|
|
|
ifeq ($(V),1)
|
|
|
|
Q =
|
|
|
|
else
|
|
|
|
Q = @
|
|
|
|
endif
|
|
|
|
|
|
|
|
export Q srctree CC LD
|
|
|
|
|
|
|
|
MAKEFLAGS := --no-print-directory
|
|
|
|
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
|
|
|
|
|
2015-11-26 18:50:55 +00:00
|
|
|
all: $(OUTPUT)fixdep
|
2015-09-23 10:33:58 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(call QUIET_CLEAN, fixdep)
|
|
|
|
$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
|
|
|
|
$(Q)rm -f fixdep
|
|
|
|
|
|
|
|
$(OUTPUT)fixdep-in.o: FORCE
|
|
|
|
$(Q)$(MAKE) $(build)=fixdep
|
|
|
|
|
|
|
|
$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
|
2016-09-27 14:18:46 +00:00
|
|
|
$(QUIET_LINK)$(HOSTCC) $(LDFLAGS) -o $@ $<
|
2015-09-23 10:33:58 +00:00
|
|
|
|
|
|
|
FORCE:
|
|
|
|
|
|
|
|
.PHONY: FORCE
|