2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
12 ifneq ($(__target_inc
),1)
18 target_conf
=$(subst .
,_
,$(subst -,_
,$(subst /,_
,$(1))))
20 PLATFORM_DIR
:=$(TOPDIR
)/target
/linux
/$(BOARD
)
21 SUBTARGET
:=$(strip $(foreach subdir
,$(patsubst $(PLATFORM_DIR
)/%/target.mk
,%,$(wildcard $(PLATFORM_DIR
)/*/target.mk
)),$(if
$(CONFIG_TARGET_
$(call target_conf
,$(BOARD
)_
$(subdir
))),$(subdir
))))
23 PLATFORM_DIR
:=${CURDIR}
26 TARGETID
:=$(BOARD
)$(if
$(SUBTARGET
),/$(SUBTARGET
))
27 PLATFORM_SUBDIR
:=$(PLATFORM_DIR
)$(if
$(SUBTARGET
),/$(SUBTARGET
))
33 BuildTarget
=$$(BuildTargets
/DumpAll
)
38 ifneq ($(TARGET_BUILD
),1)
39 include $(PLATFORM_DIR
)/Makefile
40 ifneq ($(PLATFORM_DIR
),$(PLATFORM_SUBDIR
))
41 include $(PLATFORM_SUBDIR
)/target.mk
45 -include .
/$(SUBTARGET
)/target.mk
49 define Profile
/Default
55 $(eval
$(call Profile
/Default
))
56 $(eval
$(call Profile
/$(1)))
57 $(eval
$(call shexport
,Profile
/$(1)/Config
))
58 $(eval
$(call shexport
,Profile
/$(1)/Description
))
60 echo
"Target-Profile: $(1)"; \
61 echo
"Target-Profile-Name: $(NAME)"; \
62 echo
"Target-Profile-Packages: $(PACKAGES)"; \
63 if
[ -f .
/config
/profile-
$(1) ]; then \
64 echo
"Target-Profile-Kconfig: yes"; \
66 echo
"Target-Profile-Config: "; \
67 getvar
"$(call shvar,Profile/$(1)/Config)"; \
69 echo
"Target-Profile-Description:"; \
70 getvar
"$(call shvar,Profile/$(1)/Description)"; \
73 ifeq ($(CONFIG_TARGET_
$(call target_conf
,$(BOARD
)_
$(if
$(SUBTARGET
),$(SUBTARGET
)_
)$(1))),y
)
78 ifneq ($(PLATFORM_DIR
),$(PLATFORM_SUBDIR
))
79 define IncludeProfiles
80 -include $(PLATFORM_DIR
)/profiles
/*.mk
81 -include $(PLATFORM_SUBDIR
)/profiles
/*.mk
84 define IncludeProfiles
85 -include $(PLATFORM_DIR
)/profiles
/*.mk
89 ifeq ($(TARGET_BUILD
),1)
90 $(eval
$(call IncludeProfiles
))
93 $(eval
$(call IncludeProfiles
))
97 $(eval
$(call shexport
,Target
/Description
))
99 include $(INCLUDE_DIR
)/kernel-version.mk
101 GENERIC_PLATFORM_DIR
:= $(TOPDIR
)/target
/linux
/generic-
$(KERNEL
)
102 GENERIC_PATCH_DIR
:= $(GENERIC_PLATFORM_DIR
)/patches
$(shell [ -d
"$(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)" ] && printf
-- "-$(KERNEL_PATCHVER)" || true
)
104 GENERIC_LINUX_CONFIG?
=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR
)/config-
$(KERNEL_PATCHVER
) $(GENERIC_PLATFORM_DIR
)/config-default
))
105 LINUX_CONFIG?
=$(firstword $(wildcard $(foreach subdir
,$(PLATFORM_DIR
) $(PLATFORM_SUBDIR
),$(subdir
)/config-
$(KERNEL_PATCHVER
) $(subdir
)/config-default
)))
106 LINUX_SUBCONFIG?
=$(firstword $(wildcard $(PLATFORM_SUBDIR
)/config-
$(KERNEL_PATCHVER
) $(PLATFORM_SUBDIR
)/config-default
))
107 ifeq ($(LINUX_CONFIG
),$(LINUX_SUBCONFIG
))
110 LINUX_CONFCMD
=$(if
$(LINUX_CONFIG
),$(SCRIPT_DIR
)/kconfig.pl
+ $(GENERIC_LINUX_CONFIG
) $(if
$(LINUX_SUBCONFIG
),+ $(LINUX_CONFIG
) $(LINUX_SUBCONFIG
),$(LINUX_CONFIG
)),true
)
113 BuildTarget
=$(BuildTargets
/DumpCurrent
)
116 TMP_CONFIG
:=$(TMP_DIR
)/.kconfig-
$(call target_conf
,$(TARGETID
))
117 $(TMP_CONFIG
): $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
) $(LINUX_SUBCONFIG
)
118 $(LINUX_CONFCMD
) > $@ ||
rm -f
$@
119 -include $(TMP_CONFIG
)
120 .SILENT
: $(TMP_CONFIG
)
121 .PRECIOUS
: $(TMP_CONFIG
)
123 ifneq ($(CONFIG_PCI
),)
126 ifneq ($(CONFIG_USB
),)
129 ifneq ($(CONFIG_PCMCIA
)$(CONFIG_PCCARD
),)
134 FEATURES
:=$(sort $(FEATURES
))
138 define BuildTargets
/DumpAll
140 @
$(foreach SUBTARGET
,$(KERNEL_TARGETS
),$(SUBMAKE
) -s DUMP
=1 SUBTARGET
=$(SUBTARGET
); )
143 define BuildTargets
/DumpCurrent
146 @echo
'Target: $(TARGETID)'; \
147 echo
'Target-Board: $(BOARD)'; \
148 echo
'Target-Kernel: $(KERNEL)'; \
149 echo
'Target-Name: $(BOARDNAME) [$(KERNEL)]'; \
150 echo
'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'; \
151 echo
'Target-Arch: $(ARCH)'; \
152 echo
'Target-Features: $(FEATURES)'; \
153 echo
'Target-Depends: $(DEPENDS)'; \
154 echo
'Linux-Version: $(LINUX_VERSION)'; \
155 echo
'Linux-Release: $(LINUX_RELEASE)'; \
156 echo
'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
157 echo
'Target-Description:'; \
158 getvar
$(call shvar
,Target
/Description
); \
160 echo
'Default-Packages: $(DEFAULT_PACKAGES)'; \
164 include $(INCLUDE_DIR
)/kernel.mk
165 ifeq ($(TARGET_BUILD
),1)
166 include $(INCLUDE_DIR
)/kernel-build.mk
167 BuildTarget?
=$(BuildKernel
)
This page took 0.047048 seconds and 5 git commands to generate.