blob: 0d5a0e3a8fa9601fe8a58ff0e71142ebf2918df8 [file] [log] [blame]
Jiri Olsa9f7ef982015-09-23 12:33:58 +02001ifeq ($(srctree),)
2srctree := $(patsubst %/,%,$(dir $(shell pwd)))
3srctree := $(patsubst %/,%,$(dir $(srctree)))
4endif
5
6include $(srctree)/tools//scripts/Makefile.include
7
8define allow-override
9 $(if $(or $(findstring environment,$(origin $(1))),\
10 $(findstring command line,$(origin $(1)))),,\
11 $(eval $(1) = $(2)))
12endef
13
14$(call allow-override,CC,$(CROSS_COMPILE)gcc)
15$(call allow-override,LD,$(CROSS_COMPILE)ld)
16
17ifeq ($(V),1)
18 Q =
19else
20 Q = @
21endif
22
23export Q srctree CC LD
24
25MAKEFLAGS := --no-print-directory
26build := -f $(srctree)/tools/build/Makefile.build dir=. obj
27
Jiri Olsa5e504262015-11-26 19:50:55 +010028all: $(OUTPUT)fixdep
Jiri Olsa9f7ef982015-09-23 12:33:58 +020029
30clean:
31 $(call QUIET_CLEAN, fixdep)
32 $(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
33 $(Q)rm -f fixdep
34
35$(OUTPUT)fixdep-in.o: FORCE
36 $(Q)$(MAKE) $(build)=fixdep
37
38$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
39 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $<
40
41FORCE:
42
43.PHONY: FORCE