1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
7 ifneq ($(shell umask
2>/dev
/null | sed
's/0*022/OK/'),OK
)
8 $(error your umask is not
022)
11 CONFIG_CONFIG_IN
= Config.in
13 DEFCONFIG
= ADK_DEBUG
=n \
20 ADK_PACKAGE_CXXTOOLS_DEV
=n \
21 ADK_PACKAGE_XORG_SERVER_DEV
=n \
22 ADK_PACKAGE_LIBFFMPEG_WITH_VP8
=n \
23 ADK_PACKAGE_LM_SENSORS_DETECT
=n \
24 ADK_PACKAGE_PACEMAKER_MGMTD
=n \
25 ADK_PACKAGE_OPENJDK
=n \
26 ADK_PACKAGE_CLASSPATH
=n \
28 ADK_PACKAGE_GPSD_CLIENTS
=n \
30 ADK_PACKAGE_BASE_FILES
=y \
31 ADK_PACKAGE_CRYPTINIT
=n \
32 ADK_PACKAGE_HEIMDAL
=n \
33 ADK_PACKAGE_LIBHEIMDAL
=n \
34 ADK_PACKAGE_LIBHEIMDAL_CLIENT
=n \
36 ADK_PACKAGE_PYTHON
=n \
37 ADK_PACKAGE_VIRTINST
=n \
38 ADK_PACKAGE_URLGRABBER
=n \
41 ADK_PKG_DEVELOPMENT
=n \
42 ADK_PKG_VPN_CLIENT
=n \
43 ADK_PKG_VPN_SERVER
=n \
44 ADK_TOOLCHAIN_GCC_JAVA
=n \
45 ADK_TOOLCHAIN_GCC_OBJC
=n \
46 ADK_TOOLCHAIN_GCC_USE_SSP
=n \
47 ADK_TOOLCHAIN_GCC_USE_LTO
=n \
50 BUSYBOX_INSTALL_NO_USR
=n \
51 BUSYBOX_MODPROBE_SMALL
=n \
55 BUSYBOX_BUILD_LIBBUSYBOX
=n \
56 BUSYBOX_FEATURE_2_4_MODULES
=n \
57 BUSYBOX_LOCALE_SUPPORT
=n \
58 BUSYBOX_FEATURE_PREFER_APPLETS
=n \
59 BUSYBOX_FEATURE_SUID
=n \
60 BUSYBOX_SELINUXENABLED
=n \
61 BUSYBOX_FEATURE_INSTALLER
=n \
63 BUSYBOX_FLASH_LOCK
=n \
64 BUSYBOX_FLASH_UNLOCK
=n \
65 BUSYBOX_FLASH_ERASEALL
=n \
72 BUSYBOX_FEATURE_AIX_LABEL
=n \
73 BUSYBOX_FEATURE_SUN_LABEL
=n \
74 BUSYBOX_FEATURE_OSF_LABEL
=n \
75 BUSYBOX_FEATURE_SGI_LABEL
=n \
76 ADK_KERNEL_RT2X00_DEBUG
=n \
77 ADK_KERNEL_ATH5K_DEBUG
=n \
78 ADK_KERNEL_DEBUG_WITH_KGDB
=n
80 noconfig_targets
:= menuconfig \
89 if
[ -f .adkinit
];then
rm .adkinit
;\
91 if
[ -f .config.old
];then \
92 $(TOPDIR
)/bin
/tools
/pkgrebuild
;\
94 if
[ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
95 touch .rebuild.busybox
;\
98 for i in ADK_RUNTIME_PASSWORD ADK_RUNTIME_HOSTNAME ADK_TARGET_ROOTFS ADK_RUNTIME_CONSOLE
;do \
99 if
[ "$$(grep ^$$i .config|md5sum)" != "$$(grep ^$$i .config.old|md5sum)" ];then \
100 touch .rebuild.base-files
;\
104 if
[ "$$(grep ^ADK_RUNTIME_TIMEZONE .config|md5sum)" != "$$(grep ^ADK_RUNTIME_TIMEZONE .config.old|md5sum)" ];then \
105 touch .rebuild.eglibc .rebuild.uclibc .rebuild.glibc
;\
108 if
[ "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config|md5sum)" != "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config.old|md5sum)" ];then \
109 touch .rebuild.dropbear .rebuild.openssh
;\
112 if
[ "$$(grep ^ADK_RUNTIME_KBD_LAYOUT .config|md5sum)" != "$$(grep ^ADK_RUNTIME_KBD_LAYOUT .config.old|md5sum)" ];then \
113 touch .rebuild.bkeymaps
;\
116 if
[ "$$(grep ^ADK_KERNEL_VERSION .config|md5sum)" != "$$(grep ^ADK_KERNEL_VERSION .config.old|md5sum)" ];then \
119 if
[ $$rebuild -eq
1 ];then \
120 cp .config .config.old
;\
125 # Pull in the user's configuration file
126 ifeq ($(filter $(noconfig_targets
),$(MAKECMDGOALS
)),)
127 -include $(TOPDIR
)/.config
130 ifeq ($(strip $(ADK_HAVE_DOT_CONFIG
)),y
)
131 include $(TOPDIR
)/rules.mk
135 ${TOPDIR}/package
/Depends.mk
: ${TOPDIR}/.config
$(wildcard ${TOPDIR}/package
/*/Makefile
)
136 $(TOPDIR
)/bin
/tools
/depmaker
> ${TOPDIR}/package
/Depends.mk
139 .PHONY
: all world
clean cleantarget cleandir
distclean image_clean
142 mkdir
-p
$(DISTDIR
) $(BUILD_DIR
) $(TARGET_DIR
) $(PACKAGE_DIR
)/.stamps \
143 $(TOOLS_DIR
) $(TOOLS_BUILD_DIR
) $(TOOLCHAIN_BUILD_DIR
)
144 ${BASH} ${TOPDIR}/scripts
/scan-pkgs.sh
145 ${BASH} ${TOPDIR}/scripts
/update-sys
146 ${BASH} ${TOPDIR}/scripts
/update-pkg
147 ifeq ($(ADK_NATIVE
),y
)
148 $(MAKE
) -f mk
/build.mk toolchain
/kernel-headers-prepare tools
/install target
/config-prepare target
/compile package
/compile root_clean package
/install package_index target
/install
150 ifeq ($(ADK_TOOLCHAIN
),y
)
151 ifeq ($(ADK_TOOLCHAIN_ONLY
),y
)
152 $(MAKE
) -f mk
/build.mk toolchain
/install tools
/install jtools
/install package
/compile
154 $(MAKE
) -f mk
/build.mk toolchain
/install tools
/install jtools
/install package
/compile root_clean package
/install
157 $(MAKE
) -f mk
/build.mk toolchain
/install tools
/install jtools
/install target
/config-prepare target
/compile package
/compile root_clean package
/install target
/install package_index
162 ifeq ($(ADK_TARGET_PACKAGE_IPKG
),y
)
163 -cd
${PACKAGE_DIR} && \
164 ${BASH} ${TOPDIR}/scripts
/ipkg-make-index.sh .
>Packages
167 ${STAGING_DIR} ${STAGING_DIR}/etc
${STAGING_HOST_DIR}:
168 mkdir
-p
${STAGING_DIR}/{bin
,etc
,lib
,usr
/bin
,usr
/include,usr
/lib
/pkgconfig
} \
169 ${STAGING_HOST_DIR}/{bin
,lib
,usr
/bin
,usr
/lib
}
171 ${STAGING_DIR}/etc
/ipkg.conf
: ${STAGING_DIR}/etc
172 ifeq ($(ADK_TARGET_PACKAGE_IPKG
),y
)
173 echo
"dest root /" >${STAGING_DIR}/etc
/ipkg.conf
174 echo
"option offline_root ${TARGET_DIR}" >>$(STAGING_DIR
)/etc
/ipkg.conf
177 package
/%: ${STAGING_DIR}/etc
/ipkg.conf
${TOPDIR}/package
/Depends.mk
178 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
181 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
183 toolchain
/%: ${STAGING_DIR}
184 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
187 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
190 $(MAKE
) -C jtools
$(patsubst jtools
/%,%,$@
)
193 $(MAKE
) -C target image
196 if
[ -f .config
];then \
197 echo
"Saving configuration for target system: ${ADK_TARGET_SYSTEM} with arch: ${ADK_TARGET_ARCH}";\
198 cp
-p .config .config.
${ADK_TARGET_ARCH}_
${ADK_TARGET_SYSTEM};\
200 if
[ -f .config.old
];then cp
-p .config.old .config.old.
${ADK_TARGET_ARCH}_
${ADK_TARGET_SYSTEM};fi
201 if
[ -f .config.
${ARCH}_
${SYSTEM} ];then \
202 cp
-p .config.
${ARCH}_
${SYSTEM} .config
; \
203 cp
-p .config.old.
${ARCH}_
${SYSTEM} .config.old
; \
204 $(MAKE
) dep
; rm .rebuild.
* 2>/dev
/null
; \
205 echo
"Setting configuration to target system: ${SYSTEM} with arch: ${ARCH}"; \
207 echo
"No old target config found" ;\
208 mv .config .config.bak
; mv .config.old .config.old.bak
; rm .rebuild.
* 2>/dev
/null
; \
209 if
[ ! -z
"$(SYSTEM)" ];then \
210 make ARCH
=${ARCH} SYSTEM
=${SYSTEM} menuconfig
; \
217 cp
$(TOPDIR
)/target
/$(ADK_TARGET_ARCH
)/kernel.config
$(BUILD_DIR
)/linux
/.config
218 ${KERNEL_MAKE_ENV} ${MAKE} ARCH
=$(ARCH
) ${KERNEL_MAKE_OPTS} -C
$(BUILD_DIR
)/linux menuconfig
219 cp
$(BUILD_DIR
)/linux
/.config
$(TOPDIR
)/target
/$(ADK_TARGET_ARCH
)/kernel.config
221 # create a new package from package/.template
223 @echo
"Creating new package $(PKG)"
224 $(CP
) $(TOPDIR
)/package
/.template
$(TOPDIR
)/package
/$(PKG
)
225 pkg
=$$(echo
$(PKG
)|tr
'[:lower:]-' '[:upper:]_'); \
226 $(SED
) "s#@UPKG@#$$pkg#" $(TOPDIR
)/package
/$(PKG
)/Makefile
227 $(SED
) 's#@PKG@#$(PKG)#' $(TOPDIR
)/package
/$(PKG
)/Makefile
228 $(SED
) 's#@VER@#$(VER)#' $(TOPDIR
)/package
/$(PKG
)/Makefile
229 @echo
"Edit package/$(PKG)/Makefile to complete"
234 mkdir
-p
$(TARGET_DIR
)
236 # Do a per-package clean here, too. This way stale headers and
237 # libraries from target_*/ get wiped away, which keeps
238 # future package build's configure scripts from returning false
239 # dependencies information.
243 $(MAKE
) -C
$(CONFIG
) clean
244 for d in
${STAGING_PKG_DIR}; do \
245 for f in
$$(ls
$$d/[a-z
]* 2>/dev
/null |grep
-v
[A-Z
] 2>/dev
/null
); do \
246 while read file
; do \
247 rm ${STAGING_DIR}/$$file 2>/dev
/null
;\
252 rm -rf
$(BUILD_DIR
) $(BIN_DIR
) $(TARGET_DIR
) \
253 ${TOPDIR}/package
/pkglist.d
254 rm -f
${TOPDIR}/package
/Depends.mk
257 @
$(TRACE
) cleankernel
258 rm -rf
$(TOOLCHAIN_BUILD_DIR
)/w-linux
* $(BUILD_DIR
)/linux
262 @
$(MAKE
) -C
$(CONFIG
) clean $(MAKE_TRACE
)
263 rm -rf
$(BUILD_DIR_PFX
) $(BIN_DIR_PFX
) $(TARGET_DIR_PFX
) \
264 ${TOPDIR}/package
/pkglist.d
${TOPDIR}/package
/pkgconfigs.d
265 rm -rf
$(TOOLCHAIN_BUILD_DIR_PFX
) $(STAGING_HOST_DIR_PFX
) $(TOOLS_BUILD_DIR
)
266 rm -rf
$(STAGING_TARGET_DIR_PFX
) $(STAGING_PKG_DIR_PFX
) $(JTOOLS_BUILD_DIR
) $(STAGING_JAVA_HOST_DIR
)
267 rm -f .menu .tmpconfig.h .rebuild
* ${TOPDIR}/package
/Depends.mk
${TOPDIR}/prereq.mk
270 @
$(TRACE
) cleantarget
271 @
$(MAKE
) -C
$(CONFIG
) clean $(MAKE_TRACE
)
272 rm -rf
$(BUILD_DIR
) $(BIN_DIR
) $(TARGET_DIR
)
273 rm -rf
$(TOOLCHAIN_BUILD_DIR
) $(STAGING_HOST_DIR
) $(STAGING_DIR
) $(STAGING_PKG_DIR
)
274 rm -f .tmpconfig.h
all.config .defconfig
278 @
$(MAKE
) -C
$(CONFIG
) clean $(MAKE_TRACE
)
279 @
rm -rf
$(BUILD_DIR_PFX
) $(BIN_DIR_PFX
) $(TARGET_DIR_PFX
) $(DISTDIR
) \
280 ${TOPDIR}/package
/pkglist.d
${TOPDIR}/package
/pkgconfigs.d
$(JTOOLS_BUILD_DIR
)
281 @
rm -rf
$(TOOLCHAIN_BUILD_DIR_PFX
) $(STAGING_HOST_DIR_PFX
) $(TOOLS_BUILD_DIR
)
282 @
rm -rf
$(STAGING_TARGET_DIR_PFX
) $(STAGING_PKG_DIR_PFX
) $(STAGING_JAVA_HOST_DIR
)
283 @
rm -f .adkinit .config
* .defconfig .tmpconfig.h
all.config
${TOPDIR}/prereq.mk \
284 .menu
${TOPDIR}/package
/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.
*
286 else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
288 ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
289 include ${TOPDIR}/mk
/vars.mk
291 include $(TOPDIR
)/prereq.mk
292 export BASH MAKE LANGUAGE LC_ALL OStype PATH CC_FOR_BUILD QEMU SHELL
296 @echo
"Start the build with \"make\" or with \"make v\" to be verbose"
299 # ---------------------------------------------------------------------------
301 # force entering the subdir, as dependency checking is done there
302 .PHONY
: $(CONFIG
)/conf
$(CONFIG
)/mconf
$(CONFIG
)/gconf
305 @
$(MAKE
) -C
$(CONFIG
) conf
308 @
$(MAKE
) -C
$(CONFIG
)
311 @
$(MAKE
) -C
$(CONFIG
) gconf
313 defconfig
: .menu
$(CONFIG
)/conf
314 @
${BASH} ${TOPDIR}/scripts
/update-sys
315 @
${BASH} ${TOPDIR}/scripts
/update-pkg
316 ifeq (${OStype},Linux
)
317 @echo ADK_HOST_LINUX
=y
> $(TOPDIR
)/.defconfig
319 ifeq (${OStype},FreeBSD
)
320 @echo ADK_HOST_FREEBSD
=y
> $(TOPDIR
)/.defconfig
322 ifeq (${OStype},MirBSD
)
323 @echo ADK_HOST_MIRBSD
=y
> $(TOPDIR
)/.defconfig
325 ifeq (${OStype},OpenBSD
)
326 @echo ADK_HOST_OPENBSD
=y
> $(TOPDIR
)/.defconfig
328 ifeq (${OStype},NetBSD
)
329 @echo ADK_HOST_NETBSD
=y
> $(TOPDIR
)/.defconfig
331 ifeq (${OStype},Darwin
)
332 @echo ADK_HOST_DARWIN
=y
> $(TOPDIR
)/.defconfig
334 ifneq (,$(filter CYGWIN
%,${OStype}))
335 @echo ADK_HOST_CYGWIN
=y
> $(TOPDIR
)/.defconfig
337 ifeq ($(ADKtype
),shuttle-sa76
)
338 @echo ADK_LINUX_NATIVE
=y
>> $(TOPDIR
)/.defconfig
339 @echo ADK_TARGET_SYSTEM_SHUTTLE_SA76
=y
>> $(TOPDIR
)/.defconfig
340 @sed
-e
"s#config ADK_TARGET#config ADK_NATIVE#" target
/$(ARCH_FOR_BUILD
)/sys-available
/$(ADKtype
) > \
341 target
/$(ARCH_FOR_BUILD
)/sys-enabled
/.
$(ADKtype
)
342 @echo
"choice" > $(TOPDIR
)/target
/config
/Config.in.native
343 @echo
"prompt \"Target system (autodetected)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
344 @echo
"source \"target/$(ARCH_FOR_BUILD)/sys-enabled/.$(ADKtype)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
345 @echo
"endchoice" >> $(TOPDIR
)/target
/config
/Config.in.native
347 ifeq ($(ADKtype
),ibm-x40
)
348 @echo ADK_LINUX_NATIVE
=y
>> $(TOPDIR
)/.defconfig
349 @echo ADK_TARGET_SYSTEM_IBM_X40
=y
>> $(TOPDIR
)/.defconfig
350 @sed
-e
"s#config ADK_TARGET#config ADK_NATIVE#" target
/$(ARCH_FOR_BUILD
)/sys-available
/$(ADKtype
) > \
351 target
/$(ARCH_FOR_BUILD
)/sys-enabled
/.
$(ADKtype
)
352 @echo
"choice" > $(TOPDIR
)/target
/config
/Config.in.native
353 @echo
"prompt \"Target system (autodetected)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
354 @echo
"source \"target/$(ARCH_FOR_BUILD)/sys-enabled/.$(ADKtype)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
355 @echo
"endchoice" >> $(TOPDIR
)/target
/config
/Config.in.native
357 ifeq ($(ADKtype
),lemote-yeelong
)
358 @echo ADK_LINUX_NATIVE
=y
>> $(TOPDIR
)/.defconfig
359 @echo ADK_TARGET_SYSTEM_LEMOTE_YEELONG
=y
>> $(TOPDIR
)/.defconfig
360 @sed
-e
"s#config ADK_TARGET#config ADK_NATIVE#" target
/$(ARCH_FOR_BUILD
)/sys-available
/$(ADKtype
) > \
361 target
/$(ARCH_FOR_BUILD
)/sys-enabled
/.
$(ADKtype
)
362 @echo
"choice" > $(TOPDIR
)/target
/config
/Config.in.native
363 @echo
"prompt \"Target system (autodetected)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
364 @echo
"source \"target/$(ARCH_FOR_BUILD)/sys-enabled/.$(ADKtype)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
365 @echo
"endchoice" >> $(TOPDIR
)/target
/config
/Config.in.native
367 @echo
'source "target/config/Config.in.arch.default"' > target
/config
/Config.in.arch
368 @echo
'source "target/config/Config.in.arch.choice"' >> target
/config
/Config.in.arch
369 @echo
'source "target/config/Config.in.system.default"' > target
/config
/Config.in.system
370 @echo
'source "target/config/Config.in.system.choice"' >> target
/config
/Config.in.system
371 @if
[ ! -z
"$(ARCH)" ];then \
372 grep
"^config" target
/config
/Config.in.arch.choice \
373 |grep
-i
"$(ARCH)"\
$$ \
374 |sed
-e
"s#^config \(.*\)#\1=y#" \
375 >> $(TOPDIR
)/.defconfig
; \
377 @for symbol in
${DEFCONFIG}; do \
378 echo
$$symbol >> $(TOPDIR
)/.defconfig
; \
380 @if
[ ! -z
"$(FS)" ];then \
381 grep
"^config" target
/config
/Config.in \
383 |sed
-e
"s#^config \(.*\)#\1=y#" \
384 >> $(TOPDIR
)/.defconfig
; \
386 @if
[ ! -z
"$(PKG)" ];then \
387 grep
"^config" target
/config
/Config.in \
389 |sed
-e
"s#^config \(.*\)#\1=y#" \
390 >> $(TOPDIR
)/.defconfig
; \
392 @if
[ ! -z
"$(LIBC)" ];then \
393 grep
"^config" target
/config
/Config.in \
395 |sed
-e
"s#^config \(.*\)#\1=y#" \
396 >> $(TOPDIR
)/.defconfig
; \
398 @if
[ ! -z
"$(SYSTEM)" ];then \
399 system
=$$(echo
"$(SYSTEM)" |sed
-e
"s/-/_/g"); \
400 grep
-h
"^config" target
/*/Config.in.systems \
401 |grep
-i
"$$system$$" \
402 |sed
-e
"s#^config \(.*\)#\1=y#" \
403 >> $(TOPDIR
)/.defconfig
; \
405 @if
[ ! -z
"$(SYSTEM)" ];then \
406 $(CONFIG
)/conf
-D .defconfig
$(CONFIG_CONFIG_IN
); \
410 ifeq (${OStype},Linux
)
411 @echo ADK_HOST_LINUX
=y
> $(TOPDIR
)/all.config
413 ifeq (${OStype},FreeBSD
)
414 @echo ADK_HOST_FREEBSD
=y
> $(TOPDIR
)/all.config
416 ifeq (${OStype},MirBSD
)
417 @echo ADK_HOST_MIRBSD
=y
> $(TOPDIR
)/all.config
419 ifeq (${OStype},OpenBSD
)
420 @echo ADK_HOST_OPENBSD
=y
> $(TOPDIR
)/all.config
422 ifeq (${OStype},NetBSD
)
423 @echo ADK_HOST_NETBSD
=y
> $(TOPDIR
)/all.config
425 ifeq (${OStype},Darwin
)
426 @echo ADK_HOST_DARWIN
=y
> $(TOPDIR
)/all.config
428 ifneq (,$(filter CYGWIN
%,${OStype}))
429 @echo ADK_HOST_CYGWIN
=y
> $(TOPDIR
)/all.config
431 ifeq ($(ADKtype
),shuttle-sa76
)
432 @echo ADK_TARGET_SYSTEM_SHUTTLE_SA76
=y
>> $(TOPDIR
)/all.config
433 @sed
-e
"s#TARGET#NATIVE#" target
/$(ARCH_FOR_BUILD
)/sys-available
/$(ADKtype
) > \
434 target
/$(ARCH_FOR_BUILD
)/sys-enabled
/.
$(ADKtype
)
435 @echo
"choice" > $(TOPDIR
)/target
/config
/Config.in.native
436 @echo
"prompt \"Target system (autodetected)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
437 @echo
"source \"target/$(ARCH_FOR_BUILD)/sys-enabled/.$(ADKtype)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
438 @echo
"endchoice" >> $(TOPDIR
)/target
/config
/Config.in.native
440 ifeq ($(ADKtype
),ibm-x40
)
441 @echo ADK_TARGET_SYSTEM_IBM_X40
=y
>> $(TOPDIR
)/all.config
442 @sed
-e
"s#TARGET#NATIVE#" target
/$(ARCH_FOR_BUILD
)/sys-available
/$(ADKtype
) > \
443 target
/$(ARCH_FOR_BUILD
)/sys-enabled
/.
$(ADKtype
)
444 @echo
"choice" > $(TOPDIR
)/target
/config
/Config.in.native
445 @echo
"prompt \"Target system (autodetected)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
446 @echo
"source \"target/$(ARCH_FOR_BUILD)/sys-enabled/.$(ADKtype)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
447 @echo
"endchoice" >> $(TOPDIR
)/target
/config
/Config.in.native
449 ifeq ($(ADKtype
),lemote-yeelong
)
450 @echo ADK_TARGET_SYSTEM_LEMOTE_YEELONG
=y
>> $(TOPDIR
)/all.config
451 @sed
-e
"s#TARGET#NATIVE#" target
/$(ARCH_FOR_BUILD
)/sys-available
/$(ADKtype
) > \
452 target
/$(ARCH_FOR_BUILD
)/sys-enabled
/.
$(ADKtype
)
453 @echo
"choice" > $(TOPDIR
)/target
/config
/Config.in.native
454 @echo
"prompt \"Target system (autodetected)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
455 @echo
"source \"target/$(ARCH_FOR_BUILD)/sys-enabled/.$(ADKtype)\"" >> $(TOPDIR
)/target
/config
/Config.in.native
456 @echo
"endchoice" >> $(TOPDIR
)/target
/config
/Config.in.native
458 @echo
'source "target/config/Config.in.arch.default"' > target
/config
/Config.in.arch
459 @echo
'source "target/config/Config.in.arch.choice"' >> target
/config
/Config.in.arch
460 @echo
'source "target/config/Config.in.system.default"' > target
/config
/Config.in.system
461 @echo
'source "target/config/Config.in.system.choice"' >> target
/config
/Config.in.system
462 @if
[ ! -z
"$(ARCH)" ];then \
463 grep
"^config" target
/config
/Config.in.arch.choice \
464 |grep
-i
"$(ARCH)"\
$$ \
465 |sed
-e
"s#^config \(.*\)#\1=y#" \
466 >> $(TOPDIR
)/all.config
; \
468 @for symbol in
${DEFCONFIG}; do \
469 echo
$$symbol >> $(TOPDIR
)/all.config
; \
471 @if
[ ! -z
"$(FS)" ];then \
472 grep
"^config" target
/config
/Config.in \
474 |sed
-e
"s#^config \(.*\)#\1=y#" \
475 >> $(TOPDIR
)/all.config
; \
477 @if
[ ! -z
"$(PKG)" ];then \
478 grep
"^config" target
/config
/Config.in \
480 |sed
-e
"s#^config \(.*\)#\1=y#" \
481 >> $(TOPDIR
)/all.config
; \
483 @if
[ ! -z
"$(LIBC)" ];then \
484 grep
"^config" target
/config
/Config.in \
486 |sed
-e
"s#^config \(.*\)#\1=y#" \
487 >> $(TOPDIR
)/all.config
; \
489 @if
[ ! -z
"$(SYSTEM)" ];then \
490 system
=$$(echo
"$(SYSTEM)" |sed
-e
"s/-/_/g"); \
491 grep
-h
"^config" target
/*/Config.in.systems \
492 |grep
-i
"$$system" \
493 |sed
-e
"s#^config \(.*\)#\1=y#" \
494 >> $(TOPDIR
)/all.config
; \
497 menuconfig
: $(CONFIG
)/mconf defconfig .menu package
/Config.in.auto
498 @
${BASH} ${TOPDIR}/scripts
/update-sys
499 @
${BASH} ${TOPDIR}/scripts
/update-pkg
500 @if
[ ! -f .config
];then \
501 $(CONFIG
)/conf
-D .defconfig
$(CONFIG_CONFIG_IN
); \
503 @
$(CONFIG
)/mconf
$(CONFIG_CONFIG_IN
)
506 guiconfig
: $(CONFIG
)/gconf defconfig .menu package
/Config.in.auto
507 @
${BASH} ${TOPDIR}/scripts
/update-sys
508 @
${BASH} ${TOPDIR}/scripts
/update-pkg
509 @if
[ ! -f .config
];then \
510 $(CONFIG
)/conf
-D .defconfig
$(CONFIG_CONFIG_IN
); \
512 @
$(CONFIG
)/gconf
$(CONFIG_CONFIG_IN
)
515 _config
: $(CONFIG
)/conf .menu package
/Config.in.auto
517 @
$(CONFIG
)/conf
${W} $(CONFIG_CONFIG_IN
)
520 .NOTPARALLEL
: _mconfig
521 _mconfig
: ${CONFIG}/conf _mconfig2 _config
522 _mconfig2
: ${CONFIG}/conf modconfig .menu
523 @
${CONFIG}/conf
-m
${RCONFIG} >/dev
/null
526 @
$(MAKE
) -C
$(CONFIG
) clean
527 @
rm -rf
$(BUILD_DIR_PFX
) $(BIN_DIR_PFX
) $(TARGET_DIR_PFX
) $(DISTDIR
) \
528 ${TOPDIR}/package
/pkglist.d
${TOPDIR}/package
/pkgconfigs.d
$(JTOOLS_BUILD_DIR
)
529 @
rm -rf
$(TOOLCHAIN_BUILD_DIR_PFX
) $(STAGING_TARGET_DIR_PFX
) $(TOOLS_BUILD_DIR
)
530 @
rm -rf
$(STAGING_HOST_DIR_PFX
) $(STAGING_TARGET_DIR_PFX
) $(STAGING_PKG_DIR_PFX
) $(STAGING_JAVA_HOST_DIR
)
531 @
rm -f .adkinit .config
* .defconfig .tmpconfig.h
all.config
${TOPDIR}/prereq.mk \
532 .menu .rebuild.
* ${TOPDIR}/package
/Depends.mk .ADK_HAVE_DOT_CONFIG
535 endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
537 # build all target architecture and libc combinations (toolchain only)
539 for libc in uclibc eglibc glibc
;do \
540 while read arch
; do \
541 mkdir
-p
$(TOPDIR
)/bin
/toolchain_
$${arch}_
$$libc; \
543 echo
=== building
$$arch $$libc toolchain-
$$arch on
$$(date
); \
544 tarch
=$$(echo
$$arch|sed
-e
"s#el##" -e
"s#eb##"); \
546 $(GMAKE
) ARCH
=$$tarch SYSTEM
=toolchain-
$$arch LIBC
=$$libc defconfig
; \
547 $(GMAKE
) VERBOSE
=1 all; if
[ $$?
-ne
0 ]; then touch .exit
;fi
; \
549 ) 2>&1 | tee
$(TOPDIR
)/bin
/toolchain_
$${arch}_
$${libc}/build.log
; \
550 if
[ -f .exit
];then echo
"Bulk build failed!"; rm .exit
; exit
1;fi \
551 done
<${TOPDIR}/target
/tarch.lst
;\
554 # build all target architecture, target systems and libc combinations
556 for libc in uclibc eglibc glibc
;do \
557 while read arch
; do \
558 systems
=$$(.
/scripts
/getsystems
$$arch|grep
-v toolchain|grep
-v qemu
); \
559 for system in
$$systems;do \
560 mkdir
-p
$(TOPDIR
)/bin
/$${system}_
$${arch}_
$$libc; \
562 echo
=== building
$$arch $$system $$libc on
$$(date
); \
564 $(GMAKE
) ARCH
=$$arch SYSTEM
=$$system LIBC
=$$libc FS
=archive defconfig
; \
565 $(GMAKE
) VERBOSE
=1 all; if
[ $$?
-ne
0 ]; then touch .exit
;fi
; \
567 ) 2>&1 | tee
$(TOPDIR
)/bin
/$${system}_
$${arch}_
$$libc/build.log
; \
569 if
[ -f .exit
];then echo
"Bulk build failed!"; rm .exit
; exit
1;fi \
570 done
<${TOPDIR}/target
/arch.lst
;\
574 for libc in uclibc eglibc glibc
;do \
575 while read arch
; do \
576 systems
=$$(.
/scripts
/getsystems
$$arch| grep
-v toolchain|grep
-v qemu
); \
577 for system in
$$systems;do \
578 mkdir
-p
$(TOPDIR
)/bin
/$${system}_
$${arch}_
$$libc; \
580 echo
=== building
$$arch $$system $$libc on
$$(date
); \
582 $(GMAKE
) ARCH
=$$arch SYSTEM
=$$system LIBC
=$$libc FS
=archive allconfig
; \
583 $(GMAKE
) VERBOSE
=1 all; if
[ $$?
-ne
0 ]; then touch .exit
;fi
; \
585 ) 2>&1 | tee
$(TOPDIR
)/bin
/$${system}_
$${arch}_
$$libc/build.log
; \
587 if
[ -f .exit
];then echo
"Bulk build failed!"; rm .exit
; exit
1;fi \
588 done
<${TOPDIR}/target
/arch.lst
;\
592 for libc in uclibc eglibc glibc
;do \
593 while read arch
; do \
594 systems
=$$(.
/scripts
/getsystems
$$arch| grep
-v toolchain|grep
-v qemu
); \
595 for system in
$$systems;do \
596 mkdir
-p
$(TOPDIR
)/bin
/$${system}_
$${arch}_
$$libc; \
598 echo
=== building
$$arch $$system $$libc on
$$(date
); \
600 $(GMAKE
) ARCH
=$$arch SYSTEM
=$$system LIBC
=$$libc FS
=archive allmodconfig
; \
601 $(GMAKE
) VERBOSE
=1 all; if
[ $$?
-ne
0 ]; then echo
$$system-$$libc >.exit
; exit
1;fi
; \
602 $(GMAKE
) cleantarget
; \
604 ) 2>&1 | tee
$(TOPDIR
)/bin
/$${system}_
$${arch}_
$$libc/build.log
; \
606 if
[ -f .exit
];then echo
"Bulk build failed!"; cat .exit
;rm .exit
; exit
1;fi \
607 done
<${TOPDIR}/target
/arch.lst
;\
610 ${TOPDIR}/bin
/tools
/pkgmaker
: $(TOPDIR
)/tools
/adk
/pkgmaker.c
$(TOPDIR
)/tools
/adk
/sortfile.c
$(TOPDIR
)/tools
/adk
/strmap.c
611 @mkdir
-p
$(TOPDIR
)/bin
/tools
612 @
$(CC_FOR_BUILD
) -Wall
-g
-o
$@ tools
/adk
/pkgmaker.c tools
/adk
/sortfile.c tools
/adk
/strmap.c
614 ${TOPDIR}/bin
/tools
/pkgrebuild
: $(TOPDIR
)/tools
/adk
/pkgrebuild.c
$(TOPDIR
)/tools
/adk
/strmap.c
615 @
$(CC_FOR_BUILD
) -Wall
-g
-o
$@ tools
/adk
/pkgrebuild.c tools
/adk
/strmap.c
617 package
/Config.in.auto menu .menu
: $(wildcard ${TOPDIR}/package
/*/Makefile
) ${TOPDIR}/bin
/tools
/pkgmaker
${TOPDIR}/bin
/tools
/pkgrebuild
618 @echo
"Generating menu structure ..."
619 @
$(TOPDIR
)/bin
/tools
/pkgmaker
622 ${TOPDIR}/bin
/tools
/depmaker
: $(TOPDIR
)/tools
/adk
/depmaker.c
623 $(CC_FOR_BUILD
) -g
-o
$(TOPDIR
)/bin
/tools
/depmaker
$(TOPDIR
)/tools
/adk
/depmaker.c
625 dep
: $(TOPDIR
)/bin
/tools
/depmaker
626 @echo
"Generating dependencies ..."
627 @
$(TOPDIR
)/bin
/tools
/depmaker
> ${TOPDIR}/package
/Depends.mk
631 include $(TOPDIR
)/toolchain
/gcc
/Makefile.inc
634 @
-rm tests
/adk.exp tests
/master.exp
>/dev
/null
2>&1
635 @sed
-e
"s#@ADK_TARGET_IP@#$(ADK_TARGET_IP)#" tests
/adk.exp.in
> \
637 @sed
-e
"s#@ADK_TARGET_PORT@#$(ADK_TARGET_PORT)#" tests
/adk.exp.in.tmp
> \
639 @sed
-e
"s#@TOPDIR@#$(TOPDIR)#" tests
/master.exp.in
> \
642 check-gcc
: check-dejagnu
643 env DEJAGNU
=$(TOPDIR
)/tests
/master.exp \
644 $(MAKE
) -C
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/$(PKG_NAME
)-$(PKG_VERSION
)-final
/gcc check-gcc
646 check-g
++: check-dejagnu
647 env DEJAGNU
=$(TOPDIR
)/tests
/master.exp \
648 $(MAKE
) -C
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/$(PKG_NAME
)-$(PKG_VERSION
)-final
/gcc check-g
++
650 check: check-gcc check-g
++