Author: oxygene Date: Sat Apr 17 00:48:57 2010 New Revision: 5453 URL: https://tracker.coreboot.org/trac/coreboot/changeset/5453
Log: Build utils into their source directory equivalent in the build tree. Allow separate build tree for utils Use separate build tree for utils in abuild
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/Makefile trunk/src/arch/i386/Makefile.bootblock.inc trunk/src/arch/i386/Makefile.inc trunk/util/abuild/abuild trunk/util/cbfstool/Makefile.inc trunk/util/sconfig/Makefile.inc
Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Fri Apr 16 15:43:49 2010 (r5452) +++ trunk/Makefile Sat Apr 17 00:48:57 2010 (r5453) @@ -36,7 +36,8 @@ export src := src export srck := $(top)/util/kconfig export obj ?= build -export objk := $(obj)/util/kconfig +export objutil ?= $(obj)/util +export objk := $(objutil)/kconfig
export KERNELVERSION := 4.0 @@ -58,7 +59,7 @@ endif
CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E -ROMCC:= $(obj)/romcc +ROMCC:= $(objutil)/romcc/romcc HOSTCC = gcc HOSTCXX = g++ HOSTCFLAGS := -I$(srck) -I$(objk) -g @@ -145,14 +146,14 @@ ####################################################################### # Build the tools
-CBFSTOOL:=$(obj)/util/cbfstool/cbfstool +CBFSTOOL:=$(objutil)/cbfstool/cbfstool
# needed objects that every mainboard uses # Creation of these is architecture and mainboard independent -$(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(obj)/util/sconfig/sconfig +$(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(objutil)/sconfig/sconfig @printf " SCONFIG $(subst $(src)/,,$(<))\n" mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) - $(obj)/util/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR) + $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR)
objs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.o initobjs:= @@ -286,7 +287,7 @@
prepare: mkdir -p $(obj) - mkdir -p $(obj)/util/kconfig/lxdialog $(obj)/util/cbfstool + mkdir -p $(objutil)/kconfig/lxdialog $(objutil)/cbfstool $(objutil)/romcc $(objutil)/options test -n "$(alldirs)" && mkdir -p $(alldirs) || true
$(obj)/build.h: .xcompile @@ -355,7 +356,7 @@ ifeq ($(_OS),CYGWIN_) STACK=-Wl,--stack,16384000 endif -$(obj)/romcc: $(top)/util/romcc/romcc.c +$(objutil)/romcc/romcc: $(top)/util/romcc/romcc.c @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n" @# Note: Adding -O2 here might cause problems. For details see: @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html
Modified: trunk/src/arch/i386/Makefile.bootblock.inc ============================================================================== --- trunk/src/arch/i386/Makefile.bootblock.inc Fri Apr 16 15:43:49 2010 (r5452) +++ trunk/src/arch/i386/Makefile.bootblock.inc Sat Apr 17 00:48:57 2010 (r5453) @@ -65,7 +65,7 @@ @printf " CC $(subst $(obj)/,,$(@))\n" $(CC) -MMD -x assembler-with-cpp -DASSEMBLY -E -I$(src)/include -I$(src)/arch/i386/include -I$(obj) -I$(obj)/bootblock -include $(obj)/config.h -I. -I$(src) $< -o $@
-$(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc: $(src)/arch/i386/init/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(obj)/romcc +$(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc: $(src)/arch/i386/init/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(ROMCC) @printf " ROMCC $(subst $(obj)/,,$(@))\n" $(CC) -MM -MT$(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc \ $< > $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.inc.d
Modified: trunk/src/arch/i386/Makefile.inc ============================================================================== --- trunk/src/arch/i386/Makefile.inc Fri Apr 16 15:43:49 2010 (r5452) +++ trunk/src/arch/i386/Makefile.inc Sat Apr 17 00:48:57 2010 (r5453) @@ -59,15 +59,15 @@ ####################################################################### # i386 specific tools
-$(obj)/option_table.h: $(obj)/build_opt_tbl $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout +$(obj)/option_table.h: $(objutil)/options/build_opt_tbl $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout @printf " OPTION $(subst $(obj)/,,$(@))\n" - $(obj)/build_opt_tbl --config $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout --header $(obj)/option_table.h + $(objutil)/options/build_opt_tbl --config $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout --header $(obj)/option_table.h
-$(obj)/option_table.c: $(obj)/build_opt_tbl $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout +$(obj)/option_table.c: $(objutil)/options/build_opt_tbl $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout @printf " OPTION $(subst $(obj)/,,$(@))\n" - $(obj)/build_opt_tbl --config $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout --option $(obj)/option_table.c + $(objutil)/options/build_opt_tbl --config $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout --option $(obj)/option_table.c
-$(obj)/build_opt_tbl: $(top)/util/options/build_opt_tbl.c $(top)/src/include/pc80/mc146818rtc.h $(top)/src/include/boot/coreboot_tables.h +$(objutil)/options/build_opt_tbl: $(top)/util/options/build_opt_tbl.c $(top)/src/include/pc80/mc146818rtc.h $(top)/src/include/boot/coreboot_tables.h @printf " HOSTCC $(subst $(obj)/,,$(@))\n" $(HOSTCC) $(HOSTCFLAGS) $< -o $@
@@ -164,7 +164,7 @@ ifeq ($(CONFIG_ROMCC),y) ROMCCFLAGS ?= -mcpu=p2 -O2
-$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(obj)/romcc $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h +$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(ROMCC) $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h printf " ROMCC romstage.inc\n" $(ROMCC) -c -S $(ROMCCFLAGS) -D__PRE_RAM__ -I. $(INCLUDES) $< -o $@ else
Modified: trunk/util/abuild/abuild ============================================================================== --- trunk/util/abuild/abuild Fri Apr 16 15:43:49 2010 (r5452) +++ trunk/util/abuild/abuild Sat Apr 17 00:48:57 2010 (r5453) @@ -156,6 +156,7 @@ [ "$update" = "true" ] && mv ${build_dir}/coreboot.rom coreboot.rom.tmp $MAKE distclean obj=${build_dir} mkdir -p ${build_dir} + mkdir -p $TARGET/sharedutils [ "$update" = "true" ] && mv coreboot.rom.tmp ${build_dir}/coreboot.rom
if [ "$CONFIG" != "" ]; then @@ -204,8 +205,8 @@ fi fi
- #yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} &> ${build_dir}/config.log - yes "" | $MAKE oldconfig obj=${build_dir} &> ${build_dir}/config.log + #yes "" | $MAKE oldconfig -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log + yes "" | $MAKE oldconfig obj=${build_dir} objutil=$TARGET/sharedutils &> ${build_dir}/config.log ret=$? mv .config.old $TARGET/${VENDOR}_${MAINBOARD}/config.in if [ $ret -eq 0 ]; then @@ -264,7 +265,7 @@ CURR=$( pwd ) #stime=`perl -e 'print time();' 2>/dev/null || date +%s` build_dir=$TARGET/${VENDOR}_${MAINBOARD} - eval $MAKE $silent -j $cpus obj=${build_dir} \ + eval $MAKE $silent -j $cpus obj=${build_dir} objutil=$TARGET/sharedutils \ &> ${build_dir}/make.log ret=$? mv .config ${build_dir}/config.build
Modified: trunk/util/cbfstool/Makefile.inc ============================================================================== --- trunk/util/cbfstool/Makefile.inc Fri Apr 16 15:43:49 2010 (r5452) +++ trunk/util/cbfstool/Makefile.inc Sat Apr 17 00:48:57 2010 (r5453) @@ -15,38 +15,38 @@
CBFSTOOLFLAGS=-DCOMPACT -g
-$(obj)/util/cbfstool: +$(objutil)/cbfstool: mkdir -p $@
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/%.c - printf " HOSTCC $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c + printf " HOSTCC $(subst $(objutil)/,,$(@))\n" $(HOSTCC) $(CBFSTOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.cc - printf " HOSTCXX $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.cc + printf " HOSTCXX $(subst $(objutil)/,,$(@))\n" $(HOSTCXX) $(CBFSTOOLFLAGS) $(HOSTCXXFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Compress/LZMA/%.cpp - printf " HOSTCXX $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Compress/LZMA/%.cpp + printf " HOSTCXX $(subst $(objutil)/,,$(@))\n" $(HOSTCXX) $(CBFSTOOLFLAGS) $(HOSTCXXFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Compress/LZ/%.cpp - printf " HOSTCXX $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Compress/LZ/%.cpp + printf " HOSTCXX $(subst $(objutil)/,,$(@))\n" $(HOSTCXX) $(CBFSTOOLFLAGS) $(HOSTCXXFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/%.cpp - printf " HOSTCXX $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Compress/RangeCoder/%.cpp + printf " HOSTCXX $(subst $(objutil)/,,$(@))\n" $(HOSTCXX) $(CBFSTOOLFLAGS) $(HOSTCXXFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Common/%.cpp - printf " HOSTCXX $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/7zip/Common/%.cpp + printf " HOSTCXX $(subst $(objutil)/,,$(@))\n" $(HOSTCXX) $(CBFSTOOLFLAGS) $(HOSTCXXFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/Common/%.cpp - printf " HOSTCXX $(subst $(obj)/,,$(@))\n" +$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/Common/%.cpp + printf " HOSTCXX $(subst $(objutil)/,,$(@))\n" $(HOSTCXX) $(CBFSTOOLFLAGS) $(HOSTCXXFLAGS) -c -o $@ $<
-$(obj)/util/cbfstool/cbfstool: $(obj)/util/cbfstool $(addprefix $(obj)/util/cbfstool/,$(cbfsobj)) - printf " HOSTCXX $(subst $(obj)/,,$(@)) (link)\n" - $(HOSTCXX) $(CBFSTOOLFLAGS) -o $@ $(addprefix $(obj)/util/cbfstool/,$(cbfsobj)) +$(objutil)/cbfstool/cbfstool: $(objutil)/cbfstool $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) + printf " HOSTCXX $(subst $(objutil)/,,$(@)) (link)\n" + $(HOSTCXX) $(CBFSTOOLFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
Modified: trunk/util/sconfig/Makefile.inc ============================================================================== --- trunk/util/sconfig/Makefile.inc Fri Apr 16 15:43:49 2010 (r5452) +++ trunk/util/sconfig/Makefile.inc Sat Apr 17 00:48:57 2010 (r5453) @@ -2,10 +2,10 @@ sconfigobj += lex.yy.o sconfigobj += sconfig.tab.o
-$(obj)/util/sconfig: +$(objutil)/sconfig: mkdir -p $@
-$(obj)/util/sconfig/%.o: $(obj)/util/sconfig/%.c +$(objutil)/sconfig/%.o: $(objutil)/sconfig/%.c printf " HOSTCC $(subst $(obj)/,,$(@))\n" $(HOSTCC) $(SCONFIGFLAGS) $(HOSTCFLAGS) -c -o $@ $<
@@ -20,12 +20,12 @@
endif
-$(obj)/util/sconfig/lex.yy.o: $(obj)/util/sconfig/sconfig.tab.h +$(objutil)/sconfig/lex.yy.o: $(objutil)/sconfig/sconfig.tab.h
-$(obj)/util/sconfig/%: $(top)/util/sconfig/%_shipped +$(objutil)/sconfig/%: $(top)/util/sconfig/%_shipped mkdir -p $(dir $@) cp $< $@
-$(obj)/util/sconfig/sconfig: $(obj)/util/sconfig $(addprefix $(obj)/util/sconfig/,$(sconfigobj)) +$(objutil)/sconfig/sconfig: $(objutil)/sconfig $(addprefix $(objutil)/sconfig/,$(sconfigobj)) printf " HOSTCC $(subst $(obj)/,,$(@)) (link)\n" - $(HOSTCC) $(SCONFIGFLAGS) -o $@ $(addprefix $(obj)/util/sconfig/,$(sconfigobj)) + $(HOSTCC) $(SCONFIGFLAGS) -o $@ $(addprefix $(objutil)/sconfig/,$(sconfigobj))