From: Luis R. Rodriguez Date: Mon, 27 Feb 2012 23:10:30 +0000 (-0800) Subject: compat: optimize building by extending .PHONY X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=82dd030116437f4d88f6fe8d98827d360a67ff5b;p=openwrt%2Fstaging%2Fblogic.git 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 --- diff --git a/Makefile b/Makefile index 9e676edebd5d..82d4cbbc2891 100644 --- 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