Altered mkdepfile to use a single gcc call and post-process the output. This speeds up the dependency generation, especially in cygwin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19169 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7ef2a053b8
commit
6640978129
5 changed files with 37 additions and 10 deletions
|
@ -9,8 +9,7 @@
|
|||
|
||||
LANGS := $(call preprocess, $(APPSDIR)/lang/SOURCES)
|
||||
LANGOBJ := $(LANGS:$(ROOTDIR)/%.lang=$(BUILDDIR)/%.lng)
|
||||
|
||||
SRC += $(ROOTDIR)/lang.o # yes ROOTDIR. root.make will subst it to BUILDDIR.
|
||||
LANG_O = $(BUILDDIR)/lang.o
|
||||
|
||||
CLEANOBJS += $(BUILDDIR)/max_language_size.h $(BUILDDIR)/lang.*
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
INCLUDES += -I$(FIRMDIR) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers
|
||||
|
||||
FIRMLIB_SRC += $(call preprocess, $(FIRMDIR)/SOURCES)
|
||||
FIRMLIB_SRC += $(ROOTDIR)/sysfont.o
|
||||
FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC))
|
||||
FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o
|
||||
OTHER_SRC += $(FIRMLIB_SRC)
|
||||
|
||||
FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a
|
||||
|
|
28
tools/addtargetdir.pl
Executable file
28
tools/addtargetdir.pl
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/perl
|
||||
# __________ __ ___.
|
||||
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
# \/ \/ \/ \/ \/
|
||||
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
|
||||
#
|
||||
|
||||
# addtargetdir.pl - Adds target directory to gcc-generated dependency data
|
||||
|
||||
use File::Basename;
|
||||
|
||||
my $rbroot = $ARGV[0];
|
||||
my $builddir = $ARGV[1];
|
||||
|
||||
for (<STDIN>) {
|
||||
if (/^([^:]+): (\S+) (.*)/) {
|
||||
my ($target, $src, $rest) = ($1, $2, $3);
|
||||
my $dir = dirname $src;
|
||||
$dir =~ s/$rbroot//;
|
||||
print "$builddir$dir/$target: $src $rest\n";
|
||||
}
|
||||
else {
|
||||
print $_;
|
||||
}
|
||||
}
|
|
@ -29,19 +29,17 @@ c2obj = $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR),$(BUILDDIR),$(1))))
|
|||
|
||||
# calculate dependencies for a list of source files $(2) and output them
|
||||
# to a file $(1)
|
||||
|
||||
mkdepfile = $(shell \
|
||||
for each in $(2); do \
|
||||
obj=`echo $$each | sed -e 's/\.[cS]/.o/' -e 's:$(ROOTDIR):$(BUILDDIR):'`; \
|
||||
$(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h -MT "$$obj" $$each 2>/dev/null; \
|
||||
done | sed -e "s: lang.h: $(BUILDDIR)/lang.o:" \
|
||||
$(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h $(2) | \
|
||||
$(TOOLSDIR)/addtargetdir.pl $(ROOTDIR) $(BUILDDIR) | \
|
||||
sed -e "s: lang.h: $(BUILDDIR)/lang.o:" \
|
||||
-e "s: sysfont.h: $(BUILDDIR)/sysfont.h:" \
|
||||
-e "s: max_language_size.h: $(BUILDDIR)/max_language_size.h:" \
|
||||
-e "s: bitmaps/: $(BUILDDIR)/bitmaps/:g" \
|
||||
-e "s: pluginbitmaps/: $(BUILDDIR)/pluginbitmaps/:g" \
|
||||
-e "s: lib/: $(APPSDIR)/plugins/lib/:g" \
|
||||
-e "s: codeclib.h: $(APPSDIR)/codecs/lib/codeclib.h:g" \
|
||||
> $(1); )
|
||||
> $(1) )
|
||||
|
||||
# function to create .bmp dependencies
|
||||
bmpdepfile = $(shell \
|
||||
|
|
|
@ -92,7 +92,7 @@ veryclean: clean
|
|||
|
||||
clean:
|
||||
$(SILENT)echo Cleaning build directory
|
||||
$(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz rockbox.tar.bz2 TAGS apps firmware comsim sim lang.[ch] manual *.pdf *.a credits.raw rockbox.ipod bitmaps pluginbitmaps UI256.bmp rockbox-full.zip html txt rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids *.wav *.mp3 *.voice max_language_size.h $(CLEANOBJS) $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin $(DEPFILE) rombox.elf rombox.map rombox.bin $(BINARY) $(FLASHFILE) uisimulator bootloader flash
|
||||
$(SILENT)rm -rf rockbox.zip rockbox.7z rockbox.tar rockbox.tar.gz rockbox.tar.bz2 TAGS apps firmware comsim sim lang.[ch] manual *.pdf *.a credits.raw rockbox.ipod bitmaps pluginbitmaps UI256.bmp rockbox-full.zip html txt rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids *.wav *.mp3 *.voice max_language_size.h $(CLEANOBJS) $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin $(DEPFILE) rombox.elf rombox.map rombox.bin $(BINARY) $(FLASHFILE) uisimulator bootloader flash $(BOOTLINK)
|
||||
|
||||
#### linking the binaries: ####
|
||||
|
||||
|
@ -109,6 +109,8 @@ LINKRAM := $(BUILDDIR)/ram.link
|
|||
ROMLDS := $(FIRMDIR)/rom.lds
|
||||
LINKROM := $(BUILDDIR)/rom.link
|
||||
|
||||
OBJ += $(LANG_O)
|
||||
|
||||
$(LINKRAM): $(RAMLDS)
|
||||
$(call PRINTS,PP $(@F))
|
||||
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
|
||||
|
|
Loading…
Reference in a new issue