Every time we run make in a v3 tree, lar, lzma, nrv2b and the option table get rebuilt unconditionally due to slightly incorrect dependencies. That's wasteful and may hide other dependency bugs. Fix the lar, lzma, nrv2b and option table dependencies.
This trims down recompilation time a lot. The only remaining stuff being rebuilt is: ~/corebootv3-better_dependencies> make CP build/config.h GEN build/build.h LAR build/coreboot.rom PAYLOAD none (as specified by user) CP build/bios.bin DONE
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: corebootv3-better_dependencies/util/lzma/Makefile =================================================================== --- corebootv3-better_dependencies/util/lzma/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/lzma/Makefile (Arbeitskopie) @@ -23,13 +23,13 @@ LZMA_OBJ += $(obj)/util/lzma/OutBuffer.o $(obj)/util/lzma/Alloc.o LZMA_OBJ += $(obj)/util/lzma/CRC.o
-$(obj)/util/lzma/lzma: lzmadir $(LZMA_OBJ) $(obj)/util/lzma/minilzma.o +$(obj)/util/lzma/lzma: $(obj)/util/lzma/ $(LZMA_OBJ) $(obj)/util/lzma/minilzma.o $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $(LZMA_OBJ) $(obj)/util/lzma/minilzma.o
$(obj)/util/lzma/lzma-compress.o: $(src)/util/lzma/minilzma.cc $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c -DCOMPACT $<
-lzmadir: +$(obj)/util/lzma/: $(Q)printf " BUILD LZMA\n" $(Q)mkdir -p $(obj)/util/lzma/
Index: corebootv3-better_dependencies/util/nrv2b/Makefile =================================================================== --- corebootv3-better_dependencies/util/nrv2b/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/nrv2b/Makefile (Arbeitskopie) @@ -19,15 +19,15 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ##
-$(obj)/util/nrv2b/nrv2b: nrv2bdir $(src)/util/nrv2b/nrv2b.c +$(obj)/util/nrv2b/nrv2b: $(obj)/util/nrv2b/ $(src)/util/nrv2b/nrv2b.c $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(HOSTCC) $(HOSTCFLAGS) -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $(src)/util/nrv2b/nrv2b.c
-$(obj)/util/nrv2b/nrv2b-compress.o: nrv2bdir $(src)/util/nrv2b/nrv2b.c +$(obj)/util/nrv2b/nrv2b-compress.o: $(obj)/util/nrv2b/ $(src)/util/nrv2b/nrv2b.c $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(HOSTCC) $(HOSTCFLAGS) -DENCODE -DDECODE -DVERBOSE -DCOMPACT -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -c -o $@ $(src)/util/nrv2b/nrv2b.c
-nrv2bdir: +$(obj)/util/nrv2b/: $(Q)printf " BUILD NRV2B\n" $(Q)mkdir -p $(obj)/util/nrv2b/
Index: corebootv3-better_dependencies/util/options/Makefile =================================================================== --- corebootv3-better_dependencies/util/options/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/options/Makefile (Arbeitskopie) @@ -21,11 +21,11 @@
OPTIONS_OBJ := $(obj)/util/options/build_opt_tbl.o
-$(obj)/util/options/build_opt_tbl: optionsdir $(OPTIONS_OBJ) +$(obj)/util/options/build_opt_tbl: $(obj)/util/options/ $(OPTIONS_OBJ) $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ $(OPTIONS_OBJ)
-optionsdir: +$(obj)/util/options/: $(Q)mkdir -p $(obj)/util/options/
$(obj)/util/options/%.o: $(src)/util/options/%.c Index: corebootv3-better_dependencies/util/lar/Makefile =================================================================== --- corebootv3-better_dependencies/util/lar/Makefile (Revision 983) +++ corebootv3-better_dependencies/util/lar/Makefile (Arbeitskopie) @@ -19,16 +19,17 @@ ## LAROBJ := lar.o stream.o lib.o
-LARDIR := lardir +LARDIR := $(obj)/util/lar
COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o -LARDIR += lzmadir +LARDIR += $(obj)/util/lzma/
COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o -LARDIR += nrv2bdir +LARDIR += $(obj)/util/nrv2b/
LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ)) -lardir: + +$(obj)/util/lar: $(Q)printf " BUILD LAR\n" $(Q)mkdir -p $(obj)/util/lar