xenomai: new package, only mercury for now supported
[openadk.git] / Makefile.adk
blob0938316baa8e9b3a78cbd4eb1c70875531426c8e
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 '  savekconfig  - save changes of "make kernelconfig" to an external'
51         @echo '                 configuration file (if configured)'
52         @echo ''
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'
60         @echo ''
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'
66 pkg-help:
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'
76         @echo ''
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)'
80         @echo ''
81         @echo 'This does not automatically resolve package dependencies!'
83 dev-help:
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'
89         @echo ''
90         @echo 'All changed patches will be opened with your $$EDITOR,'
91         @echo 'so you can add a description and verify the modifications.'
92         @echo ''
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'
100 clean:
101         @${GMAKE_INV} clean
103 config:
104         @${GMAKE_INV} _config W=
106 oldconfig:
107         @${GMAKE_INV} _config W=--oldconfig
109 download:
110         @${GMAKE_INV} toolchain/download
111         @${GMAKE_INV} dep
112         @${GMAKE_INV} package/download
114 cleankernel:
115         -@${GMAKE_INV} cleankernel
117 cleandir:
118         -@${GMAKE_INV} cleandir
120 cleansystem:
121         -@${GMAKE_INV} cleansystem
123 distclean:
124         -${GMAKE_INV} distclean
126 image:
127         @${GMAKE_INV} image
129 targethelp:
130         @${GMAKE_INV} targethelp
132 kernelconfig:
133         @${GMAKE_INV} kernelconfig
135 savekconfig:
136         @${GMAKE_INV} savekconfig
138 newpackage:
139         @${GMAKE_INV} newpackage
141 image_clean imageclean cleanimage:
142         @${GMAKE_INV} image_clean
144 menuconfig:
145         @${GMAKE_INV} menuconfig
147 defconfig:
148         @${GMAKE_INV} defconfig
150 allnoconfig:
151         @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allnoconfig
153 allyesconfig:
154         @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allyesconfig
156 allmodconfig:
157         @${GMAKE_INV} KCONFIG_ALLCONFIG=all.config _config W=--allmodconfig
159 package_index:
160         @${GMAKE_INV} package_index
162 buildall:
163         @${GMAKE_INV} buildall
165 check:
166         @${GMAKE_INV} check
168 check-gcc:
169         @${GMAKE_INV} check-gcc
171 check-g++:
172         @${GMAKE_INV} check-g++
174 menu:
175         @${GMAKE_INV} menu
177 dep:
178         @${GMAKE_INV} dep
180 world:
181         @${GMAKE_INV} world
183 endif
184 # DO NOT DELETE