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)
15 target_conf
=$(subst .
,_
,$(subst -,_
,$(subst /,_
,$(1))))
17 PLATFORM_DIR
:=$(TOPDIR
)/target
/linux
/$(BOARD
)
18 SUBTARGET
:=$(strip $(foreach subdir
,$(patsubst $(PLATFORM_DIR
)/%/target.mk
,%,$(wildcard $(PLATFORM_DIR
)/*/target.mk
)),$(if
$(CONFIG_TARGET_
$(call target_conf
,$(BOARD
)_
$(subdir
))),$(subdir
))))
20 PLATFORM_DIR
:=${CURDIR}
23 TARGETID
:=$(BOARD
)$(if
$(SUBTARGET
),/$(SUBTARGET
))
24 PLATFORM_SUBDIR
:=$(PLATFORM_DIR
)$(if
$(SUBTARGET
),/$(SUBTARGET
))
26 ifneq ($(TARGET_BUILD
),1)
27 include $(PLATFORM_DIR
)/Makefile
28 ifneq ($(PLATFORM_DIR
),$(PLATFORM_SUBDIR
))
29 include $(PLATFORM_SUBDIR
)/target.mk
33 -include .
/$(SUBTARGET
)/target.mk
37 define Profile
/Default
43 $(eval
$(call Profile
/Default
))
44 $(eval
$(call Profile
/$(1)))
45 $(eval
$(call shexport
,Profile
/$(1)/Config
))
46 $(eval
$(call shexport
,Profile
/$(1)/Description
))
48 echo
"Target-Profile: $(1)"; \
49 echo
"Target-Profile-Name: $(NAME)"; \
50 echo
"Target-Profile-Packages: $(PACKAGES)"; \
51 if
[ -f .
/config
/profile-
$(1) ]; then \
52 echo
"Target-Profile-Kconfig: yes"; \
54 echo
"Target-Profile-Config: "; \
55 getvar
"$(call shvar,Profile/$(1)/Config)"; \
57 echo
"Target-Profile-Description:"; \
58 getvar
"$(call shvar,Profile/$(1)/Description)"; \
61 ifeq ($(CONFIG_TARGET_
$(call target_conf
,$(BOARD
)_
$(if
$(SUBTARGET
),$(SUBTARGET
)_
)$(1))),y
)
66 ifneq ($(PLATFORM_DIR
),$(PLATFORM_SUBDIR
))
67 define IncludeProfiles
68 -include $(PLATFORM_DIR
)/profiles
/*.mk
69 -include $(PLATFORM_SUBDIR
)/profiles
/*.mk
72 define IncludeProfiles
73 -include $(PLATFORM_DIR
)/profiles
/*.mk
77 ifeq ($(TARGET_BUILD
),1)
78 $(eval
$(call IncludeProfiles
))
81 $(eval
$(call IncludeProfiles
))
85 $(eval
$(call shexport
,Target
/Description
))
87 include $(INCLUDE_DIR
)/kernel-version.mk
89 GENERIC_PLATFORM_DIR
:= $(TOPDIR
)/target
/linux
/generic-
$(KERNEL
)
90 GENERIC_PATCH_DIR
:= $(GENERIC_PLATFORM_DIR
)/patches
$(shell [ -d
"$(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)" ] && printf
-- "-$(KERNEL_PATCHVER)" || true
)
92 GENERIC_LINUX_CONFIG?
=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR
)/config-
$(KERNEL_PATCHVER
) $(GENERIC_PLATFORM_DIR
)/config-default
))
93 LINUX_CONFIG?
=$(firstword $(wildcard $(foreach subdir
,$(PLATFORM_DIR
) $(PLATFORM_SUBDIR
),$(subdir
)/config-
$(KERNEL_PATCHVER
) $(subdir
)/config-default
)))
94 LINUX_SUBCONFIG?
=$(firstword $(wildcard $(PLATFORM_SUBDIR
)/config-
$(KERNEL_PATCHVER
) $(PLATFORM_SUBDIR
)/config-default
))
95 ifeq ($(LINUX_CONFIG
),$(LINUX_SUBCONFIG
))
98 LINUX_CONFCMD
=$(if
$(LINUX_CONFIG
),$(SCRIPT_DIR
)/kconfig.pl
+ $(GENERIC_LINUX_CONFIG
) $(if
$(LINUX_SUBCONFIG
),+ $(LINUX_CONFIG
) $(LINUX_SUBCONFIG
),$(LINUX_CONFIG
)),true
)
101 BuildTarget
=$(BuildTargets
/DumpCurrent
)
104 TMP_CONFIG
:=$(TMP_DIR
)/.kconfig-
$(call target_conf
,$(TARGETID
))
105 $(TMP_CONFIG
): $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
) $(LINUX_SUBCONFIG
)
106 $(LINUX_CONFCMD
) > $@ ||
rm -f
$@
107 -include $(TMP_CONFIG
)
108 .SILENT
: $(TMP_CONFIG
)
109 .PRECIOUS
: $(TMP_CONFIG
)
111 ifneq ($(CONFIG_PCI
),)
114 ifneq ($(CONFIG_USB
),)
117 ifneq ($(CONFIG_PCMCIA
)$(CONFIG_PCCARD
),)
120 ifneq ($(CONFIG_VGA_CONSOLE
)$(CONFIG_FB
),)
125 FEATURES
:=$(sort $(FEATURES
))
129 define BuildTargets
/DumpCurrent
132 @echo
'Target: $(TARGETID)'; \
133 echo
'Target-Board: $(BOARD)'; \
134 echo
'Target-Kernel: $(KERNEL)'; \
135 echo
'Target-Name: $(BOARDNAME)$(if $(SUBTARGET),, [$(KERNEL)])'; \
136 echo
'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'; \
137 echo
'Target-Arch: $(ARCH)'; \
138 echo
'Target-Features: $(FEATURES)'; \
139 echo
'Target-Depends: $(DEPENDS)'; \
140 echo
'Linux-Version: $(LINUX_VERSION)'; \
141 echo
'Linux-Release: $(LINUX_RELEASE)'; \
142 echo
'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
143 echo
'Target-Description:'; \
144 getvar
$(call shvar
,Target
/Description
); \
146 echo
'Default-Packages: $(DEFAULT_PACKAGES)'; \
148 $(if
$(SUBTARGET
),,@
$(foreach SUBTARGET
,$(SUBTARGETS
),$(SUBMAKE
) -s DUMP
=1 SUBTARGET
=$(SUBTARGET
); ))
151 include $(INCLUDE_DIR
)/kernel.mk
152 ifeq ($(TARGET_BUILD
),1)
153 include $(INCLUDE_DIR
)/kernel-build.mk
154 BuildTarget?
=$(BuildKernel
)
This page took 0.046702 seconds and 5 git commands to generate.