summaryrefslogtreecommitdiffstats
path: root/include/verbose.mk
Commit message (Collapse)AuthorAgeFilesLines
* verbose.mk: fallback to standard file descriptorsMichael Pratt2024-01-051-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to pass a status message at runtime, which is usually listing subtargets of a Makefile target or an error message, from a child invocation of Make (submake) through the parent process to the terminal, the file descriptors 8 and 9 are opened to be used by the functions MESSAGE and ERROR_MESSAGE. However, there are situations where those functions can be called while not in a submake or a subshell or a child process which results in a shell error: /bin/bash: 8: Bad file descriptor Commit aee3594ffcb72ae3e18c3719012d52519ee2d160 ("verbose.mk: print ERROR messages in non-verbose") has exposed this issue to more cases, but it is not the root cause. To solve this, use the exit code of the first printf attempt to the alternative file descriptors in order to tell whether the standard file descriptors need to be used instead. In order to get rid of the "Bad file descriptor" error, stderr is redirected to null after grouping the two printf alternatives into one command to combine outputs. For ERROR_MESSAGE, the real message is redirected to stderr after redirecting the error from the attempted printing to null. For MESSAGE, without redirection, the Make function "shell" will absorb the actual message from stdout and input the value into the Makefile, therefore the dummy variable "_NULL", previously used merely for causing a call to the MESSAGE function to trigger without writing target rules, now has and a real value when defined, so rename it to "_MESSAGE" as a placeholder for the real message when the output should be stdout. When "_MESSAGE" has a value, use Make function "info" to finally bring it from the Makefile to the terminal. This also fixes what is likely a typo, in that while file descriptor 9 is meant to redirect to stderr for use in error messages like in the function ERROR_MESSAGE, that function has printf redirecting to file descriptor 8 instead. Fixes: a4c8d4e37 ("build: make the color of the 'configuration out of sync' warning red") Signed-off-by: Michael Pratt <mcpratt@pm.me>
* verbose.mk: print ERROR messages in non-verbosePaul Spooren2022-02-281-5/+4
| | | | | | | | | | | | | | | | | | | Using `make -j9` only prints a subset of messages to follow the build process progressing. However this silently skips over errors which might be of interested. Using `make V=s` easily floods the terminal making it hard to find error messages between the lines. A compromise is the usage of `$(call ERROR_MESSAGE,...)` which prints a message in red. This function is silenced in the non-verbose mode, even if only used at a single place in `package/Makefile` where it notifies about a OPKG corner case. This commit moves the `ERROR_MESSAGE` definition outside of the `OPENWRT_VERBOSE` condition and print error messages in every mode. With this in place further error messages are possible. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: use SPDX license tagsPaul Spooren2021-02-051-5/+2
| | | | | | | | | The license folder is a core part of OpenWrt and all GPL-2.0 licensed. Use SPDX license tags to allow machines to check licenses. Signed-off-by: Paul Spooren <mail@aparcar.org> [rebase, keep some Copyright lines, sharpen commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* include/verbose.mk: Add sc to failure messageDaniel Engberg2018-07-301-1/+1
| | | | | | Add sc to build error message Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
* verbose.mk: quote SUBMAKE options李国2018-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | build openwrt on centos 6 I should use devtoolset-3 to get gcc 4.9, but it fail when make menuconfig. so I have to give option HOSTCC='gcc -Wl,--copy-dt-needed-entries' to make. But it passed to sub make to HOSTCC=gcc as micro SUBMAKE expand to HOSTCC=gcc -Wl,--copy-dt-needed-entries. This patch fix this issue. make -C build menuconfig HOSTCC='gcc -Wl,--copy-dt-needed-entries' V='1' make: Entering directory `/work/openwrt/openwrt/build' /opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/ld: lxdialog/checklist.o: undefined reference to symbol 'acs_map' //lib64/libtinfo.so.5: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[1]: *** [mconf] Error 1 make -s -C scripts/config all CC=gcc -Wl,--copy-dt-needed-entries: build failed. Please re-run make with -j1 V=s to see what's going on make: *** [scripts/config/mconf] Error 1 make: Leaving directory `/work/openwrt/openwrt/build' Signed-off-by: 李国 <uxgood.org@gmail.com>
* build: tell users to do non-paralle builds on errorsFelix Fietkau2015-04-161-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45457
* include: remove trailing whitespacesLuka Perkov2015-03-291-1/+1
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 45127
* build: make the color of the 'configuration out of sync' warning red to make ↵Felix Fietkau2013-03-171-0/+6
| | | | | | it harder for users to overlook SVN-Revision: 36082
* build: fix bad file descriptor issues with the verbosity changesFelix Fietkau2012-04-261-1/+1
| | | | SVN-Revision: 31486
* build: rework verbosity level selectionFelix Fietkau2012-04-261-14/+17
| | | | | | | | | | | | | V=99 and V=1 are now deprecated in favor of a new verbosity class system, though the old flags are still supported. You can set the V variable on the command line (or OPENWRT_VERBOSE in the environment) to one or more of the following characters: - s: stdout+stderr (equal to the old V=99) - c: commands (for build systems that suppress commands by default, e.g. kbuild) - w: warnings/errors only (equal to the old V=1) SVN-Revision: 31484
* Allow colored output to be disabled when running a non-verbose build by ↵Lars-Peter Clausen2010-02-081-2/+4
| | | | | | setting NO_COLOR=1 SVN-Revision: 19560
* disable stdin unless make V=99; fixes bug where compilation can stall ↵Mike Baker2010-02-041-1/+1
| | | | | | waiting for input SVN-Revision: 19511
* make sure that processed directories are printed on make V=99Felix Fietkau2010-01-161-1/+1
| | | | SVN-Revision: 19174
* get rid of $Id$ - it has never helped us and it has broken too many patches ;)Felix Fietkau2009-04-171-1/+0
| | | | SVN-Revision: 15242
* use file descriptors 8 and 9 for build system internal log messages, as ↵Felix Fietkau2008-06-161-2/+2
| | | | | | apparently bash does not like fds greater than 9 in shell commands on some systems SVN-Revision: 11515
* large improvement for parallel builds. works without V=99 now and without ↵Felix Fietkau2008-06-091-5/+7
| | | | | | warnings. tested with -j on an 2x dual core opteron machine SVN-Revision: 11414
* add a flag "IGNORE_ERRORS", which can be used to ignore build errors in packagesFelix Fietkau2008-05-071-3/+7
| | | | SVN-Revision: 11059
* use printf instead of echoAndy Boyett2007-12-261-4/+4
| | | | SVN-Revision: 9932
* add shell compatibility patch from #2659Felix Fietkau2007-11-301-1/+1
| | | | SVN-Revision: 9643
* next round of build system cleanup - convert package/ to new structureFelix Fietkau2007-07-301-1/+1
| | | | SVN-Revision: 8236
* fix verbose output with dash as /bin/shFelix Fietkau2007-07-301-1/+1
| | | | SVN-Revision: 8227
* more build system cleanupFelix Fietkau2007-07-281-8/+12
| | | | SVN-Revision: 8206
* minor tweaks to the verbose systemMike Baker2007-04-111-1/+5
| | | | SVN-Revision: 6936
* fix colors when compiling with some newer versions of bashMike Baker2007-01-301-2/+2
| | | | SVN-Revision: 6231
* another optimizationFelix Fietkau2006-11-121-1/+1
| | | | SVN-Revision: 5507
* finally move buildroot-ng to trunkFelix Fietkau2016-03-201-0/+43