From patchwork Fri Jun 6 11:46:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 356790 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5ACA51400D2 for ; Fri, 6 Jun 2014 21:47:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8BEE4B74E; Fri, 6 Jun 2014 13:47:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 56ENvA0KcNcf; Fri, 6 Jun 2014 13:47:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E8954B746; Fri, 6 Jun 2014 13:47:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 570934B737 for ; Fri, 6 Jun 2014 13:47:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6U50OlL70GYs for ; Fri, 6 Jun 2014 13:47:01 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 4E4BC4B735 for ; Fri, 6 Jun 2014 13:46:57 +0200 (CEST) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile11) with ESMTP id s56BkrKZ009695; Fri, 6 Jun 2014 20:46:53 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili16) with ESMTP id s56BkrM27575; Fri, 6 Jun 2014 20:46:53 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi11) id s56BkrO4000681; Fri, 6 Jun 2014 20:46:53 +0900 Received: from poodle by lomi11.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s56BkrR6000643; Fri, 6 Jun 2014 20:46:53 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 5FC232740043; Fri, 6 Jun 2014 20:46:53 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 6 Jun 2014 20:46:44 +0900 Message-Id: <1402055205-25604-2-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1402055205-25604-1-git-send-email-yamada.m@jp.panasonic.com> References: <1402055205-25604-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Tom Rini , Vasili Galka Subject: [U-Boot] [PATCH 1/2] kbuild: remove unnecessary adjustment for Cygwin X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de "SFX = .exe" was originally added for Cygwin environment. It is true that GCC on Cygwin spits executables with .exe extention. For example, gcc -o foo foo.c will generate "foo.exe", not "foo". But GNU make is also nicely adjusted for Cygwin. For example, foo: foo.c gcc -o $@ $< will compare the timestamp between "foo.exe" and "foo.c". You do not have to tweak Makefiles like this: foo$(SFX): foo.c gcc -o $@ $< And "make clean" works as well without adjustment for Cygwin because the command "rm foo" on Cygwin will delete both "foo" and "foo.exe". In conclusion, makefiles do not need special care for Cygwin. Signed-off-by: Masahiro Yamada --- I tested this patch on the following environment. $ uname -a CYGWIN_NT-6.1 yamada-win7 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.8.3/lto-wrapper.exe Target: i686-pc-cygwin Configured with: /cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-1/src/gcc-4.8.3/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-1/src/gcc-4.8.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --disable-__cxa_atexit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --libexecdir=/usr/lib Thread model: posix gcc version 4.8.3 (GCC) $ make -v GNU Make 4.0 Built for i686-pc-cygwin Copyright (C) 1988-2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. tools/Makefile | 89 ++++++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 09ac3bb..5235539 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -5,15 +5,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -# -# toolchains targeting win32 generate .exe files -# -ifneq (,$(findstring WIN32 ,$(shell $(HOSTCC) -E -dM -xc /dev/null))) -SFX = .exe -else -SFX = -endif - # Enable all the config-independent tools ifneq ($(HOST_TOOLS_ALL),) CONFIG_LCD_LOGO = y @@ -38,31 +29,31 @@ ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y) -hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params$(SFX) +hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params # TODO: CONFIG_CMD_LICENSE does not work -hostprogs-$(CONFIG_CMD_LICENSE) += bin2header$(SFX) -hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX) -hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX) -HOSTCFLAGS_bmp_logo$(SFX).o := -pedantic +hostprogs-$(CONFIG_CMD_LICENSE) += bin2header +hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo +hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo +HOSTCFLAGS_bmp_logo.o := -pedantic -hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX) -envcrc$(SFX)-objs := envcrc.o lib/crc32.o common/env_embedded.o lib/sha1.o +hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc +envcrc-objs := envcrc.o lib/crc32.o common/env_embedded.o lib/sha1.o -hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX) -HOSTCFLAGS_gen_eth_addr$(SFX).o := -pedantic +hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr +HOSTCFLAGS_gen_eth_addr.o := -pedantic -hostprogs-$(CONFIG_CMD_LOADS) += img2srec$(SFX) -HOSTCFLAGS_img2srec$(SFX).o := -pedantic +hostprogs-$(CONFIG_CMD_LOADS) += img2srec +HOSTCFLAGS_img2srec.o := -pedantic -hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX) -HOSTCFLAGS_xway-swap-bytes$(SFX).o := -pedantic +hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes +HOSTCFLAGS_xway-swap-bytes.o := -pedantic -hostprogs-y += mkenvimage$(SFX) -mkenvimage$(SFX)-objs := mkenvimage.o os_support.o lib/crc32.o +hostprogs-y += mkenvimage +mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o -hostprogs-y += dumpimage$(SFX) mkimage$(SFX) -hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info$(SFX) fit_check_sign$(SFX) +hostprogs-y += dumpimage mkimage +hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o # Flattened device tree objects @@ -100,10 +91,10 @@ dumpimage-mkimage-objs := aisimage.o \ $(LIBFDT_OBJS) \ $(RSA_OBJS-y) -dumpimage$(SFX)-objs := $(dumpimage-mkimage-objs) dumpimage.o -mkimage$(SFX)-objs := $(dumpimage-mkimage-objs) mkimage.o -fit_info$(SFX)-objs := $(dumpimage-mkimage-objs) fit_info.o -fit_check_sign$(SFX)-objs := $(dumpimage-mkimage-objs) fit_check_sign.o +dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o +mkimage-objs := $(dumpimage-mkimage-objs) mkimage.o +fit_info-objs := $(dumpimage-mkimage-objs) fit_info.o +fit_check_sign-objs := $(dumpimage-mkimage-objs) fit_check_sign.o # TODO(sjg@chromium.org): Is this correct on Mac OS? @@ -121,33 +112,33 @@ endif # MXSImage needs LibSSL ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_FIT_SIGNATURE),) -HOSTLOADLIBES_mkimage$(SFX) += -lssl -lcrypto +HOSTLOADLIBES_mkimage += -lssl -lcrypto endif -HOSTLOADLIBES_dumpimage$(SFX) := $(HOSTLOADLIBES_mkimage$(SFX)) -HOSTLOADLIBES_fit_info$(SFX) := $(HOSTLOADLIBES_mkimage$(SFX)) -HOSTLOADLIBES_fit_check_sign$(SFX) := $(HOSTLOADLIBES_mkimage$(SFX)) +HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage) +HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage) +HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage) -hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl$(SFX) -hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl$(SFX) -HOSTCFLAGS_mkexynosspl$(SFX).o := -pedantic +hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl +hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl +HOSTCFLAGS_mkexynosspl.o := -pedantic -hostprogs-$(CONFIG_MX23) += mxsboot$(SFX) -hostprogs-$(CONFIG_MX28) += mxsboot$(SFX) -HOSTCFLAGS_mxsboot$(SFX).o := -pedantic +hostprogs-$(CONFIG_MX23) += mxsboot +hostprogs-$(CONFIG_MX28) += mxsboot +HOSTCFLAGS_mxsboot.o := -pedantic -hostprogs-$(CONFIG_SUNXI) += mksunxiboot$(SFX) +hostprogs-$(CONFIG_SUNXI) += mksunxiboot -hostprogs-$(CONFIG_NETCONSOLE) += ncb$(SFX) -hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) +hostprogs-$(CONFIG_NETCONSOLE) += ncb +hostprogs-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1 -ubsha1$(SFX)-objs := os_support.o ubsha1.o lib/sha1.o +ubsha1-objs := os_support.o ubsha1.o lib/sha1.o HOSTCFLAGS_ubsha1.o := -pedantic -hostprogs-$(CONFIG_KIRKWOOD) += kwboot$(SFX) -hostprogs-y += proftool$(SFX) -hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela$(SFX) +hostprogs-$(CONFIG_KIRKWOOD) += kwboot +hostprogs-y += proftool +hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela # We build some files with extra pedantic flags to try to minimize things # that won't build on some weird host compiler -- though there are lots of @@ -158,8 +149,8 @@ HOSTCFLAGS_sha1.o := -pedantic HOSTCFLAGS_sha256.o := -pedantic # Don't build by default -#hostprogs-$(CONFIG_PPC) += mpc86x_clk$(SFX) -#HOSTCFLAGS_mpc86x_clk$(SFX).o := -pedantic +#hostprogs-$(CONFIG_PPC) += mpc86x_clk +#HOSTCFLAGS_mpc86x_clk.o := -pedantic quiet_cmd_wrap = WRAP $@ cmd_wrap = echo "\#include <$(srctree)/$(patsubst $(obj)/%,%,$@)>" >$@