mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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> Acked-by: Myles Watson <mylesgw@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/repository/coreboot-v3@984 f3766cd6-281f-0410-b1cd-43a5c92072e9
80 lines
2.6 KiB
Makefile
80 lines
2.6 KiB
Makefile
##
|
|
## lar - lightweight archiver
|
|
##
|
|
## Copyright (C) 2006-2008 coresystems GmbH
|
|
## (Written by Stefan Reinauer <stepan@coresystems.de> for coresystems GmbH)
|
|
##
|
|
## This program is free software; you can redistribute it and/or modify
|
|
## it under the terms of the GNU General Public License as published by
|
|
## the Free Software Foundation; version 2 of the License.
|
|
##
|
|
## This program is distributed in the hope that it will be useful,
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
## GNU General Public License for more details.
|
|
##
|
|
## You should have received a copy of the GNU General Public License
|
|
## along with this program; if not, write to the Free Software
|
|
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
|
|
##
|
|
LAROBJ := lar.o stream.o lib.o
|
|
|
|
LARDIR := $(obj)/util/lar/
|
|
|
|
COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o
|
|
LARDIR += $(obj)/util/lzma/
|
|
|
|
COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o
|
|
LARDIR += $(obj)/util/nrv2b/
|
|
|
|
LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ))
|
|
|
|
$(obj)/util/lar/:
|
|
$(Q)printf " BUILD LAR\n"
|
|
$(Q)mkdir -p $(obj)/util/lar
|
|
|
|
$(obj)/util/lar/lar: $(LARDIR) $(LAROBJ_ABS) $(COMPRESSOR)
|
|
$(Q)printf " HOSTCXX $(subst $(shell pwd)/,,$(@))\n"
|
|
$(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $(LAROBJ_ABS) $(COMPRESSOR)
|
|
|
|
$(obj)/util/lar/%.o: $(src)/util/lar/%.c
|
|
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
|
|
$(Q)$(HOSTCC) $(HOSTCFLAGS) -c $< -o $@
|
|
|
|
|
|
lar: $(obj)/util/lar/lar
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Stuff below this line is for debugging purposes only.
|
|
|
|
ifdef DEBUG_LAR
|
|
example: example.c
|
|
$(Q)$(CC) $(CFLAGS) -o $@ $^
|
|
|
|
clean:
|
|
$(Q)rm -rf lar tree.lar tree tree2 example
|
|
|
|
tree:
|
|
$(Q)printf "Creating sample tree... "
|
|
$(Q)rm -rf tree
|
|
$(Q)mkdir tree
|
|
$(Q)mkdir -p tree/compression
|
|
$(Q)mkdir -p tree/normal
|
|
$(Q)mkdir -p tree/fallback
|
|
$(Q)dd if=/dev/urandom of=tree/compression/lzma bs=1k count=8 &>/dev/null
|
|
$(Q)dd if=/dev/urandom of=tree/normal/coreboot.elf.lzma bs=1k count=32 &>/dev/null
|
|
$(Q)dd if=/dev/urandom of=tree/normal/initmem bs=1k count=16 &>/dev/null
|
|
$(Q)dd if=/dev/urandom of=tree/fallback/coreboot.elf.lzma bs=1k count=32 &>/dev/null
|
|
$(Q)dd if=/dev/urandom of=tree/fallback/initmem bs=1k count=16 &>/dev/null
|
|
$(Q)printf "done.\n"
|
|
|
|
tree.lar: lar tree
|
|
$(Q)cd tree; ../lar c ../tree.lar `find . -type f | cut -c3-`
|
|
|
|
test: lar example tree.lar
|
|
$(Q)mkdir tree2; cd tree2; ../lar x ../tree.lar
|
|
$(Q)printf "Comparing tree:\n"
|
|
$(Q)diff -urN tree tree2
|
|
$(Q)rm -rf tree tree2
|
|
$(Q)./example tree.lar
|
|
endif
|