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 _UNLIMIT
= __limit
=$$(ulimit
-dH
2>/dev
/null
); \
5 test -n
"$$__limit" && ulimit
-Sd
$$__limit; ulimit
-n
1024;
7 all: .prereq_done checkreloc
8 @
${_UNLIMIT} ${GMAKE_INV} all
11 @
(echo
; echo
"Build started on $$(LC_ALL=C LANGUAGE=C date)"; \
12 set
-x
; ${_UNLIMIT} ${GMAKE_FMK} ADK_VERBOSE
=1 all) 2>&1 | tee
-a make.log
15 @echo
'Configuration targets:'
16 @echo
' config - Update current config utilising a line-oriented program'
17 @echo
' menuconfig - Update current config utilising a menu based program'
18 @echo
' (default when .config does not exist)'
19 @echo
' oldconfig - Update current config utilising a provided .configs base'
20 @echo
' defconfig - New config with defaults'
21 @echo
' allmodconfig - New config selecting all symbols with m'
22 @echo
' allyesconfig - New config selecting all symbols with y'
23 @echo
' allnoconfig - New config where all options are answered with no'
26 @echo
' help - Print this help text'
27 @echo
' pkg-help - Print help about selectively compiling single packages'
28 @echo
' dev-help - Print help for developers / package maintainers'
30 @echo
'Common targets:'
31 @echo
' download - fetches all needed distfiles'
32 @echo
' kernelconfig - view the target kernel configuration'
34 @echo
'Cleaning targets:'
35 @echo
' clean - Remove firmware and build directories'
36 @echo
' cleandir - Same as "clean", but also remove all built toolchains'
37 @echo
' cleansystem - Same as "cleandir", but only remove active system'
38 @echo
' cleankernel - Remove kernel dir, useful if you changed any kernel patches'
39 @echo
' distclean - Same as "cleandir", but also remove downloaded'
40 @echo
' distfiles and .config'
42 @echo
'Other generic targets:'
43 @echo
' all - Build everything as specified in .config'
44 @echo
' (default if .config exists)'
45 @echo
' v - Same as "all" but with logging to make.log enabled'
48 @echo
'Package specific targets (use with "package=<pkg-name>" parameter):'
49 @echo
' fetch - Download the necessary distfile'
50 @echo
' extract - Same as "fetch", but also extract the distfile'
51 @echo
' patch - Same as "extract", but also patch the source'
52 @echo
' build - Same as "patch", but also build the binaries'
53 @echo
' fake - Same as "build", but also install the binaries'
54 @echo
' package - Same as "fake", but also create the package'
55 @echo
' clean - Deinstall and remove the build area'
56 @echo
' distclean - Same as "clean", but also remove the distfiles'
58 @echo
'Short package rebuilding guide:'
59 @echo
' run "make package=<pkgname> clean" to remove all generated binaries'
60 @echo
' run "make package=<pkgname> package" to build everything and create the package(s)'
62 @echo
'This does not automatically resolve package dependencies!'
65 @echo
'Fast way of updating package patches:'
66 @echo
' run "make package=<pkgname> clean" to start with a good base'
67 @echo
' run "make package=<pkgname> patch" to fetch, unpack and patch the source'
68 @echo
' edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
69 @echo
' run "make package=<pkgname> update-patches" to regenerate patch files'
71 @echo
'All changed patches will be opened with your $$EDITOR,'
72 @echo
'so you can add a description and verify the modifications.'
74 @echo
'Adding a new package:'
75 @echo
'make PKG=foo VER=1.0 newpackage'
76 @echo
'Adding a new simple library package:'
77 @echo
'make PKG=foo VER=1.0 TYPE=lib newpackage'
78 @echo
'Adding a new simple program package:'
79 @echo
'make PKG=foo VER=1.0 TYPE=prog newpackage'
86 @
${GMAKE_INV} _config W
=
88 oldconfig
: .prereq_done
89 @
${GMAKE_INV} _config W
=--oldconfig
91 download
: .prereq_done
92 @
${GMAKE_INV} toolchain
/download
94 @
${GMAKE_INV} package
/download
96 cleankernel kernelclean
: .prereq_done
97 -@
${GMAKE_INV} cleankernel
99 cleandir dirclean
: .prereq_done
100 -@
${GMAKE_INV} cleandir
101 @
-rm -f make.log .prereq_done
103 cleansystem
: .prereq_done
104 -@
${GMAKE_INV} cleansystem
105 @
-rm -f make.log .prereq_done
108 -@
${GMAKE_INV} distclean
109 @
-rm -f make.log .prereq_done
114 targethelp
: .prereq_done
115 @
${GMAKE_INV} targethelp
117 kernelconfig
: .prereq_done
118 @
${GMAKE_INV} kernelconfig
120 newpackage
: .prereq_done
121 @
${GMAKE_INV} newpackage
123 image_clean imageclean cleanimage
: .prereq_done
124 @
${GMAKE_INV} image_clean
126 menuconfig
: .prereq_done
127 @
${GMAKE_INV} menuconfig
129 defconfig
: .prereq_done
130 @
${GMAKE_INV} defconfig
132 allnoconfig
: .prereq_done
133 @
${GMAKE_INV} KCONFIG_ALLCONFIG
=all.config _config W
=--allnoconfig
135 allyesconfig
: .prereq_done
136 @
${GMAKE_INV} KCONFIG_ALLCONFIG
=all.config _config W
=--allyesconfig
138 allmodconfig
: .prereq_done
139 @
${GMAKE_INV} KCONFIG_ALLCONFIG
=all.config _config W
=--allmodconfig
141 package_index
: .prereq_done
142 @
${GMAKE_INV} package_index
144 buildall
: .prereq_done
145 @
${GMAKE_INV} buildall
150 check-gcc
: .prereq_done
151 @
${GMAKE_INV} check-gcc
153 check-g
++: .prereq_done
154 @
${GMAKE_INV} check-g
++
167 @
${GMAKE} .prereq_done
171 @
${GMAKE} .prereq_done NO_ERROR
=1
175 @
-rm -rf .prereq_done
176 @if
! bash
--version
2>&1 | grep
-F
'GNU bash' >/dev
/null
2>&1; then \
177 echo
"GNU bash needs to be installed."; \
180 @echo
"ADK_TOPDIR:=$$(readlink -nf . 2>/dev/null || pwd -P)" >prereq.mk
181 @echo
"BASH:=$$(which bash)" >>prereq.mk
182 @if
[ -z
"$$(which gmake 2>/dev/null )" ]; then \
183 echo
"GMAKE:=$$(which make)" >>prereq.mk
;\
185 echo
"GMAKE:=$$(which gmake)" >>prereq.mk
;\
187 @echo
"GNU_HOST_NAME:=$$(${CC} -dumpmachine)" >>prereq.mk
188 @echo
"ARCH_FOR_BUILD:=$$(${CC} -dumpmachine | sed \
189 -e 's/x86_64-linux-gnux32/x32/' \
191 -e 's/sparc.*/sparc/' \
192 -e 's/armeb.*/armeb/g' \
194 -e 's/m68k.*/m68k/' \
196 -e 's/mips-.*/mips/' \
197 -e 's/mipsel-.*/mipsel/' \
198 -e 's/i[3-9]86/x86/' \
200 @echo
'HOST_CC:=${CC}' >>prereq.mk
201 @echo
'HOST_CXX:=${CXX}' >>prereq.mk
202 @echo
'LANGUAGE:=C' >>prereq.mk
203 @echo
'LC_ALL:=C' >>prereq.mk
204 @echo
'MAKE:=$${GMAKE}' >>prereq.mk
205 @echo
"OStype:=$$(env uname)" >>prereq.mk
206 @echo
"_PATH:=$$PATH" >>prereq.mk
207 @echo
"PATH:=\$${ADK_TOPDIR}/scripts:/usr/sbin:$$PATH" >>prereq.mk
208 @echo
"SHELL:=$$(which bash)" >>prereq.mk
209 @echo
"GIT:=$$(which git 2>/dev/null)" >>prereq.mk
210 @env NO_ERROR
=${NO_ERROR} BASH
="$$(which bash)" \
211 CC
='${CC}' CPPFLAGS
='${CPPFLAGS}' \
212 bash scripts
/scan-tools.sh
213 @echo
'===> Prerequisites checked successfully.'
218 @bash scripts
/reloc.sh
220 .PHONY
: prereq prereq-noerror checkreloc