]> git.openfabrics.org - ~emulex/for-vlad/old/compat.git/commit
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)
commit82dd030116437f4d88f6fe8d98827d360a67ff5b
treedc358d09dc83c8946d9906383bbaec9ffa21c768
parent9e138a0f7e3361fa462aaac4def5c0872496a690
compat: optimize building by extending .PHONY

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