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 ADK_TOPDIR:= $(shell pwd)
5 GMAKE_FMK= ${MAKE} -f $(PWD)/mk/build.mk
6 GMAKE_INV= ${GMAKE_FMK} --no-print-directory
8 _UNLIMIT= __limit=$$(ulimit -dH 2>/dev/null); \
9 test -n "$$__limit" && ulimit -Sd $$__limit; ulimit -n 1024;
12 subdir:= package/${package}
13 _subdir_dep:= ${ADK_TOPDIR}/.config
17 ${MAKECMDGOALS}: _subdir
19 _subdir: ${_subdir_dep}
20 cd ${subdir} && ADK_TOPDIR=${ADK_TOPDIR} DEVELOPER=1 ADK_VERBOSE=1 \
21 $(MAKE) ${MAKECMDGOALS}
25 @${_UNLIMIT} $(GMAKE_INV) world
28 @(echo; echo "Build started on $$(LC_ALL=C LANGUAGE=C date)"; \
29 set -x; ${_UNLIMIT} ${GMAKE_FMK} ADK_VERBOSE=1 all) 2>&1 | tee -a make.log
32 @echo 'Configuration targets:'
33 @echo ' config - Update current config utilising a line-oriented program'
34 @echo ' menuconfig - Update current config utilising a menu based program'
35 @echo ' (default when .config does not exist)'
36 @echo ' oldconfig - Update current config utilising a provided .configs base'
37 @echo ' defconfig - New config with defaults'
38 @echo ' allmodconfig - New config selecting all symbols with m'
39 @echo ' allyesconfig - New config selecting all symbols with y'
40 @echo ' allnoconfig - New config where all options are answered with no'
43 @echo ' help - Print this help text'
44 @echo ' pkg-help - Print help about selectively compiling single packages'
45 @echo ' dev-help - Print help for developers / package maintainers'
47 @echo 'Common targets:'
48 @echo ' download - fetches all needed distfiles'
49 @echo ' kernelconfig - view the target kernel configuration'
50 @echo ' savekconfig - save changes of "make kernelconfig" to an external'
51 @echo ' configuration file (if configured)'
53 @echo 'Cleaning targets:'
54 @echo ' clean - Remove firmware and build directories'
55 @echo ' cleandir - Same as "clean", but also remove all built toolchains'
56 @echo ' cleansystem - Same as "cleandir", but only remove active system'
57 @echo ' cleankernel - Remove kernel dir, useful if you changed any kernel patches'
58 @echo ' distclean - Same as "cleandir", but also remove downloaded'
59 @echo ' distfiles and .config'
61 @echo 'Other generic targets:'
62 @echo ' all - Build everything as specified in .config'
63 @echo ' (default if .config exists)'
64 @echo ' v - Same as "all" but with logging to make.log enabled'
67 @echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
68 @echo ' fetch - Download the necessary distfile'
69 @echo ' extract - Same as "fetch", but also extract the distfile'
70 @echo ' patch - Same as "extract", but also patch the source'
71 @echo ' build - Same as "patch", but also build the binaries'
72 @echo ' fake - Same as "build", but also install the binaries'
73 @echo ' package - Same as "fake", but also create the package'
74 @echo ' clean - Deinstall and remove the build area'
75 @echo ' distclean - Same as "clean", but also remove the distfiles'
77 @echo 'Short package rebuilding guide:'
78 @echo ' run "make package=<pkgname> clean" to remove all generated binaries'
79 @echo ' run "make package=<pkgname> package" to build everything and create the package(s)'
81 @echo 'This does not automatically resolve package dependencies!'
84 @echo 'Fast way of updating package patches:'
85 @echo ' run "make package=<pkgname> clean" to start with a good base'
86 @echo ' run "make package=<pkgname> patch" to fetch, unpack and patch the source'
87 @echo ' edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
88 @echo ' run "make package=<pkgname> update-patches" to regenerate patch files'
90 @echo 'All changed patches will be opened with your $$EDITOR,'
91 @echo 'so you can add a description and verify the modifications.'
93 @echo 'Adding a new package:'
94 @echo 'make PKG=foo VER=1.0 newpackage'
95 @echo 'Adding a new simple library package:'
96 @echo 'make PKG=foo VER=1.0 TYPE=lib newpackage'
97 @echo 'Adding a new simple program package:'
98 @echo 'make PKG=foo VER=1.0 TYPE=prog newpackage'
104 @${GMAKE_INV} _config W=
107 @${GMAKE_INV} _config W=--oldconfig
110 @${GMAKE_INV} toolchain/download
112 @${GMAKE_INV} package/download
115 -@${GMAKE_INV} cleankernel
118 -@${GMAKE_INV} cleandir
121 -@${GMAKE_INV} cleansystem
124 -${GMAKE_INV} distclean
130 @${GMAKE_INV} targethelp
133 @${GMAKE_INV} kernelconfig
136 @${GMAKE_INV} savekconfig
139 @${GMAKE_INV} newpackage
141 image_clean imageclean cleanimage:
142 @${GMAKE_INV} image_clean
145 @${GMAKE_INV} menuconfig
148 @${GMAKE_INV} defconfig
151 @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
154 @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
157 @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
160 @${GMAKE_INV} package_index
163 @${GMAKE_INV} buildall
169 @${GMAKE_INV} check-gcc
172 @${GMAKE_INV} check-g++