]> git.openfabrics.org - ~emulex/tmp/compat/.git/commitdiff
compat: optimize building by extending .PHONY
authorLuis R. Rodriguez <mcgrof@frijolero.org>
Mon, 27 Feb 2012 23:10:30 +0000 (15:10 -0800)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Mon, 27 Feb 2012 23:10:54 +0000 (15:10 -0800)
I've started reading make -d output to realize that GNU Make
is pretty simple but darn stupid and needs a little help in
direction. Traditionally GNU Make will try to see if it needs
Makefile* generation. I can count 18 variations of Makefile it
looks for:

Makefile
Makefile.c
Makefile.C
Makefile.cc
Makefile.cpp
Makefile.f
Makefile.F
Makefile.l
Makefile.mod
Makefile.o
Makefile.p
Makefile.r
Makefile.s
Makefile.S
Makefile.sh
Makefile.w
Makefile.web
Makefile.y

GNU Make will look for targets in the Makefile for each of these...

GNU Make will also look for these 18 variations of files for each
target that it does not a target rule for. There are two ways to
help GNU Make do the right thing, write a simple empty target rule [0]
or just extend the target into the .PHONY target. Lets just extend
the .PHONY target with the items we see in make -d are not needed.
This simple change forces GNU Make to skip 36 lookups of false
targets.

[0] Makefile : ;

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
Makefile

index 9e676edebd5dddf2c319bdd2eef4f5913b26b117..82d4cbbc28917af7a4f810deaf3715d6f332f652 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -69,4 +69,4 @@ clean:
 clean-files := Module.symvers modules.order Module.markers compat/modules.order
 clean-files += modules $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)
 
-.PHONY: all install clean
+.PHONY: all install clean modules Makefile