1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# -*-makefile-*-
#
# Copyright (C) 2007 by Sascha Hauer
# (C) 2010 by Carsten Schlote
# (C) 2010 by Michael Olbrich <m.olbrich@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#
#
# We provide this package
#
PACKAGES-$(PTXCONF_DTC) += dtc
DTC_VERSION := 1.0.0
# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------
ptx/dtb = $(notdir $(basename $(strip $(1)))).dtb
%.dtb:
@$(call targetinfo)
@echo CPP `ptxd_print_path "$<.tmp"`
@cpp \
-Wp,-MD,$(STATEDIR)/dtc.dtc.deps \
-Wp,-MT,$<.tmp \
-nostdinc \
-P \
-I$(dir $<) \
-I$(KERNEL_DIR)/arch/$(KERNEL_ARCH)/boot/dts \
-I$(KERNEL_DIR)/arch/$(KERNEL_ARCH)/boot/dts/include \
-undef -D__DTS__ -x assembler-with-cpp \
-o $<.tmp \
$<
@echo DTC `ptxd_print_path "$@"`
@if $(PTXCONF_SYSROOT_HOST)/bin/dtc -h 2>&1 | grep -q "^[[:space:]]-i$$"; then \
dtc_include="-i $(dir $<) -i $(KERNEL_DIR)/arch/$(GENERIC_KERNEL_ARCH)/boot/dts"; \
fi; \
$(PTXCONF_SYSROOT_HOST)/bin/dtc \
$(call remove_quotes,$(PTXCONF_DTC_EXTRA_ARGS)) \
$$dtc_include \
-d $(PTXDIST_TEMPDIR)/dtc.dtc.deps \
-I dts -O dtb -b 0 \
-o "$@" "$<.tmp"
@awk '{ \
printf "%s", $$1 ; \
for (i = 2; i <= NF; i++) { \
printf " $$(wildcard %s)", $$i; \
}; \
print "" \
}' $(PTXDIST_TEMPDIR)/dtc.dtc.deps >> $(STATEDIR)/dtc.dtc.deps
@$(call finish)
DTC_DTB = $(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), $(IMAGEDIR)/$(call ptx/dtb, $(dts)))
# make sure "ptxdist targetinstall kernel" generates a new device trees
$(STATEDIR)/kernel.targetinstall.post: $(DTC_DTB)
$(STATEDIR)/dtc.targetinstall: $(DTC_DTB)
@$(call targetinfo)
ifdef PTXCONF_DTC_INSTALL_OFTREE
@$(call install_init, dtc)
@$(call install_fixup, dtc, PRIORITY,optional)
@$(call install_fixup, dtc, SECTION,base)
@$(call install_fixup, dtc, AUTHOR,"Carsten Schlote <c.schlote@konzeptpark.de>")
@$(call install_fixup, dtc, DESCRIPTION, "oftree description for machine $(PTXCONF_PROJECT_VERSION)")
@$(call install_copy, dtc, 0, 0, 0755, /boot);
@$(foreach dtb, $(DTC_DTB), \
$(call install_copy, dtc, 0, 0, 0644, \
"$(dtb)", "/boot/$(notdir $(dtb))");)
@$(call install_finish, dtc)
endif
@$(call touch)
# vim: syntax=make
|