Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / tools / build / Makefile
blob0d5a0e3a8fa9601fe8a58ff0e71142ebf2918df8
1 ifeq ($(srctree),)
2 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
3 srctree := $(patsubst %/,%,$(dir $(srctree)))
4 endif
6 include $(srctree)/tools//scripts/Makefile.include
8 define allow-override
9 $(if $(or $(findstring environment,$(origin $(1))),\
10 $(findstring command line,$(origin $(1)))),,\
11 $(eval $(1) = $(2)))
12 endef
14 $(call allow-override,CC,$(CROSS_COMPILE)gcc)
15 $(call allow-override,LD,$(CROSS_COMPILE)ld)
17 ifeq ($(V),1)
18 Q =
19 else
20 Q = @
21 endif
23 export Q srctree CC LD
25 MAKEFLAGS := --no-print-directory
26 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
28 all: $(OUTPUT)fixdep
30 clean:
31 $(call QUIET_CLEAN, fixdep)
32 $(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
33 $(Q)rm -f fixdep
35 $(OUTPUT)fixdep-in.o: FORCE
36 $(Q)$(MAKE) $(build)=fixdep
38 $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
39 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $<
41 FORCE:
43 .PHONY: FORCE