diff mbox

[U-Boot,v2,3/3] Makefile: cosmetic: optimize usage of LIBS-y

Message ID 1342741198-9105-1-git-send-email-daniel.schwierzeck@gmail.com
State Accepted
Commit 8b5a02640adf77301f943e8754992c50df004e8a
Delegated to: Wolfgang Denk
Headers show

Commit Message

Daniel Schwierzeck July 19, 2012, 11:39 p.m. UTC
From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

---
Changes for v2:
- optimized HAVE_VENDOR_COMMON_LIB macro as suggested by Mike
- optimized HAVE_VENDOR_COMMON_LIB macro also in spl/Makefile
---
 Makefile     | 17 ++++++-----------
 spl/Makefile |  3 +--
 2 files changed, 7 insertions(+), 13 deletions(-)

Comments

Wolfgang Denk Aug. 10, 2012, 9:17 p.m. UTC | #1
Dear daniel.schwierzeck@gmail.com,

In message <1342741198-9105-1-git-send-email-daniel.schwierzeck@gmail.com> you wrote:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> ---
> Changes for v2:
> - optimized HAVE_VENDOR_COMMON_LIB macro as suggested by Mike
> - optimized HAVE_VENDOR_COMMON_LIB macro also in spl/Makefile
> ---
>  Makefile     | 17 ++++++-----------
>  spl/Makefile |  3 +--
>  2 files changed, 7 insertions(+), 13 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
Kumar Gala Aug. 14, 2012, 1:52 p.m. UTC | #2
On Aug 10, 2012, at 4:17 PM, Wolfgang Denk wrote:

> Dear daniel.schwierzeck@gmail.com,
> 
> In message <1342741198-9105-1-git-send-email-daniel.schwierzeck@gmail.com> you wrote:
>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>> 
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>> 
>> ---
>> Changes for v2:
>> - optimized HAVE_VENDOR_COMMON_LIB macro as suggested by Mike
>> - optimized HAVE_VENDOR_COMMON_LIB macro also in spl/Makefile
>> ---
>> Makefile     | 17 ++++++-----------
>> spl/Makefile |  3 +--
>> 2 files changed, 7 insertions(+), 13 deletions(-)
> 
> Applied, thanks.
> 
> Best regards,
> 
> Wolfgang Denk

I spoke too soon, this patch is causing build issues on P4080DS_config:

[galak@right u-boot]$ make -j40 -s
arch/powerpc/cpu/mpc85xx/libmpc85xx.o: In function `ft_cpu_setup':
/local/home/galak/git/u-boot/arch/powerpc/cpu/mpc85xx/fdt.c:614: undefined reference to `get_board_sys_clk'
arch/powerpc/cpu/mpc85xx/libmpc85xx.o: In function `get_sys_info':
/local/home/galak/git/u-boot/arch/powerpc/cpu/mpc85xx/speed.c:77: undefined reference to `get_board_sys_clk'
arch/powerpc/cpu/mpc85xx/libmpc85xx.o:(.got2+0x344): undefined reference to `tlb_table'
arch/powerpc/cpu/mpc85xx/libmpc85xx.o:(.got2+0x348): undefined reference to `num_tlb_entries'
arch/powerpc/lib/libpowerpc.o: In function `board_init_r':
/local/home/galak/git/u-boot/arch/powerpc/lib/board.c:850: undefined reference to `mac_read_from_eeprom'
common/libcommon.o:(.u_boot_cmd+0x370): undefined reference to `do_mac'
drivers/misc/libmisc.o:(.got2+0x14): undefined reference to `law_table'
drivers/misc/libmisc.o:(.got2+0x18): undefined reference to `num_law_entries'
drivers/pci/libpci.o: In function `pci_init':
/local/home/galak/git/u-boot/drivers/pci/pci.c:731: undefined reference to `pci_init_board'
board/freescale/corenet_ds/libcorenet_ds.o: In function `ft_board_setup':
/local/home/galak/git/u-boot/board/freescale/corenet_ds/corenet_ds.c:231: undefined reference to `pci_of_setup'
board/freescale/corenet_ds/libcorenet_ds.o: In function `board_ft_fman_fixup_port':
/local/home/galak/git/u-boot/board/freescale/corenet_ds/eth_p4080.c:230: undefined reference to `fdt_set_phy_handle'
/local/home/galak/git/u-boot/board/freescale/corenet_ds/eth_p4080.c:238: undefined reference to `fdt_set_phy_handle'
make: *** [u-boot] Error 1
[galak@right u-boot]$ 

- k
Kumar Gala Aug. 14, 2012, 9:34 p.m. UTC | #3
On Aug 14, 2012, at 8:52 AM, Kumar Gala wrote:

> 
> On Aug 10, 2012, at 4:17 PM, Wolfgang Denk wrote:
> 
>> Dear daniel.schwierzeck@gmail.com,
>> 
>> In message <1342741198-9105-1-git-send-email-daniel.schwierzeck@gmail.com> you wrote:
>>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>> 
>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>> 
>>> ---
>>> Changes for v2:
>>> - optimized HAVE_VENDOR_COMMON_LIB macro as suggested by Mike
>>> - optimized HAVE_VENDOR_COMMON_LIB macro also in spl/Makefile
>>> ---
>>> Makefile     | 17 ++++++-----------
>>> spl/Makefile |  3 +--
>>> 2 files changed, 7 insertions(+), 13 deletions(-)
>> 
>> Applied, thanks.
>> 
>> Best regards,
>> 
>> Wolfgang Denk
> 
> I spoke too soon, this patch is causing build issues on P4080DS_config:
> 
> [galak@right u-boot]$ make -j40 -s
> arch/powerpc/cpu/mpc85xx/libmpc85xx.o: In function `ft_cpu_setup':
> /local/home/galak/git/u-boot/arch/powerpc/cpu/mpc85xx/fdt.c:614: undefined reference to `get_board_sys_clk'
> arch/powerpc/cpu/mpc85xx/libmpc85xx.o: In function `get_sys_info':
> /local/home/galak/git/u-boot/arch/powerpc/cpu/mpc85xx/speed.c:77: undefined reference to `get_board_sys_clk'
> arch/powerpc/cpu/mpc85xx/libmpc85xx.o:(.got2+0x344): undefined reference to `tlb_table'
> arch/powerpc/cpu/mpc85xx/libmpc85xx.o:(.got2+0x348): undefined reference to `num_tlb_entries'
> arch/powerpc/lib/libpowerpc.o: In function `board_init_r':
> /local/home/galak/git/u-boot/arch/powerpc/lib/board.c:850: undefined reference to `mac_read_from_eeprom'
> common/libcommon.o:(.u_boot_cmd+0x370): undefined reference to `do_mac'
> drivers/misc/libmisc.o:(.got2+0x14): undefined reference to `law_table'
> drivers/misc/libmisc.o:(.got2+0x18): undefined reference to `num_law_entries'
> drivers/pci/libpci.o: In function `pci_init':
> /local/home/galak/git/u-boot/drivers/pci/pci.c:731: undefined reference to `pci_init_board'
> board/freescale/corenet_ds/libcorenet_ds.o: In function `ft_board_setup':
> /local/home/galak/git/u-boot/board/freescale/corenet_ds/corenet_ds.c:231: undefined reference to `pci_of_setup'
> board/freescale/corenet_ds/libcorenet_ds.o: In function `board_ft_fman_fixup_port':
> /local/home/galak/git/u-boot/board/freescale/corenet_ds/eth_p4080.c:230: undefined reference to `fdt_set_phy_handle'
> /local/home/galak/git/u-boot/board/freescale/corenet_ds/eth_p4080.c:238: undefined reference to `fdt_set_phy_handle'
> make: *** [u-boot] Error 1
> [galak@right u-boot]$ 
> 
> - k

This is fixed by:

http://patchwork.ozlabs.org/patch/177235/

- k
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 7d23954..a6c4ae4 100644
--- a/Makefile
+++ b/Makefile
@@ -225,15 +225,14 @@  endif
 
 OBJS := $(addprefix $(obj),$(OBJS))
 
+HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile), y, n)
+
 LIBS-y += lib/libgeneric.o
 LIBS-y += lib/lzma/liblzma.o
 LIBS-y += lib/lzo/liblzo.o
 LIBS-y += lib/zlib/libz.o
-ifeq ($(CONFIG_TIZEN),y)
-LIBS-y += lib/tizen/libtizen.o
-endif
-LIBS-y += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
-	"board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
+LIBS-$(CONFIG_TIZEN) += lib/tizen/libtizen.o
+LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
 LIBS-y += $(CPUDIR)/lib$(CPU).o
 ifdef SOC
 LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
@@ -241,9 +240,7 @@  endif
 ifeq ($(CPU),ixp)
 LIBS-y += arch/arm/cpu/ixp/npe/libnpe.o
 endif
-ifeq ($(CONFIG_OF_EMBED),y)
-LIBS-y += dts/libdts.o
-endif
+LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
 LIBS-y += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \
 	fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \
@@ -288,9 +285,7 @@  LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
 LIBS-y += drivers/rtc/librtc.o
 LIBS-y += drivers/serial/libserial.o
-ifeq ($(CONFIG_GENERIC_LPC_TPM),y)
-LIBS-y += drivers/tpm/libtpm.o
-endif
+LIBS-$(CONFIG_GENERIC_LPC_TPM) += drivers/tpm/libtpm.o
 LIBS-y += drivers/twserial/libtws.o
 LIBS-y += drivers/usb/eth/libusb_eth.o
 LIBS-y += drivers/usb/gadget/libusb_gadget.o
diff --git a/spl/Makefile b/spl/Makefile
index ea7d475..e9ecb9b 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -23,8 +23,7 @@  include $(TOPDIR)/config.mk
 # We want the final binaries in this directory
 obj := $(OBJTREE)/spl/
 
-HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
-			&& echo y || echo n)
+HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile), y, n)
 
 ifdef	CONFIG_SPL_START_S_PATH
 START_PATH := $(subst ",,$(CONFIG_SPL_START_S_PATH))