aboutsummaryrefslogtreecommitdiffstats
path: root/rules.mk
Commit message (Collapse)AuthorAgeFilesLines
* build: improve ccache supportRoman Yeryomin2020-07-111-0/+3
| | | | | | | | | | | | | | | | | | Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR). This allows to do clean and dirclean. Cache hit rate for test build after dirclean is ~65%. If CCACHE is enabled stats are printed out at the end of building process. CCACHE_DIR config variable allows to override default, which could be useful when sharing cache with many builds. cacheclean make target allows to clean the cache. Changes from v1: - remove ccache directory using CCACHE_DIR variable - remove ccache leftovers from sdk and toolchain make files - introduce CONFIG_CCACHE_DIR variable - introduce cacheclean make target Signed-off-by: Roman Yeryomin <roman@advem.lv>
* rules.mk: remove "$(STAGING_DIR)/include"Sebastian Kemper2019-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "$(STAGING_DIR)/include" was carried over from buildroot-ng to OpenWrt in commit 60c1f0f64d23003a19a07d6b9638542130f6641d. buildroot has dropped this directory a long time ago. In OpenWrt the directory is still created by the PrepareStaging macro and is part of the default TARGET_CPPFLAGS. But nothing at all installs headers into this directory, nor should anything be installed under this path. Removing this directory from TARGET_CPPFLAGS will cut down the log noise a bit. Not only will CPPFLAGS be shorter, there will be less warnings set off by "-Wmissing-include-dirs" (or even failures when paired with "-Werror"). After all the directory does not even _exist_ in the SDKs, which are used on the build bots when building packages (see [1] and [2]). make[8]: Entering directory '/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/libmbim-1.20.0/src/common' CC libmbim_common_la-mbim-common.lo cc1: error: /builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/include: No such file or directory [-Werror=missing-include-dirs] cc1: all warnings being treated as errors [1] https://github.com/openwrt/packages/issues/10377 [2] https://github.com/openwrt/packages/pull/10378 Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net> Acked-by: Jo-Philipp Wich <jo@mein.io> Acked-by: Rosen Penev <rosenp@gmail.com>
* toolchain,build: prefer -ffile-prefix-map for gcc-8+Paul Spooren2019-10-091-4/+4
| | | | | | | | | | | -ffile-prefix-map=OLD=NEW is an alias for both -fdebug-prefix-map and -fmacro-prefix-map and is available since GCC 8. Co-Developed-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Paul Spooren <mail@aparcar.org> [refactored into separate commit] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* target/imagebuilder: use multi-thread support for xz compressionMartin Schiller2019-10-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | This speeds up the packing of the imagebuilder a lot: imagebuilder-T0.tar.xz real 0m25.199s user 2m45.967s sys 0m1.218s imagebuilder-T1.tar.xz real 2m02.543s user 2m02.418s sys 0m1.653s imagebuilder-T2.tar.xz real 1m03.684s user 1m59.931s sys 0m0.587s imagebuilder-T3.tar.xz real 0m48.033s user 2m02.904s sys 0m0.637s imagebuilder-T4.tar.xz real 0m38.963s user 2m15.521s sys 0m0.783s imagebuilder-T5.tar.xz real 0m37.994s user 2m21.461s sys 0m0.919s imagebuilder-T6.tar.xz real 0m39.524s user 2m48.115s sys 0m1.279s imagebuilder-T7.tar.xz real 0m34.061s user 2m45.097s sys 0m1.174s imagebuilder-T8.tar.xz real 0m27.286s user 2m55.449s sys 0m1.329s imagebuilder-T9.tar.xz real 0m25.205s user 2m44.894s sys 0m1.208s To keep the output reproducible in any case, we enforce a minimum amount of 2 threads. Signed-off-by: Martin Schiller <ms@dev.tdt.de> [refactored into reusable NPROC var, more verbose commit message] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* rules: allow arbitrary log destinationPaul Spooren2019-09-291-1/+1
| | | | | | | | Add option BUILD_LOG_DIR to menuconfig to change log destination. The mix-up of *DIR* and *FOLDER* is confusing however. Signed-off-by: Paul Spooren <mail@aparcar.org>
* librpc: remove packageAndy Walsh2019-01-221-2/+0
| | | | | | | | | * replaced with packages/libtirpc * remove busybox options rarely used/deprecated BUSYBOX_CONFIG_FEATURE_MOUNT_NFS BUSYBOX_CONFIG_FEATURE_INETD_RPC Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
* rules.mk: fix syntax errorJo-Philipp Wich2018-11-291-1/+1
| | | | | | | Fix broken assignment operator added in a previous commit. Fixes db73ec9f51 ("rules.mk: add INSTALL_SUID macro") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rules.mk: add INSTALL_SUID macroJo-Philipp Wich2018-11-291-0/+1
| | | | | | This is useful for packages that want to stage SUID executables. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rules.mk: add ESED commandKonstantin Demin2018-09-241-0/+1
| | | | | | | ESED is SED with extended regular expressions turned on. Command line and usage are the same as for SED. Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
* toolchain/gcc: add config symbol to determine how to apply path remappingSyrone Wong2018-08-201-3/+3
| | | | | | | | | Added boolean symbol for GCC 8 and higher, when we add newer GCC, we don't have to modify rules.mk to keep things consistant. Fixes: da9d760 ("rules.mk: replace iremap when using GCC 8") Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
* rules.mk: replace iremap when using GCC 8Syrone Wong2018-07-221-0/+4
| | | | | | The original -iremap is replaced by -fmacro-prefix-map in GCC 8 Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
* build: include package directory in sha256sums when running on buildbotJo-Philipp Wich2018-06-271-1/+2
| | | | | | | | | | In order to be able to better compare files to sync in the future, include all BIN_DIR subdirectories in the checksum calculation. To not break existing applications, restrict the recursive checksumming to CONFIG_BUILDBOT for now. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* imagebuilder: reuse rootfs preparation from rootfs.mkMatthias Schiffer2018-03-071-0/+1
| | | | | | | | | | | | In addition to removing redundant code, this fixes various issues in IB-generated images that have been fixed in prepare_rootfs before, including better handling of CONFIG_CLEAN_IPKG and enabling of initscripts from FILES. We also reuse the opkg macro and remove --force-... flags that have been removed from rootfs.mk as well. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* rules.mk: drop `include_mk` build ruleAlexandru Ardelean2018-01-261-4/+0
| | | | | | | | | | | | | | | | | The only users of this were the python packages from the `packages` feed. The 2 python interpreters would export some mk files (e.g. python-package.mk) and then other python packages would include it via this rule. But there's a few things wrong with this approach, most of them drawing from the fact that python host needs to be built first, to export these mk files. By now all uses of include_mk have been corrected in the feeds and this can be removed. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* build: remove use of STAGING_DIR_HOST/usr (fixes cmake build error on macOS)Felix Fietkau2018-01-171-2/+2
| | | | | | | | This directory is never created, nor is it used anywhere. Using it in HOST_LDFLAGS causes a linker warning to be emitted on macOS, which messes with cmake configure tests. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* rules.mk: export TMPDIRJo-Philipp Wich2017-12-121-0/+1
| | | | | | | | Set TMPDIR to the same value as the existing TMP_DIR variable in order to let gcc and various other utilities use the local temporary directory instead of the system-wide one. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rukes.mk: this patch broken grub2 buildsJohn Crispin2017-09-011-2/+0
| | | | | | | | Revert "rules.mk: add missing CPP definition" This reverts commit 569f74ef49bae9326a723050a400346686983d86. Signed-off-by: John Crispin <john@phrozen.org>
* rules.mk: add missing CPP definitionBangLang Huang2017-08-231-0/+2
| | | | Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
* rules.mk: make PKG_CONFIG_DEPENDS properly track string valuesMatthias Schiffer2017-02-271-1/+1
| | | | | | | | | The confvar macro is adjusted to not only consider if a variable has a value or not, but also the value itself. Instead of creating a string of 'y' and 'n' characters, all variable names and values are concatenated and hashed. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: Pass -iremap gcc option as a single argumentMichal Sojka2017-02-091-1/+1
| | | | | | | | | | | | | | | Passing -iremap argument separately causes problems with projects that use scons and its ParseFlags function. Consider this SConscript example: env = Environment() d = env.ParseFlags("-iremap one:two") ParseFlags will interpret one:two as a file name and the returned dict d will contain only "-iremap". When the -iremap is passed to the compiler without an argument, compilation obviously fails. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* build: make <subdir>/install opt-in, use it for target/ onlyFelix Fietkau2017-02-091-1/+1
| | | | | | | Fixes buildbot errors on running make target/install or toolchain/install Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: remove libc version suffix from build/staging directoriesFelix Fietkau2017-02-071-2/+1
| | | | | | Our supported libcs are ABI compatible across version upgrades Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: Suffix build directory with _$(LIBC) for external toolchainsFlorian Fainelli2017-01-291-1/+2
| | | | | | | | For external toolchain, we also know the type of C library used, and the toolchain triplet may not always be reflective of that, therefore make $(TARGET_DIR_NAME) suffixed with _$(LIBC). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* build: introduce STAGING_DIR_IMAGEJo-Philipp Wich2017-01-271-0/+1
| | | | | | | | | | | Introduce a new location STAGING_DIR_IMAGE which is intended to be used by bootloader iamges and similar image-related artifacts. This directory is guaranteed to be persistent across kernel upgrades which might involve a removal of KERNEL_BUILD_DIR and is guranteed to be bundled with the image builder. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rules.mk: export STAGING_DIR_HOSTPKGMatthias Schiffer2017-01-191-1/+1
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: introduce extra targets that contain only proper dependenciesFelix Fietkau2017-01-181-4/+5
| | | | | | This can be used to check if targets like prepare or compile are up to date Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: define common subdir targets in rules.mkFelix Fietkau2017-01-181-0/+9
| | | | | | Reduce build system clutter and enable further rework Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common ↵Matthias Schiffer2017-01-181-5/+5
| | | | | | | | | | | | | directory for all targets Using a single host package staging dir (and build dir) significantly speeds up builds when multiple targets are built in succession, especially for large host packages like NodeJS. $(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most places; it is still used as destination for host files in Build/InstallDev. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: use mkhash to replace various quirky md5sum/openssl callsFelix Fietkau2017-01-051-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add defaults for PKG_SOURCE, PKG_SOURCE_SUBDIR, PKG_VERSIONFelix Fietkau2016-12-221-0/+2
| | | | | | | | This makes it easier to unify versioning of git based package downloads. PKG_SOURCE_DATE along with an 8-character abbreviation of the git hash is used as PKG_VERSION, PKG_RELEASE should be used like normal packages. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: implement make check and make package/X/checkFelix Fietkau2016-12-171-0/+8
| | | | | | | | | | | | | | | | This is intended to be used for a wide array of package sanity checks. The first check that is implemented is for the hash of downloaded files. It checks: - Missing hash - Use of SHA256 instead of MD5 - dl/<file> hash not matching hash in makefile - deprecated MD5SUM variable The deprecated MD5SUM variable check is skipped for feeds/ until OpenWrt is updated as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
* rules.mk: add STAGING_DIR_HOSTPKG variableJo-Philipp Wich2016-11-011-0/+1
| | | | | | | Add a STAGING_DIR_HOSTPKG variable which refers to $(STAGING_DIR)/host in order to prepare support for relocating that directory in the future. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: add checksum targetJo-Philipp Wich2016-08-011-0/+7
| | | | | | | | | | | | | | | Add a new "checksum" make target which generates an sha256sums file over the image files produced in bin/targets/ and automatically call it during make world after the package index generation. The advantage of this new target is that it is guaranteed to run after the images, the SDK and the ImageBuilder archives have been generated to ensure that they all end up in the checksum file. Fixes FS#51. Uses sed to postprocess the OpenSSL digest output into an sha256sum command compatible format. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rules.mk: introduce new variable OUTPUT_DIRJo-Philipp Wich2016-04-061-1/+4
| | | | | | | | | | | Introduce a new variable OUTPUT_DIR which refers to the parent bin/ directory without the architecture specific component. Also construct the BIN_DIR variable based on OUTPUT_DIR now and add both target and subtarget components to it to prevent different subtargets from overwriting each others files in bin/. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: disable the use of -iremap for UML (#21851)Felix Fietkau2016-02-131-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48718
* rules.mk: add TARGET_INIT_PATH toplevel variablesJo-Philipp Wich2016-02-081-0/+2
| | | | | | | | | Add a new variable TARGET_INIT_PATH which holds the default $PATH variable value configured in menuconfig. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 48676
* build: filter out -fno-plt for the kernel build, fixes #21712Felix Fietkau2016-01-281-2/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48515
* build: use -iremap feature to replace __FILE__ absolute path names in ↵Felix Fietkau2016-01-251-0/+4
| | | | | | | | | | packages with ones relative to $(BUILD_DIR) improves reproducible builds Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48489
* rules.mk: make the locked template available even if flock has not been ↵Felix Fietkau2016-01-201-3/+7
| | | | | | | | built yet (fall back to unlocked shell command) Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48414
* build: use a separate variable checking the subdir path (for host packages)Felix Fietkau2016-01-201-1/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48410
* host-build.mk: change default installation prefix of package/* host builds ↵Felix Fietkau2016-01-201-2/+2
| | | | | | | | to staging_dir/target-*/host Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48401
* build: move host build directories of package/* to build_dir/target-*/host/Felix Fietkau2016-01-201-2/+5
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48400
* build: add pure make tolower/toupper funtions that do not require shell callsFelix Fietkau2016-01-031-0/+14
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48105
* gcc: remove version 4.6, it is no longer neededFelix Fietkau2015-11-101-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 47443
* build: add -Wno-error=unused-result to target cflagsFelix Fietkau2015-11-101-1/+1
| | | | | | | | | | Many glibc functions have __warn_unused_result__ in so many different core functions, and failing the build for all of those simply does not make any sense Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 47440
* rules.mk: export STAGING_DIR_HOST to sub-makefiles and shellsFelix Fietkau2015-11-071-1/+1
| | | | | | | | | | | Certains host packages (like quilt) need to know the previously used install location at run-time. They currently use $STAGING_DIR, which causes issues on cleaned environment, where $STAGING_DIR doesn't exist yet. Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org> SVN-Revision: 47409
* build: Allow kernel modules to set build ID debug symbolFelix Fietkau2015-10-301-1/+2
| | | | | | | | | | | | | | | | | | | | This change adds support for specifying a build ID for kernel modules. This is done by setting PKG_BUILD_ID to a hexadecimal string, which will then be passed to the kernel linker. In addition, when this flag is set, the build ID debug symbol (.note.gnu.build-id) will not be stripped from the kernel module. This symbol is exported in sysfs by the kernel (if the kernel is compiled with CONFIG_KALLSYMS) and so can be used to uniquely identify a version of a kernel module in a running kernel. This is useful for keeping track of different versions of a module when doing experiments and development. Modules that specify the build ID will be ~100 bytes larger (depending on the length of the build ID specified). There is no size difference for kernel modules that do not set this variable. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> SVN-Revision: 47290
* rules.mk: remove GCC 4.4 and GCC 4.5 conditionalFelix Fietkau2015-08-251-2/+2
| | | | | | | | | gcc 4.4 was removed in r44957 gcc: remove 4.4.7 (only used by avr32) gcc 4.5 was removed in r36149 Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de> SVN-Revision: 46722
* toolchain: only use fortify-headers for muslSteven Barth2015-06-291-1/+5
| | | | | | Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 46138
* toolchain: add fortify-headers, enable FORTIFY_SOURCE by defaultSteven Barth2015-06-231-1/+1
| | | | | | Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 46117