[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] using `gcc -M' instead of parsing `gcc -E' to produce d
From: |
Stig Brautaset |
Subject: |
[Gnu-arch-users] using `gcc -M' instead of parsing `gcc -E' to produce dependencies in package-framework |
Date: |
Thu, 25 Dec 2003 12:03:21 +0000 |
User-agent: |
Mutt/1.3.28i |
I've long wondered why package-framework parses the output of gcc -E
instead of using its -M flag to produce dependancy-files. Especially
since the format of -E varies slightly between versions of gcc. Is (an
equivalent of} the -E flag supported by more compilers, perhaps?
Unless anyone can tell me why it is a good idea to parse -E output I'll
put the following patch in my package-framework archive:
* looking for address@hidden/package-framework--devo--1.0--base-0 to compare
with
* comparing to address@hidden/package-framework--devo--1.0--base-0
D build-tools/Makefiles/cpp-to-includes.sed
M build-tools/Makefiles/rules.mk
* modified files
--- orig/build-tools/Makefiles/rules.mk
+++ mod/build-tools/Makefiles/rules.mk
@@ -179,9 +179,8 @@
################################################################
%.d: %.c $(generated-includes)
- printf "%s %s.o %s.d: " $(basename $@) $(basename $@) $(basename $@) >
$@
- $(CC) -DFOR_MAKEFILE_DEPENDENCIES -E $(CFLAGS) $< | sed -f
$(makefiles)/cpp-to-includes.sed | sort -u | sed -e 's/$$/ \\/' >> $@
- echo >> $@
+ printf "%s %s.d " $(basename $@) $(basename $@) > $@
+ $(CC) -DFOR_MAKEFILE_DEPENDENCIES -M $(CFLAGS) $< >> $@
$(addsuffix .o, $(basename $(source-files))): %.o: %.d
$(basename $(source-files)): %: %.d
These are the times to make the entire devo.tla tree in Tom's 2004
archive (up to date today). `make clean' were issued immediately before
the make itself.
Patched package-framework:
make 55.08s user 12.90s system 96% cpu 1:10.31 total
make 55.11s user 13.14s system 97% cpu 1:09.95 total
make 56.09s user 12.76s system 92% cpu 1:14.74 total
make > /dev/null 55.43s user 12.97s system 97% cpu 1:09.88 total
make > /dev/null 55.51s user 12.22s system 96% cpu 1:09.97 total
make > /dev/null 55.10s user 13.24s system 92% cpu 1:13.94 total
Vanilla package-framework:
make 69.17s user 15.91s system 101% cpu 1:23.86 total
make 68.81s user 15.10s system 100% cpu 1:23.29 total
make 68.70s user 15.95s system 101% cpu 1:23.77 total
make > /dev/null 68.67s user 15.02s system 100% cpu 1:23.29 total
make > /dev/null 69.02s user 15.91s system 101% cpu 1:23.33 total
make > /dev/null 68.32s user 15.67s system 100% cpu 1:23.63 total
Stig
--
brautaset.org
- [Gnu-arch-users] using `gcc -M' instead of parsing `gcc -E' to produce dependencies in package-framework,
Stig Brautaset <=