Jiri Olsa | 9f7ef98 | 2015-09-23 12:33:58 +0200 | [diff] [blame] | 1 | ifeq ($(srctree),) |
| 2 | srctree := $(patsubst %/,%,$(dir $(shell pwd))) |
| 3 | srctree := $(patsubst %/,%,$(dir $(srctree))) |
| 4 | endif |
| 5 | |
| 6 | include $(srctree)/tools//scripts/Makefile.include |
| 7 | |
| 8 | define allow-override |
| 9 | $(if $(or $(findstring environment,$(origin $(1))),\ |
| 10 | $(findstring command line,$(origin $(1)))),,\ |
| 11 | $(eval $(1) = $(2))) |
| 12 | endef |
| 13 | |
| 14 | $(call allow-override,CC,$(CROSS_COMPILE)gcc) |
| 15 | $(call allow-override,LD,$(CROSS_COMPILE)ld) |
| 16 | |
| 17 | ifeq ($(V),1) |
| 18 | Q = |
| 19 | else |
| 20 | Q = @ |
| 21 | endif |
| 22 | |
| 23 | export Q srctree CC LD |
| 24 | |
| 25 | MAKEFLAGS := --no-print-directory |
| 26 | build := -f $(srctree)/tools/build/Makefile.build dir=. obj |
| 27 | |
Jiri Olsa | 5e50426 | 2015-11-26 19:50:55 +0100 | [diff] [blame^] | 28 | all: $(OUTPUT)fixdep |
Jiri Olsa | 9f7ef98 | 2015-09-23 12:33:58 +0200 | [diff] [blame] | 29 | |
| 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 |
| 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 | |
| 41 | FORCE: |
| 42 | |
| 43 | .PHONY: FORCE |