[U-Boot] [PATCH/next v3 00/28] tools/Makefile cleanup and win32 tool support

This patch series attempts to do 2 things: 1. Add support for generating win32 versions of the tools in tools/ 2. Cleanup tools/Makefile somewhat
In the process of #1 I couldn't help but work on #2 a bit:) Let me know if people would prefer the patches split up.
The win32 tools support is based on the patch found in the email thread "Add native win32 mkimage support". It is different from the original patch in that it: 1. Supports all tools in tools/ (original only supported mkimage) 2. Uses common swap routines instead of re-implementing 3. Got rid of MINGW_COMPILE variable and used HOST* variables instead 4. Updated top-level Makefile to remove all generated *.exe files
Changes since v1: - Made changes recommended by Mike Frysinger * Rewordings, generic os_support.[ch] files, style changes, define __KERNEL_STRICT_NAMES for tool builds - Removed symlinking of header/source files into tools/ * The original code created build rules for files to be symlinked into the tools directory which had some shortcomings: - 2 make rules for every file - 1 for linking, 1 for compilation - Ugly clean target (rm specific files which were symlinks) - dependencies weren't auto-generated - Auto-generated dependencies for tools/ files - Remove individual file build rules in favor of a few generic build rules - Cleaned up HOSTARCH, HOSTOS, HOST_CFLAGS, and HOST_LDFLAGS - Rebased on TOT
Changes since v2: - Rebased on "next" branch - Updated tools/.gitignore - Moved zlib.h and bzlib.h into include/u-boot/
The changeset seem to grow with every revision, I hope third time's the charm:)
Peter Tyser (28): Makefile: Make autoconf.mk a dependency of the depend target Makefile: Add removal of *.exe files to clean target common/Makefile: Conditionally compile env_embedded.o elf.h: Use stdint.h to provide standard typedefs for WIN32 Rename include/zlib.h to include/u-boot/zlib.h Rename include/bzlib.h to include/u-boot/bzlib.h gen_eth_addr: Use POSIX rand() and srand() tools/Makefile: Remove HOSTARCH HOSTOS defines tools/Makefile: Remove inappropriate double-tabs tools/Makefile: Split variable declarations into multiple lines tools/Makefile: Build bmp_logo only when LCD or VIDEO logos are enabled tools/Makefile: Make img2srec dependent upon CONFIG_CMD_LOADS tools/Makefile: Make ubsha1 dependent upon CONFIG_SHA1_CHECK_UB_IMG tools/Makefile: Make inca-swap-bytes dependent on CONFIG_INCA_IP tools/Makefile: Make envcrc dependent upon CONFIG_ENV_IS_EMBEDDED tools/Makefile: Make gen_eth_addr dependent upon CONFIG_CMD_NET tools/Makefile: Compile ncb when CONFIG_NETCONSOLE tools/Makefile: Add tools/ to the include search path tools: Remove unecessary symlinking of zlib.h tools/Makefile: Add libfdt/ to the include search path tools/Makefile: Remove symlinks for fdt targets tools/Makefile: Dynamically generate libfdt object dependencies tools/Makefile: Remove symlinks for remaining source files tools/Makefile: Use auto-generated object file dependencies tools/Makefile: Create generic build rules tools/Makefile: Simplify HOST_CFLAGS/HOST_LDFLAGS generation Add support for building native win32 tools Delete now unused tools/Makefile.win32
Makefile | 22 ++-- README | 10 ++ board/mpl/common/common_util.c | 2 +- common/Makefile | 2 +- common/cmd_bootm.c | 4 +- doc/README.NetConsole | 6 +- fs/cramfs/uncompress.c | 2 +- include/elf.h | 7 +- include/image.h | 2 + include/libfdt_env.h | 12 ++ include/{ => u-boot}/bzlib.h | 0 include/{ => u-boot}/zlib.h | 0 lib_arm/bootm.c | 2 +- lib_avr32/bootm.c | 2 +- lib_generic/bzlib_private.h | 2 +- lib_generic/crc32.c | 2 +- lib_generic/gunzip.c | 2 +- lib_generic/zlib.c | 2 +- lib_i386/bootm.c | 2 +- lib_m68k/bootm.c | 4 +- lib_microblaze/bootm.c | 2 +- lib_mips/bootm.c | 2 +- lib_ppc/bootm.c | 4 +- tools/.gitignore | 12 -- tools/Makefile | 313 ++++++++++++++++------------------------ tools/Makefile.win32 | 37 ----- tools/gen_eth_addr.c | 6 +- tools/mingw_support.c | 79 ++++++++++ tools/mingw_support.h | 51 +++++++ tools/mkimage.h | 5 + tools/os_support.c | 24 +++ tools/os_support.h | 29 ++++ tools/ubsha1.c | 3 + 33 files changed, 370 insertions(+), 284 deletions(-) rename include/{ => u-boot}/bzlib.h (100%) rename include/{ => u-boot}/zlib.h (100%) delete mode 100644 tools/Makefile.win32 create mode 100644 tools/mingw_support.c create mode 100644 tools/mingw_support.h create mode 100644 tools/os_support.c create mode 100644 tools/os_support.h

The original code did not generate autoconf.mk until after some targets dependencies had already been calculated, for example the directories in the SUBDIRS variable
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Makefile | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile index e8b4c13..6f17ed1 100644 --- a/Makefile +++ b/Makefile @@ -345,31 +345,31 @@ $(obj)u-boot: depend $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot
-$(OBJS): depend $(obj)include/autoconf.mk +$(OBJS): depend $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
-$(LIBS): depend $(obj)include/autoconf.mk $(SUBDIRS) +$(LIBS): depend $(SUBDIRS) $(MAKE) -C $(dir $(subst $(obj),,$@))
-$(LIBBOARD): depend $(LIBS) $(obj)include/autoconf.mk +$(LIBBOARD): depend $(LIBS) $(MAKE) -C $(dir $(subst $(obj),,$@))
-$(SUBDIRS): depend $(obj)include/autoconf.mk +$(SUBDIRS): depend $(MAKE) -C $@ all
-$(LDSCRIPT): depend $(obj)include/autoconf.mk +$(LDSCRIPT): depend $(MAKE) -C $(dir $@) $(notdir $@)
$(NAND_SPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk $(MAKE) -C nand_spl/board/$(BOARDDIR) all
-$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk +$(U_BOOT_NAND): $(NAND_SPL) $(obj)u-boot.bin cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
$(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
-$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk +$(U_BOOT_ONENAND): $(ONENAND_IPL) $(obj)u-boot.bin cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
@@ -391,7 +391,7 @@ updater: env: $(MAKE) -C tools/env all MTD_VERSION=${MTD_VERSION} || exit 1
-depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) +depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
TAG_SUBDIRS += include

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile index 6f17ed1..b68de1c 100644 --- a/Makefile +++ b/Makefile @@ -3470,7 +3470,7 @@ clean: @rm -f $(obj)api_examples/demo $(TIMESTAMP_FILE) $(VERSION_FILE) @find $(OBJTREE) -type f \ ( -name 'core' -o -name '*.bak' -o -name '*~' \ - -o -name '*.o' -o -name '*.a' ) -print \ + -o -name '*.o' -o -name '*.a' -o -name '*.exe' ) -print \ | xargs rm -f
clobber: clean

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- common/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/Makefile b/common/Makefile index f13cd11..f81f3d8 100644 --- a/common/Makefile +++ b/common/Makefile @@ -51,7 +51,7 @@ COBJS-y += cmd_nvedit.o COBJS-y += env_common.o COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o -COBJS-y += env_embedded.o +COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o

The original code provided an incomplete set of typedefs for WIN32 compiles and replicated the standard typedefs that are already provided by stdint.h
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- include/elf.h | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/include/elf.h b/include/elf.h index a9839df..f640388 100644 --- a/include/elf.h +++ b/include/elf.h @@ -39,13 +39,8 @@ defined(__sun__) || \ defined(__APPLE__) #include <inttypes.h> -#elif defined(__linux__) && defined(USE_HOSTCC) +#elif (defined(__linux__) && defined(USE_HOSTCC)) || defined(__WIN32__) #include <stdint.h> -#elif defined(__WIN32__) -#include <unistd.h> -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif
/*

Some systems have zlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/zlib.h). Moving U-Boot's zlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- common/cmd_bootm.c | 2 +- fs/cramfs/uncompress.c | 2 +- include/{ => u-boot}/zlib.h | 0 lib_arm/bootm.c | 2 +- lib_avr32/bootm.c | 2 +- lib_generic/crc32.c | 2 +- lib_generic/gunzip.c | 2 +- lib_generic/zlib.c | 2 +- lib_i386/bootm.c | 2 +- lib_m68k/bootm.c | 2 +- lib_microblaze/bootm.c | 2 +- lib_mips/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename include/{ => u-boot}/zlib.h (100%)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 6fdeef4..bd1813a 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -30,7 +30,7 @@ #include <command.h> #include <image.h> #include <malloc.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <bzlib.h> #include <environment.h> #include <lmb.h> diff --git a/fs/cramfs/uncompress.c b/fs/cramfs/uncompress.c index 39dd275..228fe68 100644 --- a/fs/cramfs/uncompress.c +++ b/fs/cramfs/uncompress.c @@ -23,7 +23,7 @@ #include <common.h> #include <malloc.h> #include <watchdog.h> -#include <zlib.h> +#include <u-boot/zlib.h>
static z_stream stream;
diff --git a/include/zlib.h b/include/u-boot/zlib.h similarity index 100% rename from include/zlib.h rename to include/u-boot/zlib.h diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c index 7dbde7d..128b7e3 100644 --- a/lib_arm/bootm.c +++ b/lib_arm/bootm.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> #include <image.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <asm/byteorder.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c index 03ab8d1..2e6f0a4 100644 --- a/lib_avr32/bootm.c +++ b/lib_avr32/bootm.c @@ -22,7 +22,7 @@ #include <common.h> #include <command.h> #include <image.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <asm/byteorder.h> #include <asm/addrspace.h> #include <asm/io.h> diff --git a/lib_generic/crc32.c b/lib_generic/crc32.c index b6a7a91..3927ce1 100644 --- a/lib_generic/crc32.c +++ b/lib_generic/crc32.c @@ -17,7 +17,7 @@ #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) #include <watchdog.h> #endif -#include "zlib.h" +#include "u-boot/zlib.h"
#define local static #define ZEXPORT /* empty */ diff --git a/lib_generic/gunzip.c b/lib_generic/gunzip.c index 5bcf5b7..01a4031 100644 --- a/lib_generic/gunzip.c +++ b/lib_generic/gunzip.c @@ -26,7 +26,7 @@ #include <command.h> #include <image.h> #include <malloc.h> -#include <zlib.h> +#include <u-boot/zlib.h>
#define ZALLOC_ALIGNMENT 16 #define HEAD_CRC 2 diff --git a/lib_generic/zlib.c b/lib_generic/zlib.c index 2b01c8f..d1cd44c 100644 --- a/lib_generic/zlib.c +++ b/lib_generic/zlib.c @@ -27,7 +27,7 @@
#define _Z_UTIL_H
-#include "zlib.h" +#include "u-boot/zlib.h"
#ifndef local # define local static diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c index ea19b3d..f96d7bd 100644 --- a/lib_i386/bootm.c +++ b/lib_i386/bootm.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> #include <image.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <asm/byteorder.h> #include <asm/zimage.h>
diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c index 958c5ce..e5ed6eb 100755 --- a/lib_m68k/bootm.c +++ b/lib_m68k/bootm.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> #include <image.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <bzlib.h> #include <watchdog.h> #include <environment.h> diff --git a/lib_microblaze/bootm.c b/lib_microblaze/bootm.c index e97aae6..bce4774 100644 --- a/lib_microblaze/bootm.c +++ b/lib_microblaze/bootm.c @@ -27,7 +27,7 @@ #include <common.h> #include <command.h> #include <image.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <asm/byteorder.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c index 3db22ea..54af24c 100644 --- a/lib_mips/bootm.c +++ b/lib_mips/bootm.c @@ -24,7 +24,7 @@ #include <common.h> #include <command.h> #include <image.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <asm/byteorder.h> #include <asm/addrspace.h>
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index e03d763..0d702bf 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -29,7 +29,7 @@ #include <command.h> #include <image.h> #include <malloc.h> -#include <zlib.h> +#include <u-boot/zlib.h> #include <bzlib.h> #include <environment.h> #include <asm/byteorder.h>

Some systems have bzlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/bzlib.h). Moving U-Boot's bzlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- board/mpl/common/common_util.c | 2 +- common/cmd_bootm.c | 2 +- include/{ => u-boot}/bzlib.h | 0 lib_generic/bzlib_private.h | 2 +- lib_m68k/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename include/{ => u-boot}/bzlib.h (100%)
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c index d169391..c87a248 100644 --- a/board/mpl/common/common_util.c +++ b/board/mpl/common/common_util.c @@ -32,7 +32,7 @@ #include <devices.h> #include <pci.h> #include <malloc.h> -#include <bzlib.h> +#include <u-boot/bzlib.h>
#ifdef CONFIG_PIP405 #include "../pip405/pip405.h" diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index bd1813a..e66e5d2 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -31,7 +31,7 @@ #include <image.h> #include <malloc.h> #include <u-boot/zlib.h> -#include <bzlib.h> +#include <u-boot/bzlib.h> #include <environment.h> #include <lmb.h> #include <linux/ctype.h> diff --git a/include/bzlib.h b/include/u-boot/bzlib.h similarity index 100% rename from include/bzlib.h rename to include/u-boot/bzlib.h diff --git a/lib_generic/bzlib_private.h b/lib_generic/bzlib_private.h index 87d8f94..3414dbe 100644 --- a/lib_generic/bzlib_private.h +++ b/lib_generic/bzlib_private.h @@ -68,7 +68,7 @@
#include <malloc.h>
-#include "bzlib.h" +#include "u-boot/bzlib.h"
#ifndef BZ_NO_STDIO #include <stdio.h> diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c index e5ed6eb..c858cc4 100755 --- a/lib_m68k/bootm.c +++ b/lib_m68k/bootm.c @@ -25,7 +25,7 @@ #include <command.h> #include <image.h> #include <u-boot/zlib.h> -#include <bzlib.h> +#include <u-boot/bzlib.h> #include <watchdog.h> #include <environment.h> #include <asm/byteorder.h> diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 0d702bf..9a846c8 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -30,7 +30,7 @@ #include <image.h> #include <malloc.h> #include <u-boot/zlib.h> -#include <bzlib.h> +#include <u-boot/bzlib.h> #include <environment.h> #include <asm/byteorder.h>

Replace random()/srandom() use with rand()/srand() to support compilation with the mingw toolchain. The rand()/srand() functions are generally more common and are functionally equivalent to the original random()/srandom() calls.
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/gen_eth_addr.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/gen_eth_addr.c b/tools/gen_eth_addr.c index 75be385..429b20d 100644 --- a/tools/gen_eth_addr.c +++ b/tools/gen_eth_addr.c @@ -31,15 +31,15 @@ main(int argc, char *argv[]) { unsigned long ethaddr_low, ethaddr_high;
- srandom(time(0) | getpid()); + srand(time(0) | getpid());
/* * setting the 2nd LSB in the most significant byte of * the address makes it a locally administered ethernet * address */ - ethaddr_high = (random() & 0xfeff) | 0x0200; - ethaddr_low = random(); + ethaddr_high = (rand() & 0xfeff) | 0x0200; + ethaddr_low = rand();
printf("%02lx:%02lx:%02lx:%02lx:%02lx:%02lx\n", ethaddr_high >> 8, ethaddr_high & 0xff,

The values of HOSTARCH and HOSTOS which are exported from the top-level Makefile should be used
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 9e9ee15..e87daaf 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -51,18 +51,6 @@ endif
#-------------------------------------------------------------------------
-HOSTARCH := $(shell uname -m | \ - sed -e s/i.86/i386/ \ - -e s/sun4u/sparc64/ \ - -e s/arm.*/arm/ \ - -e s/sa110/arm/ \ - -e s/powerpc/ppc/ \ - -e s/Power\ Macintosh/ppc/ \ - -e s/macppc/ppc/) - -HOSTOS := $(shell uname -s | tr A-Z a-z | \ - sed -e 's/(cygwin).*/cygwin/') - TOOLSUBDIRS =
#

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 153 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 77 insertions(+), 76 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index e87daaf..4219aef 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -126,164 +126,165 @@ MAKEDEPEND = makedepend all: $(obj).depend $(BINS) $(LOGO_H) subdirs
$(obj)envcrc$(SFX): $(obj)envcrc.o $(obj)crc32.o $(obj)env_embedded.o $(obj)sha1.o - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^
$(obj)ubsha1$(SFX): $(obj)ubsha1.o $(obj)sha1.o - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^
$(obj)img2srec$(SFX): $(obj)img2srec.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
-$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)md5.o $(obj)sha1.o $(LIBFDT_OBJ_FILES) - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ +$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)md5.o \ + $(obj)sha1.o $(LIBFDT_OBJ_FILES) + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)ncb$(SFX): $(obj)ncb.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)gen_eth_addr$(SFX): $(obj)gen_eth_addr.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)bmp_logo$(SFX): $(obj)bmp_logo.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)inca-swap-bytes$(SFX): $(obj)inca-swap-bytes.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)mpc86x_clk$(SFX): $(obj)mpc86x_clk.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)bin2header$(SFX): $(obj)bin2header.o - $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ - $(STRIP) $@ + $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ + $(STRIP) $@
$(obj)envcrc.o: $(src)envcrc.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)ubsha1.o: $(src)ubsha1.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)crc32.o: $(obj)crc32.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)md5.o: $(obj)md5.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)sha1.o: $(obj)sha1.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)image.o: $(obj)image.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)mkimage.o: $(src)mkimage.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)ncb.o: $(src)ncb.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)gen_eth_addr.o: $(src)gen_eth_addr.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)inca-swap-bytes.o: $(src)inca-swap-bytes.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)mpc86x_clk.o: $(src)mpc86x_clk.c - $(CC) -g $(CFLAGS) -c -o $@ $< + $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)fdt.o: $(obj)fdt.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)fdt_ro.o: $(obj)fdt_ro.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)fdt_rw.o: $(obj)fdt_rw.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)fdt_strerror.o: $(obj)fdt_strerror.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)fdt_wip.o: $(obj)fdt_wip.c - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
subdirs: ifeq ($(TOOLSUBDIRS),) - @: + @: else - @for dir in $(TOOLSUBDIRS) ; do \ - $(MAKE) \ - HOSTOS=$(HOSTOS) \ - HOSTARCH=$(HOSTARCH) \ - HOST_CFLAGS="$(HOST_CFLAGS)" \ - HOST_LDFLAGS="$(HOST_LDFLAGS)" \ - -C $$dir || exit 1 ; \ - done + @for dir in $(TOOLSUBDIRS) ; do \ + $(MAKE) \ + HOSTOS=$(HOSTOS) \ + HOSTARCH=$(HOSTARCH) \ + HOST_CFLAGS="$(HOST_CFLAGS)" \ + HOST_LDFLAGS="$(HOST_LDFLAGS)" \ + -C $$dir || exit 1 ; \ + done endif
$(obj)env_embedded.c: - @rm -f $(obj)env_embedded.c - ln -s $(src)../common/env_embedded.c $(obj)env_embedded.c + @rm -f $(obj)env_embedded.c + ln -s $(src)../common/env_embedded.c $(obj)env_embedded.c
$(obj)env_embedded.o: $(obj)env_embedded.c - $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(obj)zlib.h: - @rm -f $@ - ln -s $(src)../include/zlib.h $@ + @rm -f $@ + ln -s $(src)../include/zlib.h $@
$(obj)crc32.c: $(obj)zlib.h - @rm -f $(obj)crc32.c - ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c + @rm -f $(obj)crc32.c + ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
$(obj)md5.c: - @rm -f $(obj)md5.c - ln -s $(src)../lib_generic/md5.c $(obj)md5.c + @rm -f $(obj)md5.c + ln -s $(src)../lib_generic/md5.c $(obj)md5.c
$(obj)sha1.c: - @rm -f $(obj)sha1.c - ln -s $(src)../lib_generic/sha1.c $(obj)sha1.c + @rm -f $(obj)sha1.c + ln -s $(src)../lib_generic/sha1.c $(obj)sha1.c
$(obj)image.c: - @rm -f $(obj)image.c - ln -s $(src)../common/image.c $(obj)image.c - if [ ! -f $(obj)mkimage.h ] ; then \ - ln -s $(src)../tools/mkimage.h $(obj)mkimage.h; \ - fi - if [ ! -f $(obj)fdt_host.h ] ; then \ - ln -s $(src)../tools/fdt_host.h $(obj)fdt_host.h; \ - fi + @rm -f $(obj)image.c + ln -s $(src)../common/image.c $(obj)image.c + if [ ! -f $(obj)mkimage.h ] ; then \ + ln -s $(src)../tools/mkimage.h $(obj)mkimage.h; \ + fi + if [ ! -f $(obj)fdt_host.h ] ; then \ + ln -s $(src)../tools/fdt_host.h $(obj)fdt_host.h; \ + fi
$(obj)fdt.c: $(obj)libfdt_internal.h - @rm -f $(obj)fdt.c - ln -s $(src)../libfdt/fdt.c $(obj)fdt.c + @rm -f $(obj)fdt.c + ln -s $(src)../libfdt/fdt.c $(obj)fdt.c
$(obj)fdt_ro.c: $(obj)libfdt_internal.h - @rm -f $(obj)fdt_ro.c - ln -s $(src)../libfdt/fdt_ro.c $(obj)fdt_ro.c + @rm -f $(obj)fdt_ro.c + ln -s $(src)../libfdt/fdt_ro.c $(obj)fdt_ro.c
$(obj)fdt_rw.c: $(obj)libfdt_internal.h - @rm -f $(obj)fdt_rw.c - ln -s $(src)../libfdt/fdt_rw.c $(obj)fdt_rw.c + @rm -f $(obj)fdt_rw.c + ln -s $(src)../libfdt/fdt_rw.c $(obj)fdt_rw.c
$(obj)fdt_strerror.c: $(obj)libfdt_internal.h - @rm -f $(obj)fdt_strerror.c - ln -s $(src)../libfdt/fdt_strerror.c $(obj)fdt_strerror.c + @rm -f $(obj)fdt_strerror.c + ln -s $(src)../libfdt/fdt_strerror.c $(obj)fdt_strerror.c
$(obj)fdt_wip.c: $(obj)libfdt_internal.h - @rm -f $(obj)fdt_wip.c - ln -s $(src)../libfdt/fdt_wip.c $(obj)fdt_wip.c + @rm -f $(obj)fdt_wip.c + ln -s $(src)../libfdt/fdt_wip.c $(obj)fdt_wip.c
$(obj)libfdt_internal.h: - @rm -f $(obj)libfdt_internal.h - ln -s $(src)../libfdt/libfdt_internal.h $(obj)libfdt_internal.h + @rm -f $(obj)libfdt_internal.h + ln -s $(src)../libfdt/libfdt_internal.h $(obj)libfdt_internal.h
$(LOGO_H): $(obj)bmp_logo $(LOGO_BMP) - $(obj)./bmp_logo $(LOGO_BMP) >$@ + $(obj)./bmp_logo $(LOGO_BMP) >$@
#########################################################################

Split variable declarations into multiple lines and use the standard VAR-y convention. Also move object and binary variable declarations to after config.mk has been included to allow for these lists to utilize the CONFIG_XXX variables.
These changes lay the groundwork for conditional compilation of files in the tools directory.
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 86 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 53 insertions(+), 33 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 4219aef..14da78d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -21,36 +21,6 @@ # MA 02111-1307 USA #
-BIN_FILES = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX) - -OBJ_LINKS = env_embedded.o crc32.o md5.o sha1.o image.o -OBJ_FILES = img2srec.o mkimage.o envcrc.o ubsha1.o gen_eth_addr.o bmp_logo.o - -ifeq ($(ARCH),mips) -BIN_FILES += inca-swap-bytes$(SFX) -OBJ_FILES += inca-swap-bytes.o -endif - -# Don't build by default -#ifeq ($(ARCH),ppc) -#BIN_FILES += mpc86x_clk$(SFX) -#OBJ_FILES += mpc86x_clk.o -#endif - -LIBFDT_OBJ_FILES = $(obj)fdt.o $(obj)fdt_ro.o $(obj)fdt_rw.o $(obj)fdt_strerror.o $(obj)fdt_wip.o - -LOGO_H = $(OBJTREE)/include/bmp_logo.h - -ifeq ($(LOGO_BMP),) -LOGO_BMP= logos/denx.bmp -endif -ifeq ($(VENDOR),atmel) -LOGO_BMP= logos/atmel.bmp -endif - - -#------------------------------------------------------------------------- - TOOLSUBDIRS =
# @@ -102,9 +72,59 @@ endif # include $(TOPDIR)/config.mk
+# Generated executable files +BIN_FILES-y += img2srec$(SFX) +BIN_FILES-y += mkimage$(SFX) +BIN_FILES-y += envcrc$(SFX) +BIN_FILES-y += ubsha1$(SFX) +BIN_FILES-y += gen_eth_addr$(SFX) +BIN_FILES-y += bmp_logo$(SFX) + +# Source files which are symlinked from elsewhere in U-Boot +OBJ_LINKS-y += env_embedded.o +OBJ_LINKS-y += crc32.o md5.o +OBJ_LINKS-y += sha1.o +OBJ_LINKS-y += image.o + +# Source files located in the tools directory +OBJ_FILES-y += img2srec.o +OBJ_FILES-y += mkimage.o +OBJ_FILES-y += envcrc.o +OBJ_FILES-y += ubsha1.o +OBJ_FILES-y += gen_eth_addr.o +OBJ_FILES-y += bmp_logo.o + +ifeq ($(ARCH),mips) +BIN_FILES-y += inca-swap-bytes$(SFX) +OBJ_FILES-y += inca-swap-bytes.o +endif + +# Don't build by default +#ifeq ($(ARCH),ppc) +#BIN_FILES-y += mpc86x_clk$(SFX) +#OBJ_FILES-y += mpc86x_clk.o +#endif + +# Flattened device tree objects +LIBFDT_OBJ_FILES-y += fdt.o +LIBFDT_OBJ_FILES-y += fdt_ro.o +LIBFDT_OBJ_FILES-y += fdt_rw.o +LIBFDT_OBJ_FILES-y += fdt_strerror.o +LIBFDT_OBJ_FILES-y += fdt_wip.o + +LOGO_H = $(OBJTREE)/include/bmp_logo.h + +ifeq ($(LOGO_BMP),) +LOGO_BMP= logos/denx.bmp +endif +ifeq ($(VENDOR),atmel) +LOGO_BMP= logos/atmel.bmp +endif + # now $(obj) is defined -SRCS := $(addprefix $(obj),$(OBJ_LINKS:.o=.c)) $(OBJ_FILES:.o=.c) -BINS := $(addprefix $(obj),$(BIN_FILES)) +SRCS := $(addprefix $(obj),$(OBJ_LINKS-y:.o=.c)) $(OBJ_FILES-y:.o=.c) +BINS := $(addprefix $(obj),$(BIN_FILES-y)) +LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
# # Use native tools and options @@ -136,7 +156,7 @@ $(obj)img2srec$(SFX): $(obj)img2srec.o $(STRIP) $@
$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)md5.o \ - $(obj)sha1.o $(LIBFDT_OBJ_FILES) + $(obj)sha1.o $(LIBFDT_OBJS) $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(STRIP) $@

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 14da78d..3c59bba 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -78,7 +78,8 @@ BIN_FILES-y += mkimage$(SFX) BIN_FILES-y += envcrc$(SFX) BIN_FILES-y += ubsha1$(SFX) BIN_FILES-y += gen_eth_addr$(SFX) -BIN_FILES-y += bmp_logo$(SFX) +BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) +BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX)
# Source files which are symlinked from elsewhere in U-Boot OBJ_LINKS-y += env_embedded.o @@ -92,7 +93,8 @@ OBJ_FILES-y += mkimage.o OBJ_FILES-y += envcrc.o OBJ_FILES-y += ubsha1.o OBJ_FILES-y += gen_eth_addr.o -OBJ_FILES-y += bmp_logo.o +OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o +OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o
ifeq ($(ARCH),mips) BIN_FILES-y += inca-swap-bytes$(SFX) @@ -112,7 +114,10 @@ LIBFDT_OBJ_FILES-y += fdt_rw.o LIBFDT_OBJ_FILES-y += fdt_strerror.o LIBFDT_OBJ_FILES-y += fdt_wip.o
+# Generated LCD/video logo LOGO_H = $(OBJTREE)/include/bmp_logo.h +LOGO-$(CONFIG_LCD_LOGO) += $(LOGO_H) +LOGO-$(CONFIG_VIDEO_LOGO) += $(LOGO_H)
ifeq ($(LOGO_BMP),) LOGO_BMP= logos/denx.bmp @@ -143,7 +148,7 @@ CC = $(HOSTCC) STRIP = $(HOSTSTRIP) MAKEDEPEND = makedepend
-all: $(obj).depend $(BINS) $(LOGO_H) subdirs +all: $(obj).depend $(BINS) $(LOGO-y) subdirs
$(obj)envcrc$(SFX): $(obj)envcrc.o $(obj)crc32.o $(obj)env_embedded.o $(obj)sha1.o $(CC) $(CFLAGS) -o $@ $^

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 3c59bba..b4bd417 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -73,7 +73,7 @@ endif include $(TOPDIR)/config.mk
# Generated executable files -BIN_FILES-y += img2srec$(SFX) +BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-y += mkimage$(SFX) BIN_FILES-y += envcrc$(SFX) BIN_FILES-y += ubsha1$(SFX) @@ -88,7 +88,7 @@ OBJ_LINKS-y += sha1.o OBJ_LINKS-y += image.o
# Source files located in the tools directory -OBJ_FILES-y += img2srec.o +OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o OBJ_FILES-y += mkimage.o OBJ_FILES-y += envcrc.o OBJ_FILES-y += ubsha1.o

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index b4bd417..e314091 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -76,7 +76,7 @@ include $(TOPDIR)/config.mk BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-y += mkimage$(SFX) BIN_FILES-y += envcrc$(SFX) -BIN_FILES-y += ubsha1$(SFX) +BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) BIN_FILES-y += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX) @@ -91,7 +91,7 @@ OBJ_LINKS-y += image.o OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o OBJ_FILES-y += mkimage.o OBJ_FILES-y += envcrc.o -OBJ_FILES-y += ubsha1.o +OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o OBJ_FILES-y += gen_eth_addr.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index e314091..942fae2 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -80,6 +80,7 @@ BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) BIN_FILES-y += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX) +BIN_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes$(SFX)
# Source files which are symlinked from elsewhere in U-Boot OBJ_LINKS-y += env_embedded.o @@ -95,11 +96,7 @@ OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o OBJ_FILES-y += gen_eth_addr.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o - -ifeq ($(ARCH),mips) -BIN_FILES-y += inca-swap-bytes$(SFX) -OBJ_FILES-y += inca-swap-bytes.o -endif +OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o
# Don't build by default #ifeq ($(ARCH),ppc)

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 942fae2..ec35f18 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -75,7 +75,7 @@ include $(TOPDIR)/config.mk # Generated executable files BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-y += mkimage$(SFX) -BIN_FILES-y += envcrc$(SFX) +BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) BIN_FILES-y += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) @@ -91,7 +91,7 @@ OBJ_LINKS-y += image.o # Source files located in the tools directory OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o OBJ_FILES-y += mkimage.o -OBJ_FILES-y += envcrc.o +OBJ_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o OBJ_FILES-y += gen_eth_addr.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index ec35f18..f648d34 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -77,7 +77,7 @@ BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX) BIN_FILES-y += mkimage$(SFX) BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) -BIN_FILES-y += gen_eth_addr$(SFX) +BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes$(SFX) @@ -93,7 +93,7 @@ OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o OBJ_FILES-y += mkimage.o OBJ_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o -OBJ_FILES-y += gen_eth_addr.o +OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o

Also conditionally add ncb.o to OBJ_FILES list
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- doc/README.NetConsole | 6 ++---- tools/Makefile | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/README.NetConsole b/doc/README.NetConsole index 94c8816..639cc12 100644 --- a/doc/README.NetConsole +++ b/doc/README.NetConsole @@ -55,10 +55,8 @@ Again, this script takes exactly one argument, which is interpreted as the target IP address (or host name, assuming DNS is working). The script can be interrupted by pressing ^T (CTRL-T).
-The 'ncb' tool can be found in the tools directory; it will not be -built by default so you will ither have to adjust the Makefile or -build it manually. - +The 'ncb' tool can be found in the tools directory; it will be built +when compiling for a board which has CONFIG_NETCONSOLE defined.
For Linux, the network-based console needs special configuration. Minimally, the host IP address needs to be specified. This can be diff --git a/tools/Makefile b/tools/Makefile index f648d34..35e694d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -81,6 +81,7 @@ BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes$(SFX) +BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
# Source files which are symlinked from elsewhere in U-Boot OBJ_LINKS-y += env_embedded.o @@ -97,6 +98,7 @@ OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o +OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
# Don't build by default #ifeq ($(ARCH),ppc)

This change makes the process of symlinking mkimage.h and fdt_host.h unnecessary
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 35e694d..e1f262b 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -136,6 +136,7 @@ LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y)) CPPFLAGS = -idirafter $(SRCTREE)/include \ -idirafter $(OBJTREE)/include2 \ -idirafter $(OBJTREE)/include \ + -I $(SRCTREE)/tools \ -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O
@@ -276,12 +277,6 @@ $(obj)sha1.c: $(obj)image.c: @rm -f $(obj)image.c ln -s $(src)../common/image.c $(obj)image.c - if [ ! -f $(obj)mkimage.h ] ; then \ - ln -s $(src)../tools/mkimage.h $(obj)mkimage.h; \ - fi - if [ ! -f $(obj)fdt_host.h ] ; then \ - ln -s $(src)../tools/fdt_host.h $(obj)fdt_host.h; \ - fi
$(obj)fdt.c: $(obj)libfdt_internal.h @rm -f $(obj)fdt.c

crc32.c uses the zlib.h header in include/u-boot/zlib.h. The symlink was previously necessary to give U-Boot's version of zlib.h precedence over the host computer's version of zlib.h.
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Makefile | 2 +- tools/.gitignore | 1 - tools/Makefile | 6 +----- 3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile index b68de1c..8179bcb 100644 --- a/Makefile +++ b/Makefile @@ -3482,7 +3482,7 @@ clobber: clean $(obj)cscope.* $(obj)*.*~ @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) @rm -f $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes} - @rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h} + @rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c} @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h} @rm -f $(obj)cpu/mpc824x/bedbug_603e.c @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm diff --git a/tools/.gitignore b/tools/.gitignore index 377ca9a..c2ac0ae 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -18,4 +18,3 @@ /fdt_strerror.c /fdt_wip.c /libfdt_internal.h -/zlib.h diff --git a/tools/Makefile b/tools/Makefile index e1f262b..037f61b 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -258,11 +258,7 @@ $(obj)env_embedded.c: $(obj)env_embedded.o: $(obj)env_embedded.c $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
-$(obj)zlib.h: - @rm -f $@ - ln -s $(src)../include/zlib.h $@ - -$(obj)crc32.c: $(obj)zlib.h +$(obj)crc32.c: $(SRCTREE)/include/u-boot/zlib.h @rm -f $(obj)crc32.c ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c

This change makes the process of symlinking libfdt_internal.h unnecessary
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Makefile | 2 +- tools/.gitignore | 1 - tools/Makefile | 15 ++++++--------- 3 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile index 8179bcb..4d6b04c 100644 --- a/Makefile +++ b/Makefile @@ -3483,7 +3483,7 @@ clobber: clean @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) @rm -f $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes} @rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c} - @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h} + @rm -f $(obj)tools/{fdt_wip.c} @rm -f $(obj)cpu/mpc824x/bedbug_603e.c @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f diff --git a/tools/.gitignore b/tools/.gitignore index c2ac0ae..ea39027 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -17,4 +17,3 @@ /fdt_rw.c /fdt_strerror.c /fdt_wip.c -/libfdt_internal.h diff --git a/tools/Makefile b/tools/Makefile index 037f61b..294d388 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -136,6 +136,7 @@ LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y)) CPPFLAGS = -idirafter $(SRCTREE)/include \ -idirafter $(OBJTREE)/include2 \ -idirafter $(OBJTREE)/include \ + -I $(SRCTREE)/libfdt \ -I $(SRCTREE)/tools \ -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O @@ -274,30 +275,26 @@ $(obj)image.c: @rm -f $(obj)image.c ln -s $(src)../common/image.c $(obj)image.c
-$(obj)fdt.c: $(obj)libfdt_internal.h +$(obj)fdt.c: $(SRCTREE)/libfdt/libfdt_internal.h @rm -f $(obj)fdt.c ln -s $(src)../libfdt/fdt.c $(obj)fdt.c
-$(obj)fdt_ro.c: $(obj)libfdt_internal.h +$(obj)fdt_ro.c: $(SRCTREE)/libfdt/libfdt_internal.h @rm -f $(obj)fdt_ro.c ln -s $(src)../libfdt/fdt_ro.c $(obj)fdt_ro.c
-$(obj)fdt_rw.c: $(obj)libfdt_internal.h +$(obj)fdt_rw.c: $(SRCTREE)/libfdt/libfdt_internal.h @rm -f $(obj)fdt_rw.c ln -s $(src)../libfdt/fdt_rw.c $(obj)fdt_rw.c
-$(obj)fdt_strerror.c: $(obj)libfdt_internal.h +$(obj)fdt_strerror.c: $(SRCTREE)/libfdt/libfdt_internal.h @rm -f $(obj)fdt_strerror.c ln -s $(src)../libfdt/fdt_strerror.c $(obj)fdt_strerror.c
-$(obj)fdt_wip.c: $(obj)libfdt_internal.h +$(obj)fdt_wip.c: $(SRCTREE)/libfdt/libfdt_internal.h @rm -f $(obj)fdt_wip.c ln -s $(src)../libfdt/fdt_wip.c $(obj)fdt_wip.c
-$(obj)libfdt_internal.h: - @rm -f $(obj)libfdt_internal.h - ln -s $(src)../libfdt/libfdt_internal.h $(obj)libfdt_internal.h - $(LOGO_H): $(obj)bmp_logo $(LOGO_BMP) $(obj)./bmp_logo $(LOGO_BMP) >$@

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Makefile | 3 +-- tools/.gitignore | 5 ----- tools/Makefile | 32 +++++++------------------------- 3 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/Makefile b/Makefile index 4d6b04c..ef95339 100644 --- a/Makefile +++ b/Makefile @@ -3482,8 +3482,7 @@ clobber: clean $(obj)cscope.* $(obj)*.*~ @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) @rm -f $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes} - @rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c} - @rm -f $(obj)tools/{fdt_wip.c} + @rm -f $(obj)tools/{image.c} @rm -f $(obj)cpu/mpc824x/bedbug_603e.c @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f diff --git a/tools/.gitignore b/tools/.gitignore index ea39027..7614766 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -12,8 +12,3 @@ /ubsha1 /inca-swap-bytes /image.c -/fdt.c -/fdt_ro.c -/fdt_rw.c -/fdt_strerror.c -/fdt_wip.c diff --git a/tools/Makefile b/tools/Makefile index 294d388..ef51abc 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -22,6 +22,7 @@ #
TOOLSUBDIRS = +LIBFDT_DIR = $(SRCTREE)/libfdt/
# # Mac OS X / Darwin's C preprocessor is Apple specific. It @@ -223,19 +224,20 @@ $(obj)inca-swap-bytes.o: $(src)inca-swap-bytes.c $(obj)mpc86x_clk.o: $(src)mpc86x_clk.c $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)fdt.o: $(obj)fdt.c +$(obj)fdt.o: $(LIBFDT_DIR)fdt.c $(SRCTREE)/libfdt/libfdt_internal.h $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_ro.o: $(obj)fdt_ro.c +$(obj)fdt_ro.o: $(LIBFDT_DIR)fdt_ro.c $(SRCTREE)/libfdt/libfdt_internal.h $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_rw.o: $(obj)fdt_rw.c +$(obj)fdt_rw.o: $(LIBFDT_DIR)fdt_rw.c $(SRCTREE)/libfdt/libfdt_internal.h $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_strerror.o: $(obj)fdt_strerror.c +$(obj)fdt_strerror.o: $(LIBFDT_DIR)fdt_strerror.c \ + $(SRCTREE)/libfdt/libfdt_internal.h $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_wip.o: $(obj)fdt_wip.c +$(obj)fdt_wip.o: $(LIBFDT_DIR)fdt_wip.c $(SRCTREE)/libfdt/libfdt_internal.h $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
subdirs: @@ -275,26 +277,6 @@ $(obj)image.c: @rm -f $(obj)image.c ln -s $(src)../common/image.c $(obj)image.c
-$(obj)fdt.c: $(SRCTREE)/libfdt/libfdt_internal.h - @rm -f $(obj)fdt.c - ln -s $(src)../libfdt/fdt.c $(obj)fdt.c - -$(obj)fdt_ro.c: $(SRCTREE)/libfdt/libfdt_internal.h - @rm -f $(obj)fdt_ro.c - ln -s $(src)../libfdt/fdt_ro.c $(obj)fdt_ro.c - -$(obj)fdt_rw.c: $(SRCTREE)/libfdt/libfdt_internal.h - @rm -f $(obj)fdt_rw.c - ln -s $(src)../libfdt/fdt_rw.c $(obj)fdt_rw.c - -$(obj)fdt_strerror.c: $(SRCTREE)/libfdt/libfdt_internal.h - @rm -f $(obj)fdt_strerror.c - ln -s $(src)../libfdt/fdt_strerror.c $(obj)fdt_strerror.c - -$(obj)fdt_wip.c: $(SRCTREE)/libfdt/libfdt_internal.h - @rm -f $(obj)fdt_wip.c - ln -s $(src)../libfdt/fdt_wip.c $(obj)fdt_wip.c - $(LOGO_H): $(obj)bmp_logo $(LOGO_BMP) $(obj)./bmp_logo $(LOGO_BMP) >$@

Add the libfdt files to the SRCS variable so that they have their dependencies automatically generated
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index ef51abc..b1680ad 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -22,7 +22,6 @@ #
TOOLSUBDIRS = -LIBFDT_DIR = $(SRCTREE)/libfdt/
# # Mac OS X / Darwin's C preprocessor is Apple specific. It @@ -128,6 +127,7 @@ endif
# now $(obj) is defined SRCS := $(addprefix $(obj),$(OBJ_LINKS-y:.o=.c)) $(OBJ_FILES-y:.o=.c) +SRCS += $(addprefix $(SRCTREE)/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c)) BINS := $(addprefix $(obj),$(BIN_FILES-y)) LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
@@ -224,20 +224,19 @@ $(obj)inca-swap-bytes.o: $(src)inca-swap-bytes.c $(obj)mpc86x_clk.o: $(src)mpc86x_clk.c $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)fdt.o: $(LIBFDT_DIR)fdt.c $(SRCTREE)/libfdt/libfdt_internal.h +$(obj)fdt.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_ro.o: $(LIBFDT_DIR)fdt_ro.c $(SRCTREE)/libfdt/libfdt_internal.h +$(obj)fdt_ro.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_rw.o: $(LIBFDT_DIR)fdt_rw.c $(SRCTREE)/libfdt/libfdt_internal.h +$(obj)fdt_rw.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_strerror.o: $(LIBFDT_DIR)fdt_strerror.c \ - $(SRCTREE)/libfdt/libfdt_internal.h +$(obj)fdt_strerror.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_wip.o: $(LIBFDT_DIR)fdt_wip.c $(SRCTREE)/libfdt/libfdt_internal.h +$(obj)fdt_wip.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
subdirs:

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- Makefile | 3 +-- tools/.gitignore | 5 ----- tools/Makefile | 44 +++++++++++++------------------------------- 3 files changed, 14 insertions(+), 38 deletions(-)
diff --git a/Makefile b/Makefile index ef95339..dfcb71b 100644 --- a/Makefile +++ b/Makefile @@ -3481,8 +3481,7 @@ clobber: clean @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \ $(obj)cscope.* $(obj)*.*~ @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) - @rm -f $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes} - @rm -f $(obj)tools/{image.c} + @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)cpu/mpc824x/bedbug_603e.c @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f diff --git a/tools/.gitignore b/tools/.gitignore index 7614766..3a4136b 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -1,14 +1,9 @@ /bmp_logo -/crc32.c /envcrc -/env_embedded.c /gen_eth_addr /img2srec -/md5.c /mkimage /mpc86x_clk /ncp -/sha1.c /ubsha1 /inca-swap-bytes -/image.c diff --git a/tools/Makefile b/tools/Makefile index b1680ad..6ef9099 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -83,11 +83,12 @@ BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX) BIN_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
-# Source files which are symlinked from elsewhere in U-Boot -OBJ_LINKS-y += env_embedded.o -OBJ_LINKS-y += crc32.o md5.o -OBJ_LINKS-y += sha1.o -OBJ_LINKS-y += image.o +# Source files which exist outside the tools directory +EXT_OBJ_FILES-y += common/env_embedded.o +EXT_OBJ_FILES-y += lib_generic/crc32.o +EXT_OBJ_FILES-y += lib_generic/md5.o +EXT_OBJ_FILES-y += lib_generic/sha1.o +EXT_OBJ_FILES-y += common/image.o
# Source files located in the tools directory OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o @@ -126,7 +127,8 @@ LOGO_BMP= logos/atmel.bmp endif
# now $(obj) is defined -SRCS := $(addprefix $(obj),$(OBJ_LINKS-y:.o=.c)) $(OBJ_FILES-y:.o=.c) +SRCS += $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c)) +SRCS += $(OBJ_FILES-y:.o=.c) SRCS += $(addprefix $(SRCTREE)/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c)) BINS := $(addprefix $(obj),$(BIN_FILES-y)) LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y)) @@ -197,16 +199,16 @@ $(obj)envcrc.o: $(src)envcrc.c $(obj)ubsha1.o: $(src)ubsha1.c $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)crc32.o: $(obj)crc32.c +$(obj)crc32.o: $(SRCTREE)/lib_generic/crc32.c $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)md5.o: $(obj)md5.c +$(obj)md5.o: $(SRCTREE)/lib_generic/md5.c $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)sha1.o: $(obj)sha1.c +$(obj)sha1.o: $(SRCTREE)/lib_gneric/sha1.c $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)image.o: $(obj)image.c +$(obj)image.o: $(SRCTREE)/common/image.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)mkimage.o: $(src)mkimage.c @@ -253,29 +255,9 @@ else done endif
-$(obj)env_embedded.c: - @rm -f $(obj)env_embedded.c - ln -s $(src)../common/env_embedded.c $(obj)env_embedded.c - -$(obj)env_embedded.o: $(obj)env_embedded.c +$(obj)env_embedded.o: $(SRCTREE)/common/env_embedded.c $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
-$(obj)crc32.c: $(SRCTREE)/include/u-boot/zlib.h - @rm -f $(obj)crc32.c - ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c - -$(obj)md5.c: - @rm -f $(obj)md5.c - ln -s $(src)../lib_generic/md5.c $(obj)md5.c - -$(obj)sha1.c: - @rm -f $(obj)sha1.c - ln -s $(src)../lib_generic/sha1.c $(obj)sha1.c - -$(obj)image.c: - @rm -f $(obj)image.c - ln -s $(src)../common/image.c $(obj)image.c - $(LOGO_H): $(obj)bmp_logo $(LOGO_BMP) $(obj)./bmp_logo $(LOGO_BMP) >$@

Files in the SRCS variable have their dependencies automatically generated so remove duplicate explicit dependencies
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index 6ef9099..b7a30b2 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -193,37 +193,37 @@ $(obj)bin2header$(SFX): $(obj)bin2header.o $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(STRIP) $@
-$(obj)envcrc.o: $(src)envcrc.c +$(obj)envcrc.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)ubsha1.o: $(src)ubsha1.c +$(obj)ubsha1.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)crc32.o: $(SRCTREE)/lib_generic/crc32.c +$(obj)crc32.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)md5.o: $(SRCTREE)/lib_generic/md5.c +$(obj)md5.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)sha1.o: $(SRCTREE)/lib_gneric/sha1.c +$(obj)sha1.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)image.o: $(SRCTREE)/common/image.c +$(obj)image.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)mkimage.o: $(src)mkimage.c +$(obj)mkimage.o: $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)ncb.o: $(src)ncb.c +$(obj)ncb.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)gen_eth_addr.o: $(src)gen_eth_addr.c +$(obj)gen_eth_addr.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)inca-swap-bytes.o: $(src)inca-swap-bytes.c +$(obj)inca-swap-bytes.o: $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)mpc86x_clk.o: $(src)mpc86x_clk.c +$(obj)mpc86x_clk.o: $(CC) -g $(CFLAGS) -c -o $@ $<
$(obj)fdt.o: @@ -255,7 +255,7 @@ else done endif
-$(obj)env_embedded.o: $(SRCTREE)/common/env_embedded.c +$(obj)env_embedded.o: $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(LOGO_H): $(obj)bmp_logo $(LOGO_BMP)

Create a few generic build rules to replace the current method which has 1 build target for each file
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 55 +++++++++---------------------------------------------- 1 files changed, 9 insertions(+), 46 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index b7a30b2..d6d366d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -38,13 +38,11 @@ TOOLSUBDIRS = ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc) HOST_CFLAGS = -traditional-cpp -Wall HOST_LDFLAGS =-multiply_defined suppress -HOST_ENVIRO_CFLAGS =
else ifeq ($(HOSTOS)-$(HOSTARCH),netbsd-ppc) HOST_CFLAGS = -Wall -pedantic HOST_LDFLAGS = -HOST_ENVIRO_CFLAGS =
# # Everyone else @@ -52,7 +50,6 @@ HOST_ENVIRO_CFLAGS = else HOST_CFLAGS = -Wall -pedantic HOST_LDFLAGS = -HOST_ENVIRO_CFLAGS = endif endif
@@ -128,7 +125,7 @@ endif
# now $(obj) is defined SRCS += $(addprefix $(SRCTREE)/,$(EXT_OBJ_FILES-y:.o=.c)) -SRCS += $(OBJ_FILES-y:.o=.c) +SRCS += $(addprefix $(SRCTREE)/tools/,$(OBJ_FILES-y:.o=.c)) SRCS += $(addprefix $(SRCTREE)/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c)) BINS := $(addprefix $(obj),$(BIN_FILES-y)) LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y)) @@ -193,52 +190,21 @@ $(obj)bin2header$(SFX): $(obj)bin2header.o $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(STRIP) $@
-$(obj)envcrc.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)ubsha1.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)crc32.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)md5.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)sha1.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)image.o: +# image.c and mkimage.c require FIT_CFLAGS instead of standard CFLAGS +$(obj)image.o: $(SRCTREE)/tools/image.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)mkimage.o: +$(obj)mkimage.o: $(SRCTREE)/tools/mkimage.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)ncb.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)gen_eth_addr.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)inca-swap-bytes.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)mpc86x_clk.o: - $(CC) -g $(CFLAGS) -c -o $@ $< - -$(obj)fdt.o: - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< - -$(obj)fdt_ro.o: - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< - -$(obj)fdt_rw.o: +# Some of the tool objects need to be accessed from outside the tools directory +$(obj)%.o: $(SRCTREE)/common/%.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_strerror.o: - $(CC) -g $(FIT_CFLAGS) -c -o $@ $< +$(obj)%.o: $(SRCTREE)/lib_generic/%.c + $(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)fdt_wip.o: +$(LIBFDT_OBJS): $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
subdirs: @@ -255,9 +221,6 @@ else done endif
-$(obj)env_embedded.o: - $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $< - $(LOGO_H): $(obj)bmp_logo $(LOGO_BMP) $(obj)./bmp_logo $(LOGO_BMP) >$@

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile | 17 +++++------------ 1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile index d6d366d..9fe5b1a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -35,22 +35,15 @@ TOOLSUBDIRS = # multiple symbol definitions are treated as errors, hence the # -multiply_defined suppress option to turn off this error. # -ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc) -HOST_CFLAGS = -traditional-cpp -Wall -HOST_LDFLAGS =-multiply_defined suppress
-else -ifeq ($(HOSTOS)-$(HOSTARCH),netbsd-ppc) -HOST_CFLAGS = -Wall -pedantic +HOST_CFLAGS = -Wall HOST_LDFLAGS =
-# -# Everyone else -# +ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc) +HOST_CFLAGS += -traditional-cpp +HOST_LDFLAGS += -multiply_defined suppress else -HOST_CFLAGS = -Wall -pedantic -HOST_LDFLAGS = -endif +HOST_CFLAGS += -pedantic endif
#

Add support for compiling the host tools in the tools directory using the MinGW toolchain. This produces executables which can be used on standard Windows computers without requiring cygwin.
One must specify the MinGW compiler and strip utilities as if they were the host toolchain in order to build win32 executables, eg:
make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools
Signed-off-by: Peter Tyser ptyser@xes-inc.com --- README | 10 ++++++ include/image.h | 2 + include/libfdt_env.h | 12 +++++++ tools/Makefile | 23 ++++++++++---- tools/mingw_support.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/mingw_support.h | 51 +++++++++++++++++++++++++++++++ tools/mkimage.h | 5 +++ tools/os_support.c | 24 +++++++++++++++ tools/os_support.h | 29 ++++++++++++++++++ tools/ubsha1.c | 3 ++ 10 files changed, 231 insertions(+), 7 deletions(-) create mode 100644 tools/mingw_support.c create mode 100644 tools/mingw_support.h create mode 100644 tools/os_support.c create mode 100644 tools/os_support.h
diff --git a/README b/README index 43fb1c0..3fb2814 100644 --- a/README +++ b/README @@ -2710,6 +2710,16 @@ necessary. For example using the ELDK on a 4xx CPU, please enter: $ CROSS_COMPILE=ppc_4xx- $ export CROSS_COMPILE
+Note: If you wish to generate Windows versions of the utilities in + the tools directory you can use the MinGW toolchain + (http://www.mingw.org). Set your HOST tools to the MinGW + toolchain and execute 'make tools'. For example: + + $ make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools + + Binaries such as tools/mkimage.exe will be created which can + be executed on computers running Windows. + U-Boot is intended to be simple to build. After installing the sources you must configure U-Boot for one specific board type. This is done by typing: diff --git a/include/image.h b/include/image.h index 74a1240..f183757 100644 --- a/include/image.h +++ b/include/image.h @@ -34,7 +34,9 @@ #define __IMAGE_H__
#if USE_HOSTCC +#ifndef __MINGW32__ #include <endian.h> +#endif
/* new uImage format support enabled on host */ #define CONFIG_FIT 1 diff --git a/include/libfdt_env.h b/include/libfdt_env.h index ea474a5..1c67015 100644 --- a/include/libfdt_env.h +++ b/include/libfdt_env.h @@ -24,8 +24,13 @@ #ifdef USE_HOSTCC #include <stdint.h> #include <string.h> +#ifdef __MINGW32__ +#include <linux/types.h> +#include <linux/byteorder/swab.h> +#else #include <endian.h> #include <byteswap.h> +#endif /* __MINGW32__ */ #else #include <linux/string.h> #include <linux/types.h> @@ -36,10 +41,17 @@ extern struct fdt_header *working_fdt; /* Pointer to the working fdt */
#if __BYTE_ORDER == __LITTLE_ENDIAN +#ifdef __MINGW32__ +#define fdt32_to_cpu(x) ___swab32(x) +#define cpu_to_fdt32(x) ___swab32(x) +#define fdt64_to_cpu(x) ___swab64(x) +#define cpu_to_fdt64(x) ___swab64(x) +#else #define fdt32_to_cpu(x) bswap_32(x) #define cpu_to_fdt32(x) bswap_32(x) #define fdt64_to_cpu(x) bswap_64(x) #define cpu_to_fdt64(x) bswap_64(x) +#endif #else #define fdt32_to_cpu(x) (x) #define cpu_to_fdt32(x) (x) diff --git a/tools/Makefile b/tools/Makefile index 9fe5b1a..122e5bb 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -46,12 +46,15 @@ else HOST_CFLAGS += -pedantic endif
+ifeq ($(HOSTOS),cygwin) +HOST_CFLAGS += -ansi +endif + # -# Cygwin needs .exe files :-( +# toolchains targeting win32 generate .exe files # -ifeq ($(HOSTOS),cygwin) +ifneq (,$(findstring WIN32 ,$(shell $(HOSTCC) -E -dM -xc /dev/null))) SFX = .exe -HOST_CFLAGS += -ansi else SFX = endif @@ -90,6 +93,7 @@ OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes.o OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o +OBJ_FILES-y += os_support.o
# Don't build by default #ifeq ($(ARCH),ppc) @@ -125,13 +129,15 @@ LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
# # Use native tools and options +# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps # CPPFLAGS = -idirafter $(SRCTREE)/include \ -idirafter $(OBJTREE)/include2 \ -idirafter $(OBJTREE)/include \ -I $(SRCTREE)/libfdt \ -I $(SRCTREE)/tools \ - -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC + -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC \ + -D__KERNEL_STRICT_NAMES CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O
# No -pedantic switch to avoid libfdt compilation warnings @@ -147,7 +153,7 @@ all: $(obj).depend $(BINS) $(LOGO-y) subdirs $(obj)envcrc$(SFX): $(obj)envcrc.o $(obj)crc32.o $(obj)env_embedded.o $(obj)sha1.o $(CC) $(CFLAGS) -o $@ $^
-$(obj)ubsha1$(SFX): $(obj)ubsha1.o $(obj)sha1.o +$(obj)ubsha1$(SFX): $(obj)ubsha1.o $(obj)sha1.o $(obj)os_support.o $(CC) $(CFLAGS) -o $@ $^
$(obj)img2srec$(SFX): $(obj)img2srec.o @@ -155,7 +161,7 @@ $(obj)img2srec$(SFX): $(obj)img2srec.o $(STRIP) $@
$(obj)mkimage$(SFX): $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)md5.o \ - $(obj)sha1.o $(LIBFDT_OBJS) + $(obj)sha1.o $(LIBFDT_OBJS) $(obj)os_support.o $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(STRIP) $@
@@ -183,13 +189,16 @@ $(obj)bin2header$(SFX): $(obj)bin2header.o $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(STRIP) $@
-# image.c and mkimage.c require FIT_CFLAGS instead of standard CFLAGS +# Some files complain if compiled with -pedantic, use FIT_CFLAGS $(obj)image.o: $(SRCTREE)/tools/image.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)mkimage.o: $(SRCTREE)/tools/mkimage.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+$(obj)os_support.o: $(SRCTREE)/tools/os_support.c + $(CC) -g $(FIT_CFLAGS) -c -o $@ $< + # Some of the tool objects need to be accessed from outside the tools directory $(obj)%.o: $(SRCTREE)/common/%.c $(CC) -g $(FIT_CFLAGS) -c -o $@ $< diff --git a/tools/mingw_support.c b/tools/mingw_support.c new file mode 100644 index 0000000..67cd6e1 --- /dev/null +++ b/tools/mingw_support.c @@ -0,0 +1,79 @@ +/* + * Copyright 2008 Extreme Engineering Solutions, Inc. + * + * mmap/munmap implementation derived from: + * Clamav Native Windows Port : mmap win32 compatibility layer + * Copyright (c) 2005-2006 Gianluigi Tiesi sherpya@netfarm.it + * Parts by Kees Zeelenberg kzlg@users.sourceforge.net (LibGW32C) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this software; if not, write to the + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "mingw_support.h" +#include <stdio.h> +#include <stdint.h> +#include <errno.h> +#include <io.h> + +int fsync(int fd) +{ + return _commit(fd); +} + +void *mmap(void *addr, size_t len, int prot, int flags, int fd, int offset) +{ + void *map = NULL; + HANDLE handle = INVALID_HANDLE_VALUE; + DWORD cfm_flags = 0, mvf_flags = 0; + + switch (prot) { + case PROT_READ | PROT_WRITE: + cfm_flags = PAGE_READWRITE; + mvf_flags = FILE_MAP_ALL_ACCESS; + break; + case PROT_WRITE: + cfm_flags = PAGE_READWRITE; + mvf_flags = FILE_MAP_WRITE; + break; + case PROT_READ: + cfm_flags = PAGE_READONLY; + mvf_flags = FILE_MAP_READ; + break; + default: + return MAP_FAILED; + } + + handle = CreateFileMappingA((HANDLE) _get_osfhandle(fd), NULL, + cfm_flags, HIDWORD(len), LODWORD(len), NULL); + if (!handle) + return MAP_FAILED; + + map = MapViewOfFile(handle, mvf_flags, HIDWORD(offset), + LODWORD(offset), len); + CloseHandle(handle); + + if (!map) + return MAP_FAILED; + + return map; +} + +int munmap(void *addr, size_t len) +{ + if (!UnmapViewOfFile(addr)) + return -1; + + return 0; +} diff --git a/tools/mingw_support.h b/tools/mingw_support.h new file mode 100644 index 0000000..1fb6c93 --- /dev/null +++ b/tools/mingw_support.h @@ -0,0 +1,51 @@ +/* + * Copyright 2008 Extreme Engineering Solutions, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this software; if not, write to the + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __MINGW_SUPPORT_H_ +#define __WINGW_SUPPORT_H_ 1 + +/* Defining __INSIDE_MSYS__ helps to prevent u-boot/mingw overlap */ +#define __INSIDE_MSYS__ 1 + +#include <windows.h> + +/* mmap protections */ +#define PROT_READ 0x1 /* Page can be read */ +#define PROT_WRITE 0x2 /* Page can be written */ +#define PROT_EXEC 0x4 /* Page can be executed */ +#define PROT_NONE 0x0 /* Page can not be accessed */ + +/* Sharing types (must choose one and only one of these) */ +#define MAP_SHARED 0x01 /* Share changes */ +#define MAP_PRIVATE 0x02 /* Changes are private */ + +/* Return value of `mmap' in case of an error */ +#define MAP_FAILED ((void *) -1) + +/* Windows 64-bit access macros */ +#define LODWORD(x) ((DWORD)((DWORDLONG)(x))) +#define HIDWORD(x) ((DWORD)(((DWORDLONG)(x) >> 32) & 0xffffffff)) + +typedef UINT uint; +typedef ULONG ulong; + +int fsync(int fd); +void *mmap(void *, size_t, int, int, int, int); +int munmap(void *, size_t); + +#endif /* __MINGW_SUPPORT_H_ */ diff --git a/tools/mkimage.h b/tools/mkimage.h index a2d5248..c8df6e1 100644 --- a/tools/mkimage.h +++ b/tools/mkimage.h @@ -20,6 +20,7 @@ * MA 02111-1307 USA */
+#include "os_support.h" #include <errno.h> #include <fcntl.h> #include <stdio.h> @@ -28,7 +29,11 @@ #ifndef __WIN32__ #include <netinet/in.h> /* for host / network byte order conversions */ #endif +#ifdef __MINGW32__ +#include <stdint.h> +#else #include <sys/mman.h> +#endif #include <sys/stat.h> #include <time.h> #include <unistd.h> diff --git a/tools/os_support.c b/tools/os_support.c new file mode 100644 index 0000000..001fe64 --- /dev/null +++ b/tools/os_support.c @@ -0,0 +1,24 @@ +/* + * Copyright 2009 Extreme Engineering Solutions, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this software; if not, write to the + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * Include additional files required for supporting different operating systems + */ +#ifdef __MINGW32__ +#include "mingw_support.c" +#endif diff --git a/tools/os_support.h b/tools/os_support.h new file mode 100644 index 0000000..f6f86b0 --- /dev/null +++ b/tools/os_support.h @@ -0,0 +1,29 @@ +/* + * Copyright 2009 Extreme Engineering Solutions, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this software; if not, write to the + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __OS_SUPPORT_H_ +#define __OS_SUPPORT_H_ + +/* + * Include additional files required for supporting different operating systems + */ +#ifdef __MINGW32__ +#include "mingw_support.h" +#endif + +#endif /* __OS_SUPPORT_H_ */ diff --git a/tools/ubsha1.c b/tools/ubsha1.c index b37b2b7..c4203ed 100644 --- a/tools/ubsha1.c +++ b/tools/ubsha1.c @@ -21,13 +21,16 @@ * MA 02111-1307 USA */
+#include "os_support.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <string.h> +#ifndef __MINGW32__ #include <sys/mman.h> +#endif #include <sys/stat.h> #include "sha1.h"

Signed-off-by: Peter Tyser ptyser@xes-inc.com --- tools/Makefile.win32 | 37 ------------------------------------- 1 files changed, 0 insertions(+), 37 deletions(-) delete mode 100644 tools/Makefile.win32
diff --git a/tools/Makefile.win32 b/tools/Makefile.win32 deleted file mode 100644 index 69dc44c..0000000 --- a/tools/Makefile.win32 +++ /dev/null @@ -1,37 +0,0 @@ -# -# (C) Copyright 2001 -# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -# -# See file CREDITS for list of people who contributed to this -# project. -# -# 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; either version 2 of -# the License, or (at your option) any later version. -# -# 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., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# - -CPPFLAGS = -Wall -pedantic -I../include -I.. -D__WIN32__ -CFLAGS = $(CPPFLAGS) -O - -all: mkimage.exe - -mkimage.exe: mkimage.o crc32.o - $(CC) -g $(CFLAGS) -o $@ $^ - -crc32.o: crc32.c - $(CC) -g $(CFLAGS) -c $< - -mkimage.o: mkimage.c - $(CC) -g $(CFLAGS) -c $< -

Dear Peter Tyser,
In message 1236988492-21295-29-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile.win32 | 37 ------------------------------------- 1 files changed, 0 insertions(+), 37 deletions(-) delete mode 100644 tools/Makefile.win32
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-28-git-send-email-ptyser@xes-inc.com you wrote:
Add support for compiling the host tools in the tools directory using the MinGW toolchain. This produces executables which can be used on standard Windows computers without requiring cygwin.
One must specify the MinGW compiler and strip utilities as if they were the host toolchain in order to build win32 executables, eg:
make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools
Signed-off-by: Peter Tyser ptyser@xes-inc.com
README | 10 ++++++ include/image.h | 2 + include/libfdt_env.h | 12 +++++++ tools/Makefile | 23 ++++++++++---- tools/mingw_support.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/mingw_support.h | 51 +++++++++++++++++++++++++++++++ tools/mkimage.h | 5 +++ tools/os_support.c | 24 +++++++++++++++ tools/os_support.h | 29 ++++++++++++++++++ tools/ubsha1.c | 3 ++ 10 files changed, 231 insertions(+), 7 deletions(-) create mode 100644 tools/mingw_support.c create mode 100644 tools/mingw_support.h create mode 100644 tools/os_support.c create mode 100644 tools/os_support.h
I'm not happy about this os_support thingy, especially since it will always be compiled, even if not needed in 99.99% of the cases. Maybe you have a better idea and can send a cleanup-patch?
Added, thanks.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Sat, 2009-04-04 at 01:20 +0200, Wolfgang Denk wrote:
Dear Peter Tyser,
In message 1236988492-21295-28-git-send-email-ptyser@xes-inc.com you wrote:
Add support for compiling the host tools in the tools directory using the MinGW toolchain. This produces executables which can be used on standard Windows computers without requiring cygwin.
One must specify the MinGW compiler and strip utilities as if they were the host toolchain in order to build win32 executables, eg:
make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools
Signed-off-by: Peter Tyser ptyser@xes-inc.com
README | 10 ++++++ include/image.h | 2 + include/libfdt_env.h | 12 +++++++ tools/Makefile | 23 ++++++++++---- tools/mingw_support.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/mingw_support.h | 51 +++++++++++++++++++++++++++++++ tools/mkimage.h | 5 +++ tools/os_support.c | 24 +++++++++++++++ tools/os_support.h | 29 ++++++++++++++++++ tools/ubsha1.c | 3 ++ 10 files changed, 231 insertions(+), 7 deletions(-) create mode 100644 tools/mingw_support.c create mode 100644 tools/mingw_support.h create mode 100644 tools/os_support.c create mode 100644 tools/os_support.h
I'm not happy about this os_support thingy, especially since it will always be compiled, even if not needed in 99.99% of the cases. Maybe you have a better idea and can send a cleanup-patch?
The 2 options that come to mind are: 1. Keep the current method of unconditionally compiling os_support.c, which will in turn include any os-specific files.
2. Move the logic of determining which os-specific files are compiled into the Makefile. Something like:
ifneq (,$(findstring WIN32 ,$(shell $(HOSTCC) -E -dM -xc /dev/null))) SFX = .exe +OS_SUPPORT_FILES = mingw_support.c else SFX = +OS_SUPPORT_FILES = endif
and then replace references of "os_support.c" with "$(OS_SUPPORT_FILES). (Or something along those lines).
#1 is ugly in that 99.99% of the time an empty os_support.c file is processed.
#2 is ugly in that the Makefile method to determine a target OS is somewhat hokey and will only get hokier if/when additional OS targets are supported.
I'd vote for #1 as I think the wasted time of processing os_support.c is a drop in the bucket and it seems a bit cleaner than hacking up the Makefile.
If others have any clever ideas let me know.
Best, Peter

On Tuesday 14 April 2009 18:52:30 Peter Tyser wrote:
On Sat, 2009-04-04 at 01:20 +0200, Wolfgang Denk wrote:
In message Peter Tyser wrote:
Add support for compiling the host tools in the tools directory using the MinGW toolchain. This produces executables which can be used on standard Windows computers without requiring cygwin.
One must specify the MinGW compiler and strip utilities as if they were the host toolchain in order to build win32 executables, eg:
make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools
Signed-off-by: Peter Tyser ptyser@xes-inc.com
README | 10 ++++++ include/image.h | 2 + include/libfdt_env.h | 12 +++++++ tools/Makefile | 23 ++++++++++---- tools/mingw_support.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/mingw_support.h | 51 +++++++++++++++++++++++++++++++ tools/mkimage.h | 5 +++ tools/os_support.c | 24 +++++++++++++++ tools/os_support.h | 29 ++++++++++++++++++ tools/ubsha1.c | 3 ++ 10 files changed, 231 insertions(+), 7 deletions(-) create mode 100644 tools/mingw_support.c create mode 100644 tools/mingw_support.h create mode 100644 tools/os_support.c create mode 100644 tools/os_support.h
I'm not happy about this os_support thingy, especially since it will always be compiled, even if not needed in 99.99% of the cases. Maybe you have a better idea and can send a cleanup-patch?
The 2 options that come to mind are:
- Keep the current method of unconditionally compiling os_support.c,
which will in turn include any os-specific files.
- Move the logic of determining which os-specific files are compiled
into the Makefile. Something like:
ifneq (,$(findstring WIN32 ,$(shell $(HOSTCC) -E -dM -xc /dev/null))) SFX = .exe +OS_SUPPORT_FILES = mingw_support.c else SFX = +OS_SUPPORT_FILES = endif
and then replace references of "os_support.c" with "$(OS_SUPPORT_FILES). (Or something along those lines).
#1 is ugly in that 99.99% of the time an empty os_support.c file is processed.
#2 is ugly in that the Makefile method to determine a target OS is somewhat hokey and will only get hokier if/when additional OS targets are supported.
I'd vote for #1 as I think the wasted time of processing os_support.c is a drop in the bucket and it seems a bit cleaner than hacking up the Makefile.
If others have any clever ideas let me know.
i prefer #1 as well ... you covered the reasons fairly well, thanks -mike

Dear Peter Tyser,
In message 1239749550.24099.147.camel@localhost.localdomain you wrote: ...
#1 is ugly in that 99.99% of the time an empty os_support.c file is processed.
#2 is ugly in that the Makefile method to determine a target OS is somewhat hokey and will only get hokier if/when additional OS targets are supported.
I'd vote for #1 as I think the wasted time of processing os_support.c is a drop in the bucket and it seems a bit cleaner than hacking up the Makefile.
If others have any clever ideas let me know.
It seems there were no really clever ideas, or did I miss them?
Hm.. actually I lost track of which patch is missing. Could you please send me a pointer to the latest and greatest version? Sorry & thanks.
Best regards,
Wolfgang Denk

Hi Wolfgang,
#1 is ugly in that 99.99% of the time an empty os_support.c file is processed.
#2 is ugly in that the Makefile method to determine a target OS is somewhat hokey and will only get hokier if/when additional OS targets are supported.
I'd vote for #1 as I think the wasted time of processing os_support.c is a drop in the bucket and it seems a bit cleaner than hacking up the Makefile.
If others have any clever ideas let me know.
It seems there were no really clever ideas, or did I miss them?
Hm.. actually I lost track of which patch is missing. Could you please send me a pointer to the latest and greatest version? Sorry & thanks.
The original v3 of "Add support for building native win32 tools" has actually been merged already.
After merging the patch, you had requested a cleanup patch to which I responded with the patch's rationale as well as a possible (in my opinion) dirtier cleanup. No one else suggested a cleaner way to implement the change, so what is currently committed should be correct.
I'm still open to clever ideas if anyone has one though:)
Thanks, Peter

Dear Peter Tyser,
In message 1236988492-21295-27-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 17 +++++------------ 1 files changed, 5 insertions(+), 12 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-26-git-send-email-ptyser@xes-inc.com you wrote:
Create a few generic build rules to replace the current method which has 1 build target for each file
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 55 +++++++++---------------------------------------------- 1 files changed, 9 insertions(+), 46 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-25-git-send-email-ptyser@xes-inc.com you wrote:
Files in the SRCS variable have their dependencies automatically generated so remove duplicate explicit dependencies
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-24-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Makefile | 3 +-- tools/.gitignore | 5 ----- tools/Makefile | 44 +++++++++++++------------------------------- 3 files changed, 14 insertions(+), 38 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-23-git-send-email-ptyser@xes-inc.com you wrote:
Add the libfdt files to the SRCS variable so that they have their dependencies automatically generated
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-22-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Makefile | 3 +-- tools/.gitignore | 5 ----- tools/Makefile | 32 +++++++------------------------- 3 files changed, 8 insertions(+), 32 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-21-git-send-email-ptyser@xes-inc.com you wrote:
This change makes the process of symlinking libfdt_internal.h unnecessary
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Makefile | 2 +- tools/.gitignore | 1 - tools/Makefile | 15 ++++++--------- 3 files changed, 7 insertions(+), 11 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-20-git-send-email-ptyser@xes-inc.com you wrote:
crc32.c uses the zlib.h header in include/u-boot/zlib.h. The symlink was previously necessary to give U-Boot's version of zlib.h precedence over the host computer's version of zlib.h.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Makefile | 2 +- tools/.gitignore | 1 - tools/Makefile | 6 +----- 3 files changed, 2 insertions(+), 7 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-19-git-send-email-ptyser@xes-inc.com you wrote:
This change makes the process of symlinking mkimage.h and fdt_host.h unnecessary
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-18-git-send-email-ptyser@xes-inc.com you wrote:
Also conditionally add ncb.o to OBJ_FILES list
Signed-off-by: Peter Tyser ptyser@xes-inc.com
doc/README.NetConsole | 6 ++---- tools/Makefile | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-17-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-16-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-15-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-14-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-13-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-12-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-11-git-send-email-ptyser@xes-inc.com you wrote:
Split variable declarations into multiple lines and use the standard VAR-y convention. Also move object and binary variable declarations to after config.mk has been included to allow for these lists to utilize the CONFIG_XXX variables.
These changes lay the groundwork for conditional compilation of files in the tools directory.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 86 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 53 insertions(+), 33 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-10-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 153 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 77 insertions(+), 76 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-9-git-send-email-ptyser@xes-inc.com you wrote:
The values of HOSTARCH and HOSTOS which are exported from the top-level Makefile should be used
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/Makefile | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-8-git-send-email-ptyser@xes-inc.com you wrote:
Replace random()/srandom() use with rand()/srand() to support compilation with the mingw toolchain. The rand()/srand() functions are generally more common and are functionally equivalent to the original random()/srandom() calls.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
tools/gen_eth_addr.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-7-git-send-email-ptyser@xes-inc.com you wrote:
Some systems have bzlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/bzlib.h). Moving U-Boot's bzlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
board/mpl/common/common_util.c | 2 +- common/cmd_bootm.c | 2 +- include/{ => u-boot}/bzlib.h | 0 lib_generic/bzlib_private.h | 2 +- lib_m68k/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename include/{ => u-boot}/bzlib.h (100%)
Patch fails to apply. Please rebase and resubmit.
Best regards,
Wolfgang Denk

On Sat, 2009-04-04 at 01:09 +0200, Wolfgang Denk wrote:
Dear Peter Tyser,
In message 1236988492-21295-7-git-send-email-ptyser@xes-inc.com you wrote:
Some systems have bzlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/bzlib.h). Moving U-Boot's bzlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
board/mpl/common/common_util.c | 2 +- common/cmd_bootm.c | 2 +- include/{ => u-boot}/bzlib.h | 0 lib_generic/bzlib_private.h | 2 +- lib_m68k/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename include/{ => u-boot}/bzlib.h (100%)
Patch fails to apply. Please rebase and resubmit.
This should patch should apply cleanly now. It failed previously because patch 5/28 failed. Patch 5/28 was resubmitted as "rename include/zlib.h to include/u-boot/zlib.h" and has been accepted.
Would you like me to resumbit, or will you apply this patch?
Thanks, Peter

Dear Peter Tyser,
In message 1236988492-21295-6-git-send-email-ptyser@xes-inc.com you wrote:
Some systems have zlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/zlib.h). Moving U-Boot's zlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
common/cmd_bootm.c | 2 +- fs/cramfs/uncompress.c | 2 +- include/{ => u-boot}/zlib.h | 0 lib_arm/bootm.c | 2 +- lib_avr32/bootm.c | 2 +- lib_generic/crc32.c | 2 +- lib_generic/gunzip.c | 2 +- lib_generic/zlib.c | 2 +- lib_i386/bootm.c | 2 +- lib_m68k/bootm.c | 2 +- lib_microblaze/bootm.c | 2 +- lib_mips/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename include/{ => u-boot}/zlib.h (100%)
Patch fails to apply. Please rebase and resubmit.
Best regards,
Wolfgang Denk

On Sat, 2009-04-04 at 01:08 +0200, Wolfgang Denk wrote:
Dear Peter Tyser,
In message 1236988492-21295-6-git-send-email-ptyser@xes-inc.com you wrote:
Some systems have zlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/zlib.h). Moving U-Boot's zlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
common/cmd_bootm.c | 2 +- fs/cramfs/uncompress.c | 2 +- include/{ => u-boot}/zlib.h | 0 lib_arm/bootm.c | 2 +- lib_avr32/bootm.c | 2 +- lib_generic/crc32.c | 2 +- lib_generic/gunzip.c | 2 +- lib_generic/zlib.c | 2 +- lib_i386/bootm.c | 2 +- lib_m68k/bootm.c | 2 +- lib_microblaze/bootm.c | 2 +- lib_mips/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename include/{ => u-boot}/zlib.h (100%)
Patch fails to apply. Please rebase and resubmit.
Sorry for the slow reply, I've been out of the office this past week. It looks like Jean-Christophe re-submitted this as "PATCH 2/2 V2] rename include/zlib.h to include/u-boot/zlib.h" which has been accepted so I won't resumbit.
Jean-Christophe, thanks for rebasing/resending this. In the future it'd be nice if you kept the original signed-off-by around as your patch is pretty much just a rebased version of this one.
Best, Peter

On 16:50 Mon 13 Apr , Peter Tyser wrote:
On Sat, 2009-04-04 at 01:08 +0200, Wolfgang Denk wrote:
Dear Peter Tyser,
In message 1236988492-21295-6-git-send-email-ptyser@xes-inc.com you wrote:
Some systems have zlib.h installed in /usr/include/. This isn't the desired file (we want the one in include/zlib.h). Moving U-Boot's zlib.h to include/u-boot/ avoids this conflict.
Signed-off-by: Peter Tyser ptyser@xes-inc.com
common/cmd_bootm.c | 2 +- fs/cramfs/uncompress.c | 2 +- include/{ => u-boot}/zlib.h | 0 lib_arm/bootm.c | 2 +- lib_avr32/bootm.c | 2 +- lib_generic/crc32.c | 2 +- lib_generic/gunzip.c | 2 +- lib_generic/zlib.c | 2 +- lib_i386/bootm.c | 2 +- lib_m68k/bootm.c | 2 +- lib_microblaze/bootm.c | 2 +- lib_mips/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename include/{ => u-boot}/zlib.h (100%)
Patch fails to apply. Please rebase and resubmit.
Sorry for the slow reply, I've been out of the office this past week. It looks like Jean-Christophe re-submitted this as "PATCH 2/2 V2] rename include/zlib.h to include/u-boot/zlib.h" which has been accepted so I won't resumbit.
Jean-Christophe, thanks for rebasing/resending this. In the future it'd be nice if you kept the original signed-off-by around as your patch is pretty much just a rebased version of this one.
sure but I've not even read your patch series
I just wrote that patch to fix the current tree
Best Regards, J.

Dear Peter Tyser,
In message 1236988492-21295-5-git-send-email-ptyser@xes-inc.com you wrote:
The original code provided an incomplete set of typedefs for WIN32 compiles and replicated the standard typedefs that are already provided by stdint.h
Signed-off-by: Peter Tyser ptyser@xes-inc.com
include/elf.h | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-4-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
common/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-3-git-send-email-ptyser@xes-inc.com you wrote:
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Dear Peter Tyser,
In message 1236988492-21295-2-git-send-email-ptyser@xes-inc.com you wrote:
The original code did not generate autoconf.mk until after some targets dependencies had already been calculated, for example the directories in the SUBDIRS variable
Signed-off-by: Peter Tyser ptyser@xes-inc.com
Makefile | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

On Fri, Mar 13, 2009 at 06:54:24PM -0500, Peter Tyser wrote:
This patch series attempts to do 2 things:
- Add support for generating win32 versions of the tools in tools/
- Cleanup tools/Makefile somewhat
In the process of #1 I couldn't help but work on #2 a bit:) Let me know if people would prefer the patches split up.
<peeve type="pet"> It's easier to read patchsets, especially large ones, when each message is a reply to the original rather than to the preceding patch (which in many mailers makes the subjects appear shifted one character to the right compared to the parent post, eventually scrolling off the right edge of the screen). </peeve>
-Scott

On Tuesday 17 March 2009 13:21:05 Scott Wood wrote:
On Fri, Mar 13, 2009 at 06:54:24PM -0500, Peter Tyser wrote:
This patch series attempts to do 2 things:
- Add support for generating win32 versions of the tools in tools/
- Cleanup tools/Makefile somewhat
In the process of #1 I couldn't help but work on #2 a bit:) Let me know if people would prefer the patches split up.
<peeve type="pet"> It's easier to read patchsets, especially large ones, when each message is a reply to the original rather than to the preceding patch (which in many mailers makes the subjects appear shifted one character to the right compared to the parent post, eventually scrolling off the right edge of the screen). </peeve>
your mailer does just one char ? i should switch from kmail to whatever you're using :) ...
Peter: if you update to git-1.6.2 (well, maybe what i describe happens in earlier versions, but i know 1.6.2 is good), then you can use --cover-letter to `git format-patch` and `git send-email` will thread things the way Scott describes if you send all the patches together: `git send-email 0*.patch`.
the cover letter will be the thread starter and all the patches in the series will refer to that one rather than each N patch referring to N-1 in the series. -mike

On Tue, 2009-03-17 at 13:43 -0400, Mike Frysinger wrote:
On Tuesday 17 March 2009 13:21:05 Scott Wood wrote:
On Fri, Mar 13, 2009 at 06:54:24PM -0500, Peter Tyser wrote:
This patch series attempts to do 2 things:
- Add support for generating win32 versions of the tools in tools/
- Cleanup tools/Makefile somewhat
In the process of #1 I couldn't help but work on #2 a bit:) Let me know if people would prefer the patches split up.
<peeve type="pet"> It's easier to read patchsets, especially large ones, when each message is a reply to the original rather than to the preceding patch (which in many mailers makes the subjects appear shifted one character to the right compared to the parent post, eventually scrolling off the right edge of the screen). </peeve>
your mailer does just one char ? i should switch from kmail to whatever you're using :) ...
Peter: if you update to git-1.6.2 (well, maybe what i describe happens in earlier versions, but i know 1.6.2 is good), then you can use --cover-letter to `git format-patch` and `git send-email` will thread things the way Scott describes if you send all the patches together: `git send-email 0*.patch`.
the cover letter will be the thread starter and all the patches in the series will refer to that one rather than each N patch referring to N-1 in the series.
I see similar default threading styles in both 1.6.0 and 1.6.2. It looks like I was missing git send-email's "--no-chain-reply-to" argument. I added "sendmail.chainreplyto = false" to my .gitconfig which also does the trick.
It makes me wonder why --chain-reply-to would ever be the default...
Peter

On Tuesday 17 March 2009 16:59:39 Peter Tyser wrote:
On Tue, 2009-03-17 at 13:43 -0400, Mike Frysinger wrote:
On Tuesday 17 March 2009 13:21:05 Scott Wood wrote:
On Fri, Mar 13, 2009 at 06:54:24PM -0500, Peter Tyser wrote:
This patch series attempts to do 2 things:
- Add support for generating win32 versions of the tools in tools/
- Cleanup tools/Makefile somewhat
In the process of #1 I couldn't help but work on #2 a bit:) Let me know if people would prefer the patches split up.
<peeve type="pet"> It's easier to read patchsets, especially large ones, when each message is a reply to the original rather than to the preceding patch (which in many mailers makes the subjects appear shifted one character to the right compared to the parent post, eventually scrolling off the right edge of the screen). </peeve>
your mailer does just one char ? i should switch from kmail to whatever you're using :) ...
Peter: if you update to git-1.6.2 (well, maybe what i describe happens in earlier versions, but i know 1.6.2 is good), then you can use --cover-letter to `git format-patch` and `git send-email` will thread things the way Scott describes if you send all the patches together: `git send-email 0*.patch`.
the cover letter will be the thread starter and all the patches in the series will refer to that one rather than each N patch referring to N-1 in the series.
I see similar default threading styles in both 1.6.0 and 1.6.2. It looks like I was missing git send-email's "--no-chain-reply-to" argument. I added "sendmail.chainreplyto = false" to my .gitconfig which also does the trick.
It makes me wonder why --chain-reply-to would ever be the default...
i thought they changed that default in recent versions ... but i'd have to agree that the default chained to is stupid
btw, if we cant get the windows stuff completely sorted before the next merge, you should be able to get all the build and such cleanups which are not directly related merged ... then we can get back to picking over mingw :) -mike

Dear Peter Tyser,
In message 1236988492-21295-1-git-send-email-ptyser@xes-inc.com you wrote:
This patch series attempts to do 2 things:
- Add support for generating win32 versions of the tools in tools/
- Cleanup tools/Makefile somewhat
Ouch. I missed that there were updated versions of this patch stack. Rewound everything and will start applying v3 seris now.
Sorry for the confusion.
Best regards,
Wolfgang Denk
participants (5)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Mike Frysinger
-
Peter Tyser
-
Scott Wood
-
Wolfgang Denk