Commit graph

112 commits

Author SHA1 Message Date
Thomas Langer
41faf52b0f build: Unset CDPATH to avoid problems
In some places the output of commands, which include "cd" are used.
In case of CDPATH the new path is printed, which might not be expected.
Disable the variable to avoid these problem.

When CDPATH was set by the user to some value like "export CDPATH=."
the git checkout done by the build system did not work anymore, the
git cloning aborted with such an error message for example:
....
Packing checkout...
tar: /disk/fs1/tmp2/mehrtens/pon-ugw/ugw-haps/openwrt/tmp/dl/ppa-drv-1.0\n@1534240258: Cannot stat: No such file or directory
tar: Date sample file not found
Try 'tar --help' or 'tar --usage' for more information.
.....

To avoid this, this patch makes the build system unset CDPATH inside
the build system, so the build system will still work even when the
user set this variable in his local environment.

Signed-off-by: Thomas Langer <thomas.langer@intel.com>
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
2018-08-25 11:10:28 +02:00
Jo-Philipp Wich
681e825f8f build: include package directory in sha256sums when running on buildbot
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>
2018-06-27 18:54:09 +02:00
Zoltan HERPAI
34bbbbf9c3 merge: base: update base-files and basic config
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2017-12-08 19:41:18 +01:00
Vitaly Chekryzhev
3ceb0fa7c5 build: prepare config.seed before package compilation
Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
2017-03-18 12:08:04 +01:00
Felix Fietkau
9467ce42da build: get rid of host.mk
Defined required host related variables in toplevel.mk instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-02-26 13:31:44 +01:00
Felix Fietkau
664918d891 Revert "build: always run package/cleanup before package/compile"
This reverts commit 2990a21058.
This introduces a race condition, let's fix this in buildbot instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-22 13:47:40 +01:00
Felix Fietkau
2990a21058 build: always run package/cleanup before package/compile
Remove unnecessary stampfile indirection
Fixes an issue with the command sequence used by buildbot

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-22 13:31:54 +01:00
Felix Fietkau
131db366a3 build: remove separate /install step for host builds
Reduces the number of recursive make invocations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-18 23:57:09 +01:00
Matthias Schiffer
3d71786154
build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common 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>
2017-01-18 19:47:36 +01:00
Hannu Nyman
c1b12aa838 Makefile: ensure that BIN_DIR exists for diffconfig
Ensure that BIN_DIR exists when the diffconfig target needs it.
Otherwise 'make diffconfig' fails after 'make clean'

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-01-08 18:50:00 +01:00
Jo-Philipp Wich
2a72a916ab build: add diffconfig target
Add a "diffconfig" build target which stores the output of
"scripts/diffconfig.sh" as "config.seed" in the image output directory and
invoke that target by default.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-04 11:03:53 +01:00
Felix Fietkau
7a315b0b5d build: implement make check and make package/X/check
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>
2016-12-17 10:36:25 +01:00
Felix Fietkau
f2de33b2c9 build: move merged package directory from bin/ to staging_dir
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-08-03 12:22:18 +02:00
Jo-Philipp Wich
27854a0a84 build: add checksum target
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>
2016-08-01 18:11:21 +02:00
Felix Fietkau
30d955a7a5 build: fix make clean, delete package directories for selected arch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-05-11 10:02:36 +02:00
John Crispin
fa69553900 branding: add LEDE branding
Signed-off-by: John Crispin <blogic@openwrt.org>
2016-03-24 22:40:13 +01:00
Felix Fietkau
868d5f9ae9 Makefile: set timezone to UTC
This is necessary for reproducible image builds.

Signed-off-by: bryan newbold <bnewbold@robocracy.org>

SVN-Revision: 48538
2016-01-28 22:42:18 +00:00
Felix Fietkau
b20a2b4890 Makefile: move the cleaning of staging_dir/target* from dirclean to clean
Currently "make clean" only clears the build_dir/target*, but leaves
staging_dir/target* intact. "make clean" should also clean the
staging_dir/target* directories, as in the current situation some old
packages or libraries may be linked into the firmware from staging_dir
despite a "make clean".

The patch reorganises clean / dirclean functionality so that
* "make clean" also clears the staging_dir/target* in addition to
build_dir/target*.
* "make dirclean" clears toolchain and host(=tools) directories from both
build_dir and staging_dir

signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>

SVN-Revision: 45973
2015-06-14 17:47:16 +00:00
John Crispin
9a96820d3d Makefile: remove non-existent STAGING_DIR_TOOLCHAIN from dirclean
Makefile: remove non-existent STAGING_DIR_TOOLCHAIN from dirclean

Openwrt's top level Makefile uses STAGING_DIR_TOOLCHAIN in the make dirclean
statement.
https://dev.openwrt.org/browser/trunk/Makefile#L55
    rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN)
$(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)

As far as I can determine, no such variable has been defined. I made a search
in Openwrt source repository and the one line in Makefile's dirclean command
is the only place where that variable exists.

The item has been introduced to Makefile by r8362, but even at that time
neither Makefile nor rules.mk defined such a variable. Most likely the goal
has been to set both staging_dir/toolchain and build_dir/toolchain to be
cleaned, but one of the variables has been erroneous. The correct variable
for build_dir/toolchain has been then added by r13494.

References:
https://dev.openwrt.org/changeset/8362/
https://dev.openwrt.org/browser/trunk/Makefile?rev=8362
https://dev.openwrt.org/browser/trunk/rules.mk?rev=8362
https://lists.openwrt.org/pipermail/openwrt-devel/2007-August/001159.html
https://dev.openwrt.org/changeset/13494

In current code,
    TOOLCHAIN_DIR = $(TOPDIR)/staging_dir/$(TOOLCHAIN_DIR_NAME)
    BUILD_DIR_TOOLCHAIN = $(TOPDIR)/build_dir/$(TOOLCHAIN_DIR_NAME)
so the item STAGING_DIR_TOOLCHAIN in the rm command is unnecessary.

signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>

SVN-Revision: 45736
2015-05-23 15:28:42 +00:00
Felix Fietkau
5868331214 build: don't call prereq for any package/symlinks rules
Most of the time, we want to make sure OpenWrt has been configured and
setup before start running make. However, in case of package/symlinks,
forcing prereq as a dependency creates multiple issues:
*when executed on a clean workspace, it will prompt for user input
 and open a menuconfig window before executing the feeds command
*the only way around that is to provide a .config. However, the "prereq"
 target would then run a "make defconfig", which will remove all the
 packages in the .config but from external feeds, as feeds have not been
 installed yet.

The only way to currently work around this, is to generate a fake config
by running "make defconfig", then "make package/symlinks", copy the real
config (which at this point disregards the previously generated config),
and run make defconfig again. Something like this:

make defconfig
make package/symlinks
cp real.config .config
make defconfig

This change is removing the need for the first defconfig, making the
process more logical for OpenWrt users using the package/symlinks target.

Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com>

SVN-Revision: 45657
2015-05-10 11:17:29 +00:00
Felix Fietkau
74ca7e9af3 build: clean up sitefiles, make them per-arch
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45090
2015-03-28 13:38:34 +00:00
Felix Fietkau
4fde9deed1 Revert "build: use ONESHELL to speed up scanning and the toplevel makefile"
This seems to cause issues on some build hosts, and it is not that
important.

SVN-Revision: 43025
2014-10-22 10:47:26 +00:00
Felix Fietkau
c497990834 build: use ONESHELL to speed up scanning and the toplevel makefile
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43021
2014-10-22 08:57:40 +00:00
Felix Fietkau
bb959c0f3e build: remove duplicate variable definitions
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39981
2014-03-21 15:54:11 +00:00
Felix Fietkau
c233a088f0 build: it is no longer necessary to call make target/linux/clean as part of make clean
SVN-Revision: 34451
2012-12-02 15:26:28 +00:00
Felix Fietkau
43f34a93e6 Makefile: add a check to bail out early when the path to the openwrt directory contains spaces (#12344)
SVN-Revision: 33884
2012-10-21 02:00:11 +00:00
Felix Fietkau
0f6e5b76f8 build: add back the package/cleanup step to remove the root staging dir for mklibs
SVN-Revision: 33777
2012-10-15 13:19:45 +00:00
Felix Fietkau
44cd20b802 build: rework the package/install step - collect package install lists during package/compile, then install all packages at once
SVN-Revision: 33631
2012-10-06 16:01:06 +00:00
Jo-Philipp Wich
b81354d828 abort built in prereq target if there is no site config file for the current target
SVN-Revision: 29798
2012-01-19 12:19:28 +00:00
Felix Fietkau
00d1e599d7 add a command for printing a cleaned up make target database - will be used to analyze package dependencies at some point
SVN-Revision: 22871
2010-09-01 17:51:36 +00:00
Florian Fainelli
7fc192e9a5 fix for GREP_OPTIONS
When using GREP_OPTIONS to supply default options to grep, the buildsystem might get broken (For example adding --color=always breaks it)
This patch will empty the GREP_OPTIONS to prevent the described (and any other) problems related to GREP_OPTIONS

Signed-off-by: Maarten Bezemer <m.m.bezemer@utwente.nl>

SVN-Revision: 22443
2010-07-31 22:32:21 +00:00
Felix Fietkau
61f503c77a add a "make prepare" target which builds everything up to target/compile, useful for scripts/deptest.sh
SVN-Revision: 16153
2009-05-28 18:40:37 +00:00
Ralph Hempel
c4d7af7094 added BUILD_LOG_DIR variable, make clean will delete the ./logs dir
SVN-Revision: 16148
2009-05-28 16:30:04 +00:00
Felix Fietkau
882190b198 avoid implicit rules in even more places
SVN-Revision: 14737
2009-03-03 14:16:48 +00:00
Nicolas Thill
71e8b3c4f7 remove toolchain build directory as well in 'make dirclean'
SVN-Revision: 13494
2008-12-03 04:22:41 +00:00
Felix Fietkau
a3a37d0bb1 rework parallel building to get rid of some warnings and add back support for parallelizing the kernel build fixes #3882
SVN-Revision: 12322
2008-08-16 16:59:47 +00:00
Felix Fietkau
1b838dbd95 make package prereq checks behave more like build prereq checks (first check all, then fail if necessary), also make them less verbose
SVN-Revision: 12106
2008-08-04 23:15:17 +00:00
Felix Fietkau
4c665e6ca4 large improvement for parallel builds. works without V=99 now and without warnings. tested with -j on an 2x dual core opteron machine
SVN-Revision: 11414
2008-06-09 15:38:45 +00:00
Ralph Hempel
585997f8d2 fix package/symlinks target, will call scripts/feeds update / install introduce new package/symlinks-install and package/symlinks-clean targets - package/symlink-install will re-create the index files and the symlinks for all ./feeds (no update from repositories is performed) - package/symlink-clean will delete all installed symlinks (keeping the ./feeds untouched)
SVN-Revision: 10634
2008-03-20 17:08:24 +00:00
Felix Fietkau
18bd5286e6 use scripts/feeds instead of scripts/feeds.sh for package/symlinks
SVN-Revision: 9990
2007-12-28 17:01:32 +00:00
Felix Fietkau
edc74f8cc3 fix make clean for unconfigured build trees
SVN-Revision: 9655
2007-12-04 03:04:37 +00:00
Felix Fietkau
db87e1f8c1 fix parallel build issues
SVN-Revision: 9495
2007-11-04 11:42:47 +00:00
Felix Fietkau
af03fdb6c5 add autorebuild check for menuconfig
SVN-Revision: 9301
2007-10-14 02:28:34 +00:00
Felix Fietkau
53a1d55b34 add 'make prepare' target for building the tools and toolchain
SVN-Revision: 8780
2007-09-15 08:53:23 +00:00
Felix Fietkau
a9d683ca91 major target cleanup. it is now possible to have subtargets that can override many target settings, including arch - merge adm5120, adm5120eb. target profiles still need to be adapted for subtargets
SVN-Revision: 8694
2007-09-08 19:55:42 +00:00
Felix Fietkau
5f748a6c24 clean up recursive dependency handling, use timestamp.pl again, because it saves memory and execution time
SVN-Revision: 8558
2007-08-30 21:12:39 +00:00
Felix Fietkau
c6bc77ea36 build system cleanup/restructuring as described in http://lists.openwrt.org/pipermail/openwrt-devel/2007-August/001159.html
SVN-Revision: 8362
2007-08-07 00:04:25 +00:00
Felix Fietkau
cb7605f7ba fix rootfs and init script handling
SVN-Revision: 8293
2007-07-31 22:54:21 +00:00
Felix Fietkau
572876608a fix make distclean
SVN-Revision: 8251
2007-07-30 22:56:48 +00:00
Felix Fietkau
d7f2cb1642 next round of cleanup, convert target/ - make -j works now ;)
SVN-Revision: 8242
2007-07-30 21:14:08 +00:00