]>
Commit | Line | Data |
---|---|---|
bbb0b128 SG |
1 | # |
2 | # Copyright (c) 2011 The Chromium OS Authors. | |
3 | # | |
1a459660 | 4 | # SPDX-License-Identifier: GPL-2.0+ |
bbb0b128 SG |
5 | # |
6 | ||
7 | # This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is | |
8 | # enabled. See doc/README.fdt-control for more details. | |
9 | ||
6ab6b2af MY |
10 | DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%) |
11 | ifeq ($(DEVICE_TREE),) | |
3284c8b8 | 12 | DEVICE_TREE := unset |
6ab6b2af | 13 | endif |
c8391a0e | 14 | |
27cb7300 JB |
15 | ARCH_PATH := arch/$(ARCH)/dts |
16 | dtb_depends := arch-dtbs | |
17 | ||
d18926af SG |
18 | ifneq ($(EXT_DTB),) |
19 | DTB := $(EXT_DTB) | |
63b4b5ba | 20 | else |
27cb7300 JB |
21 | DTB := $(ARCH_PATH)/$(DEVICE_TREE).dtb |
22 | dtb_depends += $(DTB:.dtb=.dts) | |
63b4b5ba | 23 | endif |
c8391a0e | 24 | |
3284c8b8 | 25 | $(obj)/dt.dtb: $(DTB) FORCE |
b9d1dbd4 | 26 | $(call if_changed,shipped) |
bbb0b128 | 27 | |
6ab6b2af | 28 | targets += dt.dtb |
bbb0b128 | 29 | |
27cb7300 JB |
30 | $(DTB): $(dtb_depends) |
31 | ifeq ($(EXT_DTB),) | |
32 | $(Q)$(MAKE) $(build)=$(ARCH_PATH) $@ | |
33 | endif | |
3284c8b8 MY |
34 | $(Q)test -e $@ || ( \ |
35 | echo >&2; \ | |
36 | echo >&2 "Device Tree Source is not correctly specified."; \ | |
37 | echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \ | |
38 | echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \ | |
39 | echo >&2; \ | |
40 | /bin/false) | |
41 | ||
42 | arch-dtbs: | |
27cb7300 | 43 | $(Q)$(MAKE) $(build)=$(ARCH_PATH) dtbs |
bbb0b128 | 44 | |
6ab6b2af | 45 | .SECONDARY: $(obj)/dt.dtb.S |
bbb0b128 | 46 | |
6ab6b2af | 47 | obj-$(CONFIG_OF_EMBED) := dt.dtb.o |
bbb0b128 | 48 | |
6ab6b2af MY |
49 | dtbs: $(obj)/dt.dtb |
50 | @: | |
bbb0b128 | 51 | |
6ab6b2af | 52 | clean-files := dt.dtb.S |
3284c8b8 MY |
53 | |
54 | # Let clean descend into dts directories | |
be6b2b31 | 55 | subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts |