Makefile: Only provide one make rule for each directory
authorMatt Fleming <matt.fleming@intel.com>
Fri, 19 Oct 2012 15:49:05 +0000 (16:49 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 26 Oct 2012 15:15:15 +0000 (16:15 +0100)
Otherwise we end up with warnings like this,

   Makefile:258: warning: overriding recipe for target `efi'
   Makefile:253: warning: ignoring old recipe for target `efi'

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Makefile

index 15d0a98..a4daae5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -247,14 +247,7 @@ all-local: $(BTARGET) $(ITARGET)
        -ls -l $(BOBJECTS) $(IOBJECTS)
 subdirs: $(BSUBDIRS) $(ISUBDIRS)
 
-# Note the double-colon which avoids the make warning about redefining
-# a rule for libinstaller.
-$(BSUBDIRS):
-       @mkdir -p $@
-       $(MAKE) -C $@ SRC="$(SRC)/$@" OBJ="$(OBJ)/$@" \
-               -f $(SRC)/$@/Makefile $(MAKECMDGOALS)
-
-$(ISUBDIRS):
+$(sort $(ISUBDIRS) $(BSUBDIRS)):
        @mkdir -p $@
        $(MAKE) -C $@ SRC="$(SRC)/$@" OBJ="$(OBJ)/$@" \
                -f $(SRC)/$@/Makefile $(MAKECMDGOALS)