arc: update toolchain
[openadk.git] / Makefile.adk
blob85df7e0b51287f786812282a75baaf049b615e7e
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;
11 ifneq (${package},)
12 subdir:=        package/${package}
13 _subdir_dep:=   ${ADK_TOPDIR}/.config
14 endif
16 ifneq (${subdir},)
17 ${MAKECMDGOALS}: _subdir
19 _subdir: ${_subdir_dep}
20         cd ${subdir} && ADK_TOPDIR=${ADK_TOPDIR} DEVELOPER=1 ADK_VERBOSE=1 \
21             $(MAKE) ${MAKECMDGOALS}
22 else
24 all:
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
31 help:
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'
41         @echo ''
42         @echo 'Help targets:'
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'
46         @echo ''
47         @echo 'Common targets:'
48         @echo '  download     - fetches all needed distfiles'
49         @echo '  kernelconfig - view the target kernel configuration'
50         @echo ''
51         @echo 'Cleaning targets:'
52         @echo '  clean        - Remove firmware and build directories'
53         @echo '  cleandir     - Same as "clean", but also remove all built toolchains'
54         @echo '  cleansystem  - Same as "cleandir", but only remove active system'
55         @echo '  cleankernel  - Remove kernel dir, useful if you changed any kernel patches'
56         @echo '  distclean    - Same as "cleandir", but also remove downloaded'
57         @echo '                 distfiles and .config'
58         @echo ''
59         @echo 'Other generic targets:'
60         @echo '  all          - Build everything as specified in .config'
61         @echo '                 (default if .config exists)'
62         @echo '  v            - Same as "all" but with logging to make.log enabled'
64 pkg-help:
65         @echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
66         @echo '  fetch        - Download the necessary distfile'
67         @echo '  extract      - Same as "fetch", but also extract the distfile'
68         @echo '  patch        - Same as "extract", but also patch the source'
69         @echo '  build        - Same as "patch", but also build the binaries'
70         @echo '  fake         - Same as "build", but also install the binaries'
71         @echo '  package      - Same as "fake", but also create the package'
72         @echo '  clean        - Deinstall and remove the build area'
73         @echo '  distclean    - Same as "clean", but also remove the distfiles'
74         @echo ''
75         @echo 'Short package rebuilding guide:'
76         @echo '  run "make package=<pkgname> clean" to remove all generated binaries'
77         @echo '  run "make package=<pkgname> package" to build everything and create the package(s)'
78         @echo ''
79         @echo 'This does not automatically resolve package dependencies!'
81 dev-help:
82         @echo 'Fast way of updating package patches:'
83         @echo '  run "make package=<pkgname> clean" to start with a good base'
84         @echo '  run "make package=<pkgname> patch" to fetch, unpack and patch the source'
85         @echo '  edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
86         @echo '  run "make package=<pkgname> update-patches" to regenerate patch files'
87         @echo ''
88         @echo 'All changed patches will be opened with your $$EDITOR,'
89         @echo 'so you can add a description and verify the modifications.'
90         @echo ''
91         @echo 'Adding a new package:'
92         @echo 'make PKG=foo VER=1.0 newpackage'
93         @echo 'Adding a new simple library package:'
94         @echo 'make PKG=foo VER=1.0 TYPE=lib newpackage'
95         @echo 'Adding a new simple program package:'
96         @echo 'make PKG=foo VER=1.0 TYPE=prog newpackage'
98 clean:
99         @${GMAKE_INV} clean
101 config:
102         @${GMAKE_INV} _config W=
104 oldconfig:
105         @${GMAKE_INV} _config W=--oldconfig
107 download:
108         @${GMAKE_INV} toolchain/download
109         @${GMAKE_INV} dep
110         @${GMAKE_INV} package/download
112 cleankernel:
113         -@${GMAKE_INV} cleankernel
115 cleandir:
116         -@${GMAKE_INV} cleandir
118 cleansystem:
119         -@${GMAKE_INV} cleansystem
121 distclean:
122         -${GMAKE_INV} distclean
124 image:
125         @${GMAKE_INV} image
127 targethelp:
128         @${GMAKE_INV} targethelp
130 kernelconfig:
131         @${GMAKE_INV} kernelconfig
133 newpackage:
134         @${GMAKE_INV} newpackage
136 image_clean imageclean cleanimage:
137         @${GMAKE_INV} image_clean
139 menuconfig:
140         @${GMAKE_INV} menuconfig
142 defconfig:
143         @${GMAKE_INV} defconfig
145 allnoconfig:
146         @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
148 allyesconfig:
149         @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
151 allmodconfig:
152         @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
154 package_index:
155         @${GMAKE_INV} package_index
157 buildall:
158         @${GMAKE_INV} buildall
160 check:
161         @${GMAKE_INV} check
163 check-gcc:
164         @${GMAKE_INV} check-gcc
166 check-g++:
167         @${GMAKE_INV} check-g++
169 menu:
170         @${GMAKE_INV} menu
172 dep:
173         @${GMAKE_INV} dep
175 world:
176         @${GMAKE_INV} world
178 endif
179 # DO NOT DELETE