blob: 727050c40f0961c219e6b8e6138df5a7edd17905 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Jiri Olsa9f7ef982015-09-23 12:33:58 +02002ifeq ($(srctree),)
Uwe Kleine-Könige19b7ce2016-11-22 09:30:26 +01003srctree := $(patsubst %/,%,$(dir $(CURDIR)))
Jiri Olsa9f7ef982015-09-23 12:33:58 +02004srctree := $(patsubst %/,%,$(dir $(srctree)))
5endif
6
7include $(srctree)/tools//scripts/Makefile.include
8
9define allow-override
10 $(if $(or $(findstring environment,$(origin $(1))),\
11 $(findstring command line,$(origin $(1)))),,\
12 $(eval $(1) = $(2)))
13endef
14
15$(call allow-override,CC,$(CROSS_COMPILE)gcc)
16$(call allow-override,LD,$(CROSS_COMPILE)ld)
17
Jiri Olsa0c3b7e42016-09-27 16:18:46 +020018HOSTCC ?= gcc
19HOSTLD ?= ld
20HOSTAR ?= ar
21
22export HOSTCC HOSTLD HOSTAR
23
Jiri Olsa9f7ef982015-09-23 12:33:58 +020024ifeq ($(V),1)
25 Q =
26else
27 Q = @
28endif
29
30export Q srctree CC LD
31
32MAKEFLAGS := --no-print-directory
33build := -f $(srctree)/tools/build/Makefile.build dir=. obj
34
Jiri Olsa5e504262015-11-26 19:50:55 +010035all: $(OUTPUT)fixdep
Jiri Olsa9f7ef982015-09-23 12:33:58 +020036
37clean:
38 $(call QUIET_CLEAN, fixdep)
Jiri Olsa85e0d502017-02-17 15:00:54 +010039 $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
40 $(Q)rm -f $(OUTPUT)fixdep
Jiri Olsa9f7ef982015-09-23 12:33:58 +020041
42$(OUTPUT)fixdep-in.o: FORCE
43 $(Q)$(MAKE) $(build)=fixdep
44
45$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
Laura Abbottb90a3682018-07-09 17:46:00 -070046 $(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
Jiri Olsa9f7ef982015-09-23 12:33:58 +020047
48FORCE:
49
50.PHONY: FORCE