build: Avoid absolute paths during "whole-program" compiling.

The build currently does a textual include of all files in order to
use the -fwhole-compile optimization.  Update it to use relative file
paths instead of absolute file paths.  This makes the section names in
the resulting binary more readable.  It also makes the build easier on
some Windows hosts.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2014-06-03 15:22:31 -04:00
parent ca34ce5aaa
commit ec44fac1f6
1 changed files with 2 additions and 2 deletions

View File

@ -111,8 +111,8 @@ endif
# Do a whole file compile by textually including all C code.
define whole-compile
@echo " Compiling whole program $3"
$(Q)printf '$(foreach i,$2,#include "$(CURDIR)/$i"\n)' > $3.tmp.c
$(Q)$(CC) $1 $(CFLAGSWHOLE) -c $3.tmp.c -o $3
$(Q)printf '$(foreach i,$2,#include "$i"\n)' > $3.tmp.c
$(Q)$(CC) -I. $1 $(CFLAGSWHOLE) -c $3.tmp.c -o $3
endef
%.strip.o: %.o