1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 CONFIG_CONFIG_IN
= Config.in
6 DEFCONFIG
= ADK_DEBUG
=n \
8 ADK_BUILD_WITH_DEBUG
=n \
9 ADK_DISABLE_CHECKSUM
=n \
11 ADK_APPLIANCE_TOOLCHAIN
=n \
12 ADK_APPLIANCE_KODI
=n \
13 ADK_APPLIANCE_BRUTEFIR
=n \
14 ADK_APPLIANCE_TEST
=n \
15 ADK_APPLIANCE_FIREFOX
=n \
16 ADK_APPLIANCE_DEVELOPMENT
=n \
17 ADK_PACKAGE_BUSYBOX_HIDE
=n \
18 ADK_DISABLE_KERNEL_PATCHES
=n \
19 ADK_DISABLE_TARGET_KERNEL_PATCHES
=n \
22 ADK_LEAVE_ETC_ALONE
=n \
23 ADK_SIMPLE_NETWORK_CONFIG
=n \
25 ADK_RUNTIME_START_SERVICES
=n \
26 ADK_PACKAGE_BASE_FILES
=y \
27 ADK_PACKAGE_DBUS_WITH_SYSTEMD
=n \
28 ADK_PACKAGE_KEXECINIT
=n \
29 ADK_PACKAGE_CLASSPATH
=n \
30 ADK_PACKAGE_LM_SENSORS_DETECT
=n \
31 ADK_PACKAGE_CRYPTINIT
=n \
32 ADK_STATIC_TOOLCHAIN
=n \
33 ADK_TOOLCHAIN_WITH_SSP
=n \
34 ADK_TARGET_USE_SSP
=n \
35 ADK_TOOLCHAIN_WITH_LTO
=n \
36 ADK_TARGET_USE_LTO
=n \
37 ADK_TOOLCHAIN_WITH_GOLD
=n \
38 ADK_TARGET_USE_GOLD
=n \
39 ADK_TARGET_USE_GNU_HASHSTYLE
=n \
40 ADK_TARGET_USE_PIE
=n \
41 ADK_TARGET_USE_STATIC_LIBS_ONLY
=n \
42 ADK_TARGET_USE_LD_RELRO
=n \
43 ADK_TARGET_USE_LD_BIND_NOW
=n \
44 ADK_TARGET_USE_LD_GC
=n \
46 BUSYBOX_EXTRA_COMPAT
=n \
47 BUSYBOX_FEATURE_IFCONFIG_SLIP
=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 \
69 BUSYBOX_DEBUG_SANITIZE
=n \
73 BUSYBOX_FEATURE_AIX_LABEL
=n \
74 BUSYBOX_FEATURE_SUN_LABEL
=n \
75 BUSYBOX_FEATURE_OSF_LABEL
=n \
76 BUSYBOX_FEATURE_SGI_LABEL
=n \
77 BUSYBOX_FEATURE_INETD_RPC
=n \
78 BUSYBOX_FEATURE_MOUNT_NFS
=n \
79 BUSYBOX_FEATURE_VI_REGEX_SEARCH
=n \
80 ADK_LINUX_KERNEL_FB_CON_DECOR
=n \
81 ADK_LINUX_KERNEL_RT2X00_DEBUG
=n \
82 ADK_LINUX_KERNEL_ATH5K_DEBUG
=n \
83 ADK_LINUX_KERNEL_BUG
=n \
84 ADK_LINUX_KERNEL_DEBUG_WITH_KGDB
=n
86 noconfig_targets
:= menuconfig \
93 if
[ ! -f .firstrun
]; then \
94 $(ADK_TOPDIR
)/adk
/tools
/pkgrebuild
;\
97 if
[ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
98 touch .rebuild.busybox
;\
101 for i in ADK_SIMPLE_NETWORK_CONFIG ADK_RUNTIME_ ADK_TARGET_ROOTFS
;do \
102 if
[ "$$(grep ^$$i .config|md5sum)" != "$$(grep ^$$i .config.old|md5sum)" ];then \
103 touch .rebuild.base-files
;\
107 for i in ADK_TARGET_GPU_MEM ADK_LINUX_KERNEL_SND_BCM2708
;do \
108 if
[ "$$(grep ^$$i .config|md5sum)" != "$$(grep ^$$i .config.old|md5sum)" ];then \
109 touch .rebuild.bcm28xx-bootloader
;\
113 if
[ "$$(grep ^ADK_RUNTIME_TIMEZONE .config|md5sum)" != "$$(grep ^ADK_RUNTIME_TIMEZONE .config.old|md5sum)" ];then \
114 touch .rebuild.musl .rebuild.uclibc-ng .rebuild.glibc
;\
117 if
[ "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config|md5sum)" != "$$(grep ^ADK_RUNTIME_SSH_PUBKEY .config.old|md5sum)" ];then \
118 touch .rebuild.dropbear .rebuild.openssh
;\
121 if
[ "$$(grep ^ADK_TOOLCHAIN_WITH .config|md5sum)" != "$$(grep ^ADK_TOOLCHAIN_WITH .config.old|md5sum)" ];then \
125 if
[ "$$(grep ^ADK_TARGET_KERNEL_VERSION .config|md5sum)" != "$$(grep ^ADK_TARGET_KERNEL_VERSION .config.old|md5sum)" ];then \
129 if
[ "$$(grep ^ADK_RUNTIME_INIT_ .config|md5sum)" != "$$(grep ^ADK_RUNTIME_BASE_ .config.old|md5sum)" ];then \
133 if
[ "$$(grep ^ADK_RUNTIME_BASE_ .config|md5sum)" != "$$(grep ^ADK_RUNTIME_BASE_ .config.old|md5sum)" ];then \
137 if
[ "$$(grep ^ADK_TARGET_USE .config|md5sum)" != "$$(grep ^ADK_TARGET_USE .config.old|md5sum)" ];then \
141 if
[ $$cleandir -eq
1 ];then \
142 echo
"You should rebuild with 'make cleansystem'";\
144 if
[ "$$(grep ^ADK_TARGET_KERNEL_USE_DEFCONFIG .config)" ];then \
145 if
[ "$$(grep ^ADK_TARGET_KERNEL_DEFCONFIG .config|awk -F= '{print $$2}')" == '""' ];then \
146 echo
"custom Linux defconfig name missing";\
149 if
[ $$rebuild -eq
1 ];then \
150 cp .config .config.old
;\
153 if
[ -f .firstrun
]; then
rm .firstrun
; fi
155 # Pull in the user's configuration file
156 ifeq ($(filter $(noconfig_targets
),$(MAKECMDGOALS
)),)
157 -include $(ADK_TOPDIR
)/.config
160 ifeq ($(strip $(ADK_HAVE_DOT_CONFIG
)),y
)
161 include $(ADK_TOPDIR
)/rules.mk
165 ${ADK_TOPDIR}/package
/Depends.mk
: ${ADK_TOPDIR}/.config
$(wildcard ${ADK_TOPDIR}/package
/*/Makefile
) $(ADK_TOPDIR
)/adk
/tools
/depmaker
166 @printf
" ---> generating dependencies.. "
167 $(ADK_TOPDIR
)/adk
/tools
/depmaker
> ${ADK_TOPDIR}/package
/Depends.mk
171 .PHONY
: all world
clean cleandir cleansystem
distclean image_clean
174 @mkdir
-p
$(DL_DIR
) $(HOST_BUILD_DIR
) $(BUILD_DIR
) $(TARGET_DIR
) $(FW_DIR
) \
175 $(STAGING_HOST_DIR
) $(TOOLCHAIN_BUILD_DIR
) $(STAGING_PKG_DIR
)/stamps
176 ifeq ($(ADK_APPLIANCE_TOOLCHAIN
),y
)
177 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final
179 ifeq ($(ADK_TARGET_OS_BAREMETAL
),y
)
180 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final
182 ifeq ($(ADK_TARGET_OS_RTEMS
),y
)
183 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final target
/compile target
/install target
/targethelp
185 ifeq ($(ADK_TARGET_OS_FROSTED
),y
)
186 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final target
/config-prepare target
/compile target
/install target
/targethelp
188 ifeq ($(ADK_TARGET_OS_ZEPHYR
),y
)
189 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final target
/compile target
/install target
/targethelp
191 ifeq ($(ADK_TARGET_OS_WALDUX
),y
)
192 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final target
/config-prepare target
/compile package_clean package
/compile root_clean package
/install target
/install package_index
194 ifeq ($(ADK_TARGET_OS_LINUX
),y
)
195 $(MAKE
) -f mk
/build.mk package
/hostcompile toolchain
/final target
/config-prepare target
/compile package_clean package
/compile root_clean package
/install target
/install package_index
200 ifeq ($(ADK_TARGET_PACKAGE_IPKG
),y
)
201 -cd
${PACKAGE_DIR} && \
202 ${BASH} ${ADK_TOPDIR}/scripts
/ipkg-make-index.sh .
>Packages
204 ifeq ($(ADK_TARGET_PACKAGE_OPKG
),y
)
205 -cd
${PACKAGE_DIR} && \
206 ${BASH} ${ADK_TOPDIR}/scripts
/ipkg-make-index.sh .
>Packages
209 ${STAGING_TARGET_DIR} ${STAGING_TARGET_DIR}/etc
${STAGING_HOST_DIR}:
210 @mkdir
-p
${STAGING_TARGET_DIR}/lib
211 @mkdir
-p
${STAGING_TARGET_DIR}/bin
212 @mkdir
-p
${STAGING_TARGET_DIR}/etc
213 @mkdir
-p
${STAGING_TARGET_DIR}/usr
/bin
214 @mkdir
-p
${STAGING_TARGET_DIR}/usr
/include
215 @mkdir
-p
${STAGING_TARGET_DIR}/usr
/lib
/pkgconfig
216 @mkdir
-p
${STAGING_HOST_DIR}/lib
217 @mkdir
-p
${STAGING_HOST_DIR}/usr
/bin
218 @mkdir
-p
${STAGING_HOST_DIR}/usr
/lib
219 @mkdir
-p
${STAGING_HOST_DIR}/usr
/include
220 @for i in lib64 lib32 libx32
; do \
221 cd
${STAGING_TARGET_DIR}; ln
-sf lib
$$i; \
222 cd
${STAGING_TARGET_DIR}/usr
; ln
-sf lib
$$i; \
223 cd
${STAGING_HOST_DIR}; ln
-sf lib
$$i; \
224 cd
${STAGING_HOST_DIR}/usr
; ln
-sf lib
$$i; \
227 ${STAGING_TARGET_DIR}/etc
/ipkg.conf
: ${STAGING_TARGET_DIR}/etc
228 echo
"dest root /" >${STAGING_TARGET_DIR}/etc
/ipkg.conf
229 echo
"option offline_root ${TARGET_DIR}" >>$(STAGING_TARGET_DIR
)/etc
/ipkg.conf
231 package
/%: ${STAGING_TARGET_DIR}/etc
/ipkg.conf
${ADK_TOPDIR}/package
/Depends.mk
232 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
235 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
237 toolchain
/%: ${STAGING_TARGET_DIR}
238 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
241 $(MAKE
) -C target image
244 $(MAKE
) -C target targethelp
247 ${KERNEL_MAKE_ENV} ${MAKE} -C
"${LINUX_DIR}" \
248 ARCH
=$(ADK_TARGET_KARCH
) \
249 ${KERNEL_MAKE_OPTS} \
252 ifeq ($(ADK_TARGET_LINUX_KERNEL_USE_CUSTOMCONFIG
),y
)
254 @echo
"Saving kernel configuration to $(ADK_TOPDIR)/$(ADK_TARGET_LINUX_KERNEL_CUSTOMCONFIG_PATH)"
255 $(CP
) $(LINUX_DIR
)/.config
$(ADK_TOPDIR
)/$(ADK_TARGET_LINUX_KERNEL_CUSTOMCONFIG_PATH
)
258 @echo
"You have to enable ADK_TARGET_LINUX_KERNEL_USE_CUSTOMCONFIG to be able to save the current kernel configuration."
262 # create a new package from package/.template
264 @echo
"Creating new package $(PKG)"
265 $(CP
) $(ADK_TOPDIR
)/package
/.template
$(TYPE
) $(ADK_TOPDIR
)/package
/$(PKG
)
266 pkg
=$$(echo
$(PKG
)|tr
'[:lower:]-' '[:upper:]_'); \
267 $(SED
) "s#@UPKG@#$$pkg#" $(ADK_TOPDIR
)/package
/$(PKG
)/Makefile
268 $(SED
) 's#@PKG@#$(PKG)#' $(ADK_TOPDIR
)/package
/$(PKG
)/Makefile
269 $(SED
) 's#@VER@#$(VER)#' $(ADK_TOPDIR
)/package
/$(PKG
)/Makefile
270 @echo
"Edit package/$(PKG)/Makefile to complete"
273 rm -rf
$(PACKAGE_DIR
)
274 mkdir
-p
$(PACKAGE_DIR
)
278 mkdir
-p
$(TARGET_DIR
)
279 touch
$(TARGET_DIR
)/.adk
281 # Do a per-package clean here, too. This way stale headers and
282 # libraries from target_*/ get wiped away, which keeps
283 # future package build's configure scripts from returning false
284 # dependencies information.
287 @printf
" ---> cleaning target build directories and files.. "
288 $(MAKE
) -C
$(CONFIG
) clean
289 for f in
$$(ls
${STAGING_PKG_DIR}/ 2>/dev
/null |grep
-v
[A-Z
]|grep
-v stamps
2>/dev
/null
); do \
290 while read file
; do \
291 rm ${STAGING_TARGET_DIR}/$$file 2>/dev
/null
;\
292 done
< ${STAGING_PKG_DIR}/$$f ; \
293 rm ${STAGING_PKG_DIR}/$$f ; \
295 rm -rf
$(BUILD_DIR
) $(FW_DIR
) $(TARGET_DIR
) \
296 ${ADK_TOPDIR}/package
/pkglist.d
297 rm -f
${ADK_TOPDIR}/package
/Depends.mk
301 @printf
" ---> cleaning kernel build directories.. "
302 @
rm -rf
$(TOOLCHAIN_BUILD_DIR
)/w-
$(ADK_TARGET_OS
)* $(BUILD_DIR
)/$(ADK_TARGET_OS
)
306 @printf
" ---> cleaning all build directories and files.. "
307 @
$(MAKE
) -C
$(CONFIG
) clean $(MAKE_TRACE
)
308 @
rm -rf
$(BUILD_DIR_PFX
) $(FW_DIR_PFX
) $(TARGET_DIR_PFX
) \
309 ${ADK_TOPDIR}/package
/pkglist.d
${ADK_TOPDIR}/package
/pkgconfigs.d
310 @
rm -rf
$(TOOLCHAIN_DIR_PFX
) $(STAGING_HOST_DIR_PFX
)
311 @
rm -rf
$(STAGING_TARGET_DIR_PFX
) $(STAGING_PKG_DIR_PFX
)
312 @
rm -f .menu .tmpconfig.h .rebuild
* make.log
313 @
rm -f
${ADK_TOPDIR}/package
/Depends.mk
${ADK_TOPDIR}/prereq.mk
317 @printf
" ---> cleaning system build directories and files .. "
318 @
$(MAKE
) -C
$(CONFIG
) clean $(MAKE_TRACE
)
319 @
rm -rf
$(BUILD_DIR
) $(FW_DIR
) $(TARGET_DIR
) \
320 ${ADK_TOPDIR}/package
/pkglist.d
${ADK_TOPDIR}/package
/pkgconfigs.d
321 @
rm -rf
$(TOOLCHAIN_DIR
) $(STAGING_TARGET_DIR
) $(STAGING_PKG_DIR
) $(TOOLCHAIN_BUILD_DIR
)
322 @
rm -f .menu .tmpconfig.h .rebuild
* ${ADK_TOPDIR}/package
/Depends.mk
${ADK_TOPDIR}/prereq.mk
326 @printf
" ---> cleaning build directories, files and downloads.. "
327 @
$(MAKE
) -C
$(CONFIG
) clean $(MAKE_TRACE
)
328 @
rm -rf
$(TOOLCHAIN_DIR_PFX
) $(STAGING_HOST_DIR_PFX
)
329 @
rm -rf
$(STAGING_TARGET_DIR_PFX
) $(STAGING_PKG_DIR_PFX
)
330 @
rm -rf
$(BUILD_DIR_PFX
) $(FW_DIR_PFX
) $(TARGET_DIR_PFX
) $(DL_DIR
)
331 @
rm -rf package
/pkglist.d package
/pkgconfigs.d
332 @
rm -f .config
* .defconfig .tmpconfig.h
all.config prereq.mk make.log
333 @
rm -f .firstrun .menu package
/Depends.mk .ADK_HAVE_DOT_CONFIG .rebuild.
*
334 @
rm -f target
/*/Config.in.arch target
/*/Config.in.systems target
/config
/Config.in.tasks
335 @
rm -f target
/config
/Config.in.arch.choice target
/config
/Config.in.arch.default
336 @
rm -f target
/config
/Config.in.system.choice target
/config
/Config.in.system.default
337 @
rm -f package
/Config.in.auto
* target
/config
/Config.in.system
338 @
rm -f target
/config
/Config.in.prereq target
/config
/Config.in.scripts
339 @
rm -f adk
/tools
/pkgmaker adk
/tools
/depmaker adk
/tools
/pkgrebuild
342 else # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
344 ifeq ($(filter-out distclean,${MAKECMDGOALS}),)
345 include ${ADK_TOPDIR}/mk
/vars.mk
347 include $(ADK_TOPDIR
)/prereq.mk
351 @echo
"Start the build with \"make\" or with \"make v\" to be verbose"
354 # ---------------------------------------------------------------------------
356 # force entering the subdir, as dependency checking is done there
357 .PHONY
: $(CONFIG
)/conf
$(CONFIG
)/mconf
360 @
$(MAKE
) -C
$(CONFIG
) conf
363 @
$(MAKE
) -C
$(CONFIG
)
365 defconfig
: .menu
$(CONFIG
)/conf
366 @if
[ -f
$(ADK_TOPDIR
)/.defconfig
]; then
rm $(ADK_TOPDIR
)/.defconfig
;fi
367 @if
[ ! -z
"$(ADK_NO_CHECKSUM)" ];then \
368 echo
"ADK_DISABLE_CHECKSUM=y" >> $(ADK_TOPDIR
)/.defconfig
; \
370 @if
[ ! -z
"$(ADK_TEST_BASE)" ];then \
371 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
372 echo
"ADK_PACKAGE_HELLOWORLD=y" >> $(ADK_TOPDIR
)/.defconfig
; \
374 @if
[ ! -z
"$(ADK_TEST_TOOLCHAIN)" ];then \
375 echo
"ADK_PACKAGE_HELLOWORLD=y" >> $(ADK_TOPDIR
)/.defconfig
; \
377 @if
[ ! -z
"$(ADK_TEST_LTP)" ];then \
378 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
379 echo
"ADK_PACKAGE_FILE=y" >> $(ADK_TOPDIR
)/.defconfig
; \
380 echo
"ADK_PACKAGE_LTP=y" >> $(ADK_TOPDIR
)/.defconfig
; \
382 @if
[ ! -z
"$(ADK_TEST_MKSH)" ];then \
383 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
384 echo
"ADK_PACKAGE_PERL=y" >> $(ADK_TOPDIR
)/.defconfig
; \
385 echo
"ADK_PACKAGE_MKSH_TEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
387 @if
[ ! -z
"$(ADK_TEST_UCLIBC_NG_TEST)" ];then \
388 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
389 echo
"ADK_PACKAGE_UCLIBC_NG_TEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
391 @if
[ ! -z
"$(ADK_TEST_LIBC_TEST)" ];then \
392 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
393 echo
"ADK_PACKAGE_LIBC_TEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
394 echo
"ADK_PACKAGE_MAKE=y" >> $(ADK_TOPDIR
)/.defconfig
; \
396 @if
[ ! -z
"$(ADK_TEST_UCLIBC_NG_NATIVE)" ];then \
397 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
398 echo
"ADK_PACKAGE_GCC=y" >> $(ADK_TOPDIR
)/.defconfig
; \
399 echo
"ADK_PACKAGE_BINUTILS=y" >> $(ADK_TOPDIR
)/.defconfig
; \
400 echo
"ADK_PACKAGE_MAKE=y" >> $(ADK_TOPDIR
)/.defconfig
; \
401 echo
"ADK_PACKAGE_UCLIBC_NG_DEV=y" >> $(ADK_TOPDIR
)/.defconfig
; \
403 @if
[ ! -z
"$(ADK_TEST_MUSL_NATIVE)" ];then \
404 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
405 echo
"ADK_PACKAGE_GCC=y" >> $(ADK_TOPDIR
)/.defconfig
; \
406 echo
"ADK_PACKAGE_BINUTILS=y" >> $(ADK_TOPDIR
)/.defconfig
; \
407 echo
"ADK_PACKAGE_MAKE=y" >> $(ADK_TOPDIR
)/.defconfig
; \
408 echo
"ADK_PACKAGE_MUSL_DEV=y" >> $(ADK_TOPDIR
)/.defconfig
; \
410 @if
[ ! -z
"$(ADK_TEST_GLIBC_NATIVE)" ];then \
411 echo
"ADK_PACKAGE_ADKTEST=y" >> $(ADK_TOPDIR
)/.defconfig
; \
412 echo
"ADK_PACKAGE_GCC=y" >> $(ADK_TOPDIR
)/.defconfig
; \
413 echo
"ADK_PACKAGE_BINUTILS=y" >> $(ADK_TOPDIR
)/.defconfig
; \
414 echo
"ADK_PACKAGE_MAKE=y" >> $(ADK_TOPDIR
)/.defconfig
; \
415 echo
"ADK_PACKAGE_GLIBC_DEV=y" >> $(ADK_TOPDIR
)/.defconfig
; \
417 @if
[ ! -z
"$(ADK_APPLIANCE)" ];then \
418 grep
"^config" target
/config
/Config.in.tasks \
419 |grep
-i
"_$(ADK_APPLIANCE)$$" \
420 |sed
-e
"s#^config \(.*\)#\1=y#" \
421 >> $(ADK_TOPDIR
)/.defconfig
; \
423 @if
[ ! -z
"$(ADK_TARGET_OS)" ];then \
424 grep
"^config" target
/config
/Config.in.os \
425 |grep
-i
"_$(ADK_TARGET_OS)$$" \
426 |sed
-e
"s#^config \(.*\)#\1=y#" \
427 >> $(ADK_TOPDIR
)/.defconfig
; \
429 @if
[ ! -z
"$(ADK_TARGET_ARCH)" ];then \
430 grep
"^config" target
/config
/Config.in.arch.choice \
431 |grep
-i
"$(ADK_TARGET_OS)_ARCH_$(ADK_TARGET_ARCH)$$" \
432 |sed
-e
"s#^config \(.*\)#\1=y#" \
433 >> $(ADK_TOPDIR
)/.defconfig
; \
435 @if
[ ! -z
"$(ADK_TARGET_FS)" ];then \
436 grep
"^config" target
/config
/Config.in.rootfs \
437 |grep
-i
"$(ADK_TARGET_FS)" \
438 |sed
-e
"s#^config \(.*\)#\1=y#" \
439 >> $(ADK_TOPDIR
)/.defconfig
; \
441 @if
[ ! -z
"$(ADK_TARGET_ABI)" ];then \
442 grep
"^config" target
/config
/Config.in.abi \
443 |grep
-i
"$(ADK_TARGET_ABI)$$" \
444 |sed
-e
"s#^config \(.*\)#\1=y#" \
445 >> $(ADK_TOPDIR
)/.defconfig
; \
447 @if
[ ! -z
"$(ADK_TARGET_FLOAT)" ];then \
448 grep
"^config" target
/config
/Config.in.float \
449 |grep
-i
"$(ADK_TARGET_FLOAT)_" \
450 |sed
-e
"s#^config \(.*\)#\1=y#" \
451 >> $(ADK_TOPDIR
)/.defconfig
; \
453 @if
[ ! -z
"$(ADK_TARGET_BINFMT)" ];then \
454 grep
"^config" target
/config
/Config.in.binfmt \
455 |grep
-i
"$(ADK_TARGET_BINFMT)$$" \
456 |sed
-e
"s#^config \(.*\)#\1=y#" \
457 >> $(ADK_TOPDIR
)/.defconfig
; \
459 @if
[ ! -z
"$(ADK_TARGET_INSTRUCTION_SET)" ];then \
460 grep
"^config" target
/config
/Config.in.instructions \
461 |grep
-i
"$(ADK_TARGET_INSTRUCTION_SET)$$" \
462 |sed
-e
"s#^config \(.*\)#\1=y#" \
463 >> $(ADK_TOPDIR
)/.defconfig
; \
465 @if
[ ! -z
"$(ADK_TARGET_ENDIAN)" ];then \
466 grep
"^config" target
/config
/Config.in.endian \
467 |grep
-i
"$(ADK_TARGET_ENDIAN)" \
468 |sed
-e
"s#^config \(.*\)#\1=y#" \
469 >> $(ADK_TOPDIR
)/.defconfig
; \
471 @if
[ ! -z
"$(ADK_TARGET_MMU)" ];then \
472 printf
"# ADK_TARGET_WITH_MMU is not set\n" \
473 >> $(ADK_TOPDIR
)/.defconfig
; \
475 @if
[ ! -z
"$(ADK_TARGET_LIBC)" ];then \
476 libc
=$$(echo
"$(ADK_TARGET_LIBC)"|sed
-e
"s/-/_/"); \
477 grep
"^config" target
/config
/Config.in.libc \
478 |grep
-i
"$$libc$$" \
479 |sed
-e
"s#^config \(.*\)#\1=y#" \
480 >> $(ADK_TOPDIR
)/.defconfig
; \
482 @if
[ ! -z
"$(ADK_TARGET_CPU)" ];then \
483 cpu
=$$(echo
"$(ADK_TARGET_CPU)" |sed
-e
"s/-/_/g"); \
484 grep
-h
"^config" target
/config
/Config.in.cpu \
486 |sed
-e
"s#^config \(.*\)#\1=y#" \
487 >> $(ADK_TOPDIR
)/.defconfig
; \
489 @if
[ ! -z
"$(ADK_TARGET_SYSTEM)" ];then \
490 system
=$$(echo
"$(ADK_TARGET_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 >> $(ADK_TOPDIR
)/.defconfig
; \
496 @if
[ ! -z
"$(ADK_TARGET_KERNEL_VERSION)" ];then \
497 kernelversion
=$$(echo
"$(ADK_TARGET_KERNEL_VERSION)"|sed
-e
"s/\./_/g"); \
498 grep
"^config" target
/config
/Config.in.kernelversion \
499 |grep
-i
"$$kernelversion$$" \
500 |sed
-e
"s#^config \(.*\)#\1=y#" \
501 >> $(ADK_TOPDIR
)/.defconfig
; \
503 @if
[ ! -z
"$(ADK_TARGET_LIBC_VERSION)" ];then \
504 libcversion
=$$(echo
"$(ADK_TARGET_LIBC_VERSION)"|sed
-e
"s/\./_/g"); \
505 if
[ "$$libcversion" = "git" ];then \
506 if
[ "$(ADK_TARGET_LIBC)" = "glibc" ];then \
507 echo
"ADK_TARGET_LIB_GLIBC_GIT=y" >> $(ADK_TOPDIR
)/.defconfig
; \
509 if
[ "$(ADK_TARGET_LIBC)" = "uclibc-ng" ];then \
510 echo
"ADK_TARGET_LIB_UCLIBC_NG_GIT=y" >> $(ADK_TOPDIR
)/.defconfig
; \
512 if
[ "$(ADK_TARGET_LIBC)" = "musl" ];then \
513 echo
"ADK_TARGET_LIB_MUSL_GIT=y" >> $(ADK_TOPDIR
)/.defconfig
; \
516 grep
"^config" target
/config
/Config.in.libc \
517 |grep
-i
"$$libcversion$$" \
518 |sed
-e
"s#^config \(.*\)#\1=y#" \
519 >> $(ADK_TOPDIR
)/.defconfig
; \
522 @if
[ ! -z
"$(ADK_TOOLCHAIN_BINUTILS_VERSION)" ];then \
523 binutilsversion
=$$(echo
"$(ADK_TOOLCHAIN_BINUTILS_VERSION)"|sed
-e
"s/\./_/g"); \
524 if
[ "$$binutilsversion" = "git" ];then \
525 echo
"ADK_TOOLCHAIN_BINUTILS_GIT=y" >> $(ADK_TOPDIR
)/.defconfig
; \
527 grep
"^config" target
/config
/Config.in.binutils \
528 |grep
-i
"$$binutilsversion$$" \
529 |sed
-e
"s#^config \(.*\)#\1=y#" \
530 >> $(ADK_TOPDIR
)/.defconfig
; \
533 @if
[ ! -z
"$(ADK_TOOLCHAIN_GCC_VERSION)" ];then \
534 echo
"ADK_BUILD_COMPILER_GCC=y" >> $(ADK_TOPDIR
)/.defconfig
; \
535 gccversion
=$$(echo
"$(ADK_TOOLCHAIN_GCC_VERSION)"|sed
-e
"s/\./_/g"); \
536 if
[ "$$gccversion" = "git" ];then \
537 echo
"ADK_TOOLCHAIN_GCC_GIT=y" >> $(ADK_TOPDIR
)/.defconfig
; \
539 grep
"^config" target
/config
/Config.in.compiler \
540 |grep
-i
"$$gccversion$$" \
541 |sed
-e
"s#^config \(.*\)#\1=y#" \
542 >> $(ADK_TOPDIR
)/.defconfig
; \
545 @if
[ ! -z
"$(ADK_TOOLCHAIN_GDB_VERSION)" ];then \
546 gdbversion
=$$(echo
"$(ADK_TOOLCHAIN_GDB_VERSION)"|sed
-e
"s/\./_/g"); \
547 if
[ "$$gdbversion" = "git" ];then \
548 echo
"ADK_TOOLCHAIN_GDB_GIT=y" >> $(ADK_TOPDIR
)/.defconfig
; \
550 grep
"^config" target
/config
/Config.in.gdb \
551 |grep
-i
"$$gdbversion$$" \
552 |sed
-e
"s#^config \(.*\)#\1=y#" \
553 >> $(ADK_TOPDIR
)/.defconfig
; \
556 @if
[ ! -z
"$(ADK_APPLIANCE)" ];then \
557 $(CONFIG
)/conf
--defconfig
=.defconfig
$(CONFIG_CONFIG_IN
); \
561 @if
[ ! -z
"$(ADK_APPLIANCE)" ];then \
562 grep
"^config" target
/config
/Config.in.tasks \
563 |grep
-i
"_$(ADK_APPLIANCE)"\
$$ \
564 |sed
-e
"s#^config \(.*\)#\1=y#" \
565 >> $(ADK_TOPDIR
)/all.config
; \
567 @if
[ ! -z
"$(ADK_TARGET_ARCH)" ];then \
568 grep
"^config" target
/config
/Config.in.arch.choice \
569 |grep
-i
"$(ADK_TARGET_ARCH)"\
$$ \
570 |sed
-e
"s#^config \(.*\)#\1=y#" \
571 >> $(ADK_TOPDIR
)/all.config
; \
573 @for symbol in
${DEFCONFIG}; do \
574 echo
$$symbol >> $(ADK_TOPDIR
)/all.config
; \
576 @if
[ ! -z
"$(ADK_TARGET_FS)" ];then \
577 grep
"^config" target
/config
/Config.in.rootfs \
578 |grep
-i
"$(ADK_TARGET_FS)" \
579 |sed
-e
"s#^config \(.*\)#\1=y#" \
580 >> $(ADK_TOPDIR
)/all.config
; \
582 @if
[ ! -z
"$(ADK_TARGET_LIBC)" ];then \
583 grep
"^config" target
/config
/Config.in.libc \
584 |grep
-i
"$(ADK_TARGET_LIBC)" \
585 |sed
-e
"s#^config \(.*\)#\1=y#" \
586 >> $(ADK_TOPDIR
)/all.config
; \
588 @if
[ ! -z
"$(ADK_TARGET_SYSTEM)" ];then \
589 system
=$$(echo
"$(ADK_TARGET_SYSTEM)" |sed
-e
"s/-/_/g"); \
590 grep
-h
"^config" target
/*/Config.in.systems \
591 |grep
-i
"$$system$$" \
592 |sed
-e
"s#^config \(.*\)#\1=y#" \
593 >> $(ADK_TOPDIR
)/all.config
; \
596 menuconfig
: $(CONFIG
)/mconf defconfig .menu
597 @if
[ ! -f .config
];then \
598 $(CONFIG
)/conf
--olddefconfig
$(CONFIG_CONFIG_IN
); \
600 @
$(CONFIG
)/mconf
$(CONFIG_CONFIG_IN
)
603 _config
: $(CONFIG
)/conf allconfig .menu
605 @
$(CONFIG
)/conf
${W} $(CONFIG_CONFIG_IN
)
609 @printf
" ---> cleaning build directories, files and downloads.. "
610 @
$(MAKE
) -C
$(CONFIG
) clean
611 @
rm -rf
$(BUILD_DIR_PFX
) $(FW_DIR_PFX
) $(TARGET_DIR_PFX
) $(DL_DIR
)
612 @
rm -rf
$(TOOLCHAIN_DIR_PFX
) $(STAGING_TARGET_DIR_PFX
)
613 @
rm -rf
$(STAGING_HOST_DIR_PFX
) $(STAGING_TARGET_DIR_PFX
) $(STAGING_PKG_DIR_PFX
)
614 @
rm -rf package
/pkglist.d package
/pkgconfigs.d
615 @
rm -f .config
* .defconfig .tmpconfig.h
all.config make.log
616 @
rm -f .menu .rebuild.
* package
/Depends.mk .ADK_HAVE_DOT_CONFIG prereq.mk
617 @
rm -f target
/*/Config.in.arch target
/*/Config.in.systems
618 @
rm -f target
/config
/Config.in.arch.choice target
/config
/Config.in.arch.default
619 @
rm -f target
/config
/Config.in.system.choice target
/config
/Config.in.system.default
620 @
rm -f package
/Config.in.auto
* target
/config
/Config.in.system target
/config
/Config.in.tasks
621 @
rm -f target
/config
/Config.in.prereq target
/config
/Config.in.scripts
622 @
rm -f adk
/tools
/pkgmaker adk
/tools
/depmaker adk
/tools
/pkgrebuild
625 endif # ! ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
627 $(ADK_TOPDIR
)/adk
/tools
/pkgmaker
: $(ADK_TOPDIR
)/adk
/tools
/pkgmaker.c
$(ADK_TOPDIR
)/adk
/tools
/sortfile.c
$(ADK_TOPDIR
)/adk
/tools
/strmap.c
628 @
$(HOST_CC
) $(HOST_CFLAGS
) -o
$@ adk
/tools
/pkgmaker.c adk
/tools
/sortfile.c adk
/tools
/strmap.c
630 $(ADK_TOPDIR
)/adk
/tools
/pkgrebuild
: $(ADK_TOPDIR
)/adk
/tools
/pkgrebuild.c
$(ADK_TOPDIR
)/adk
/tools
/strmap.c
631 @
$(HOST_CC
) $(HOST_CFLAGS
) -o
$@ adk
/tools
/pkgrebuild.c adk
/tools
/strmap.c
633 $(ADK_TOPDIR
)/adk
/tools
/depmaker
: $(ADK_TOPDIR
)/adk
/tools
/depmaker.c
634 @
$(HOST_CC
) $(HOST_CFLAGS
) -o
$@
$(ADK_TOPDIR
)/adk
/tools
/depmaker.c
636 menu .menu
: $(wildcard package
/*/Makefile
) $(wildcard target
/*/systems
) $(wildcard target
/*/systems
/*) $(ADK_TOPDIR
)/adk
/tools
/pkgmaker
$(ADK_TOPDIR
)/adk
/tools
/pkgrebuild
$(wildcard tasks
/*)
637 @printf
" ---> generating menu structure.. "
638 @
$(SHELL
) $(ADK_TOPDIR
)/scripts
/create-menu
639 @
$(ADK_TOPDIR
)/adk
/tools
/pkgmaker
643 dep
: $(ADK_TOPDIR
)/adk
/tools
/depmaker
644 @printf
" ---> generating dependencies.. "
645 @
$(ADK_TOPDIR
)/adk
/tools
/depmaker
> ${ADK_TOPDIR}/package
/Depends.mk
650 include $(ADK_TOPDIR
)/toolchain
/gcc
/Makefile.inc
653 @
-rm adk
/tests
/adk.exp adk
/tests
/master.exp
>/dev
/null
2>&1
654 @sed
-e
"s#@ADK_TARGET_IP@#$(ADK_TARGET_IP)#" \
655 -e
"s#@ADK_TARGET_PORT@#$(ADK_TARGET_PORT)#" \
656 adk
/tests
/adk.exp.in
> adk
/tests
/adk.exp
657 @sed
-e
"s#@ADK_TOPDIR@#$(ADK_TOPDIR)#" adk
/tests
/master.exp.in
> \
660 check-gcc
: check-dejagnu
661 env DEJAGNU
=$(ADK_TOPDIR
)/adk
/tests
/master.exp \
662 $(MAKE
) -C
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/$(PKG_NAME
)-$(PKG_VERSION
)-final
/gcc
-k check-c
664 check-g
++: check-dejagnu
665 env DEJAGNU
=$(ADK_TOPDIR
)/adk
/tests
/master.exp \
666 $(MAKE
) -C
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/$(PKG_NAME
)-$(PKG_VERSION
)-final
/gcc
-k check-c
++
668 check: check-gcc check-g
++
671 @printf
-- "---OPENADK-INFO---\n"
672 @printf
"ADK_TOPDIR=$(ADK_TOPDIR)\n"
673 @printf
"TARGET_COMPILER_PREFIX=${TARGET_COMPILER_PREFIX}\n"
674 @printf
"TOOLCHAIN_DIR=$(TOOLCHAIN_DIR)\n"
675 @printf
"TARGET_PATH=$(TARGET_PATH)\n"
676 @printf
"LINUX_DIR=$(LINUX_DIR)\n"
677 @printf
-- "---OPENADK-INFO---\n"