Makefile: Replace the way to test if a string is empty

The output of command below,
# i386-elf-nm build/cbfs/fallback/romstage_null.offenders | \
                     grep -q "" ; echo $?
has different result on MacOS, OS X Mavericks, which outputs 0.
On linux, it outputs 1.

I assume it is misleading to search an empty string in a empty
string. Change it to testing if the string is empty.

Change-Id: Ie4b8fe1fb26df092e2985937251a49feadc61eb0
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11600
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
zbao 2015-09-11 08:49:38 -04:00 committed by Zheng Bao
parent bebef2133e
commit 46a7c82bcf
1 changed files with 1 additions and 1 deletions

View File

@ -190,7 +190,7 @@ $(objcbfs)/romstage.debug: $$(romstage-objs) $$(romstage-libs)
$(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) $(romstage-libs) --no-whole-archive $(COMPILER_RT_romstage) --end-group -T $(obj)/arch/x86/memlayout.romstage.ld --oformat $(romstage-oformat) $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) $(COMPILER_RT_FLAGS_romstage) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) $(romstage-libs) --no-whole-archive $(COMPILER_RT_romstage) --end-group -T $(obj)/arch/x86/memlayout.romstage.ld --oformat $(romstage-oformat)
LANG=C LC_ALL= $(OBJCOPY_romstage) --only-section .illegal_globals $(@) $(objcbfs)/romstage_null.offenders 2>&1 | \ LANG=C LC_ALL= $(OBJCOPY_romstage) --only-section .illegal_globals $(@) $(objcbfs)/romstage_null.offenders 2>&1 | \
grep -v "Empty loadable segment detected" && \ grep -v "Empty loadable segment detected" && \
$(NM_romstage) $(objcbfs)/romstage_null.offenders | grep -q ""; if [ $$? -eq 0 ]; then \ if [ -n "`$(NM_romstage) $(objcbfs)/romstage_null.offenders 2>/dev/null`" ]; then \
echo "Forbidden global variables in romstage:"; \ echo "Forbidden global variables in romstage:"; \
$(NM_romstage) $(objcbfs)/romstage_null.offenders; false; \ $(NM_romstage) $(objcbfs)/romstage_null.offenders; false; \
else true; fi else true; fi