18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ciifeq ($(srctree),)
38c2ecf20Sopenharmony_cisrctree := $(patsubst %/,%,$(dir $(CURDIR)))
48c2ecf20Sopenharmony_cisrctree := $(patsubst %/,%,$(dir $(srctree)))
58c2ecf20Sopenharmony_ciendif
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciinclude $(srctree)/tools//scripts/Makefile.include
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cidefine allow-override
108c2ecf20Sopenharmony_ci  $(if $(or $(findstring environment,$(origin $(1))),\
118c2ecf20Sopenharmony_ci            $(findstring command line,$(origin $(1)))),,\
128c2ecf20Sopenharmony_ci    $(eval $(1) = $(2)))
138c2ecf20Sopenharmony_ciendef
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci$(call allow-override,CC,$(CROSS_COMPILE)gcc)
168c2ecf20Sopenharmony_ci$(call allow-override,LD,$(CROSS_COMPILE)ld)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciexport HOSTCC HOSTLD HOSTAR
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciifeq ($(V),1)
218c2ecf20Sopenharmony_ci  Q =
228c2ecf20Sopenharmony_cielse
238c2ecf20Sopenharmony_ci  Q = @
248c2ecf20Sopenharmony_ciendif
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciexport Q srctree CC LD
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciMAKEFLAGS := --no-print-directory
298c2ecf20Sopenharmony_cibuild     := -f $(srctree)/tools/build/Makefile.build dir=. obj
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciall: $(OUTPUT)fixdep
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciclean:
348c2ecf20Sopenharmony_ci	$(call QUIET_CLEAN, fixdep)
358c2ecf20Sopenharmony_ci	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
368c2ecf20Sopenharmony_ci	$(Q)rm -f $(OUTPUT)fixdep
378c2ecf20Sopenharmony_ci	$(call QUIET_CLEAN, feature-detect)
388c2ecf20Sopenharmony_ci	$(Q)$(MAKE) -C feature/ clean >/dev/null
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci$(OUTPUT)fixdep-in.o: FORCE
418c2ecf20Sopenharmony_ci	$(Q)$(MAKE) $(build)=fixdep
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
448c2ecf20Sopenharmony_ci	$(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciFORCE:
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci.PHONY: FORCE
49