[U-Boot] [RFC PATCH 3/7] Tidy up Makefiles to use COBJS consistently

Simon Glass sjg at chromium.org
Mon May 13 04:25:36 CEST 2013


Some Makefiles doen't define COBJS, but just use COBJS-y directly. This
messes with our Kconfig script which uses COBJS to decide which objects
are needed.

Also, for directories where COBJS produces an empty list, COBJS- must be
defined and non-empty, otherwise Kconfig will not create the empty
built-in.o file and the link will fail. So adjust things such that
COBJS- is defined when needed.

Finally, Kconfig needs to know about subdirectories with the obj-y
variable, so add these as needed.

All of the above changes should have no effect on the existing U-Boot
build system.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 arch/arm/Makefile                      | 20 +++++++++++++++
 arch/arm/cpu/Makefile                  | 23 +++++++++++++++++
 arch/arm/cpu/armv7/Makefile            | 11 +++++---
 arch/arm/cpu/armv7/s5p-common/Makefile |  3 ++-
 arch/arm/cpu/tegra-common/Makefile     |  5 ++--
 arch/arm/cpu/tegra20-common/Makefile   |  5 ++--
 arch/arm/lib/Makefile                  |  6 +++--
 arch/sandbox/Makefile                  | 20 +++++++++++++++
 arch/sandbox/cpu/Makefile              |  2 ++
 arch/sandbox/lib/Makefile              |  4 +++
 arch/x86/Makefile                      | 24 +++++++++++++++++
 doc/Makefile                           | 20 +++++++++++++++
 drivers/Makefile                       | 47 ++++++++++++++++++++++++++++++++++
 drivers/bios_emulator/Makefile         |  4 +++
 drivers/bootcount/Makefile             |  2 +-
 drivers/fpga/Makefile                  |  2 +-
 drivers/gpio/Makefile                  |  1 -
 drivers/mtd/Makefile                   |  2 ++
 drivers/mtd/nand/Makefile              | 21 +++++++--------
 drivers/mtd/ubi/Makefile               | 10 +++-----
 drivers/power/Makefile                 |  2 ++
 drivers/usb/Makefile                   | 26 +++++++++++++++++++
 drivers/usb/gadget/Makefile            |  4 +--
 drivers/usb/musb-new/Makefile          |  4 +++
 fs/Makefile                            |  4 +++
 fs/ext4/Makefile                       |  5 ++--
 fs/fat/Makefile                        |  5 ++--
 fs/sandbox/Makefile                    |  5 ++--
 lib/Makefile                           |  3 +++
 29 files changed, 251 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm/Makefile
 create mode 100644 arch/arm/cpu/Makefile
 create mode 100644 arch/sandbox/Makefile
 create mode 100644 arch/x86/Makefile
 create mode 100644 doc/Makefile
 create mode 100644 drivers/Makefile
 create mode 100644 drivers/usb/Makefile

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
new file mode 100644
index 0000000..bb9b8fd
--- /dev/null
+++ b/arch/arm/Makefile
@@ -0,0 +1,20 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+obj-y += cpu/ lib/
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
new file mode 100644
index 0000000..2774a96
--- /dev/null
+++ b/arch/arm/cpu/Makefile
@@ -0,0 +1,23 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+obj-y += $(CPU)/
+
+obj-$(CONFIG_TEGRA) += tegra-common/
+obj-$(CONFIG_TEGRA) += $(SOC)-common/
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 7a8c2d0..734a662 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -25,7 +25,12 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(CPU).o
 
-START	:= start.o
+obj-y	+= $(SOC)/
+ifeq ($(SOC),exynos)
+obj-y	+= s5p-common/
+endif
+
+STARTOBJS	:= start.o
 
 COBJS	+= cache_v7.o
 
@@ -36,9 +41,9 @@ ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONF
 SOBJS	+= lowlevel_init.o
 endif
 
-SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
+SRCS	:= $(STARTOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
+START	:= $(addprefix $(obj),$(STARTOBJS))
 
 all:	$(obj).depend $(START) $(LIB)
 
diff --git a/arch/arm/cpu/armv7/s5p-common/Makefile b/arch/arm/cpu/armv7/s5p-common/Makefile
index 1705399..3b2b0c2 100644
--- a/arch/arm/cpu/armv7/s5p-common/Makefile
+++ b/arch/arm/cpu/armv7/s5p-common/Makefile
@@ -30,8 +30,9 @@ COBJS-y		+= timer.o
 COBJS-y		+= sromc.o
 COBJS-$(CONFIG_PWM)	+= pwm.o
 
+COBJS	:= $(COBJS-y)
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y) $(SOBJS))
+OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
 
 all:	 $(obj).depend $(LIB)
 
diff --git a/arch/arm/cpu/tegra-common/Makefile b/arch/arm/cpu/tegra-common/Makefile
index 4e0301c..d5282b9 100644
--- a/arch/arm/cpu/tegra-common/Makefile
+++ b/arch/arm/cpu/tegra-common/Makefile
@@ -30,8 +30,9 @@ LIB	= $(obj)libcputegra-common.o
 SOBJS += lowlevel_init.o
 COBJS-y	+= ap.o board.o sys_info.o timer.o clock.o cache.o
 
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+COBJS	:= $(COBJS-y)
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
 
 all:	$(obj).depend $(LIB)
 
diff --git a/arch/arm/cpu/tegra20-common/Makefile b/arch/arm/cpu/tegra20-common/Makefile
index 8184e5e..8153cd8 100644
--- a/arch/arm/cpu/tegra20-common/Makefile
+++ b/arch/arm/cpu/tegra20-common/Makefile
@@ -36,8 +36,9 @@ COBJS-$(CONFIG_TEGRA_LP0) += warmboot.o crypto.o warmboot_avp.o
 COBJS-$(CONFIG_TEGRA_CLOCK_SCALING) += emc.o
 COBJS-$(CONFIG_TEGRA_PMU) += pmu.o
 
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+COBJS	:= $(COBJS-y)
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
 
 all:	$(obj).depend $(LIB)
 
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 6ae161a..5f13591 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -58,9 +58,11 @@ COBJS-y	+= reset.o
 COBJS-y	+= cache.o
 COBJS-y	+= cache-cp15.o
 
+COBJS	:= $(COBJS-y)
+SOBJS	:= $(SOBJS-y)
 SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
-	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
+	   $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
 LGOBJS	:= $(addprefix $(obj),$(GLSOBJS)) \
 	   $(addprefix $(obj),$(GLCOBJS))
 
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
new file mode 100644
index 0000000..bb9b8fd
--- /dev/null
+++ b/arch/sandbox/Makefile
@@ -0,0 +1,20 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+obj-y += cpu/ lib/
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index 6fd09ff..5f6d798 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -25,6 +25,8 @@
 
 include $(TOPDIR)/config.mk
 
+CFLAGS_REMOVE_os.o = -nostdinc
+
 LIB	= $(obj)lib$(CPU).o
 
 COBJS	:= cpu.o os.o start.o state.o
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index 3aad574..807990d 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -32,6 +32,10 @@ COBJS-y	+= interrupts.o
 SRCS	:= $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y))
 
+COBJS-y	+= interrupts.o
+
+COBJS := $(COBJS-y)
+
 # Always build libsandbox.o
 TARGETS	:= $(LIB)
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
new file mode 100644
index 0000000..59250ce
--- /dev/null
+++ b/arch/x86/Makefile
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+extra-y := $(head-y) vmlinux.lds
+
+obj-y                          := x86.o
+
+core-y += arch/x86/
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..851a0ff
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,20 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+# This is currently empty, but required by the Kbuild makefile
diff --git a/drivers/Makefile b/drivers/Makefile
new file mode 100644
index 0000000..0e9b3b7
--- /dev/null
+++ b/drivers/Makefile
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+obj-y += bios_emulator/
+obj-y += block/
+obj-y += bootcount/
+obj-y += crypto/
+obj-y += dfu/
+obj-y += dma/
+obj-y += fpga/
+obj-y += gpio/
+obj-y += hwmon/
+obj-y += i2c/
+obj-y += input/
+obj-y += misc/
+obj-y += mmc/
+obj-y += mtd/
+obj-y += net/
+obj-y += pci/
+obj-y += pcmcia/
+obj-y += power/
+obj-y += qe/
+obj-y += rtc/
+obj-y += serial/
+obj-y += sound/
+obj-y += spi/
+obj-y += tpm/
+obj-y += twserial/
+obj-y += usb/
+obj-y += video/
+obj-y += watchdog/
diff --git a/drivers/bios_emulator/Makefile b/drivers/bios_emulator/Makefile
index d94a144..5a9ad70 100644
--- a/drivers/bios_emulator/Makefile
+++ b/drivers/bios_emulator/Makefile
@@ -21,9 +21,13 @@ OBJS	:= $(addprefix $(obj),$(COBJS))
 EXTRA_CFLAGS += -I. -I./include -I$(TOPDIR)/include \
 	-D__PPC__  -D__BIG_ENDIAN__
 
+ifeq ($(KCONFIG_CONFIG),)
 CFLAGS += $(EXTRA_CFLAGS)
 HOSTCFLAGS += $(EXTRA_CFLAGS)
 CPPFLAGS += $(EXTRA_CFLAGS)
+else
+ccflags-y += $(EXTRA_CFLAGS)
+endif
 
 all:	$(LIB)
 
diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
index a8d0ac7..3e66271 100644
--- a/drivers/bootcount/Makefile
+++ b/drivers/bootcount/Makefile
@@ -22,7 +22,7 @@ include $(TOPDIR)/config.mk
 
 LIB 	:= $(obj)libbootcount.o
 
-COBJS-y				+= bootcount.o
+COBJS-$(CONFIG_BOOTCOUNT_LIMIT)	+= bootcount.o
 COBJS-$(CONFIG_AT91SAM9XE)	+= bootcount_at91.o
 COBJS-$(CONFIG_BLACKFIN)	+= bootcount_blackfin.o
 COBJS-$(CONFIG_SOC_DA8XX)	+= bootcount_davinci.o
diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile
index b48f623..f4249f3 100644
--- a/drivers/fpga/Makefile
+++ b/drivers/fpga/Makefile
@@ -25,8 +25,8 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libfpga.o
 
+COBJS-$(CONFIG_FPGA) += fpga.o
 ifdef CONFIG_FPGA
-COBJS-y += fpga.o
 COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
 COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
 COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 830e8e6..9df1e26 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -47,7 +47,6 @@ COBJS-$(CONFIG_OMAP_GPIO)	+= omap_gpio.o
 COBJS-$(CONFIG_DB8500_GPIO)	+= db8500_gpio.o
 COBJS-$(CONFIG_BCM2835_GPIO)	+= bcm2835_gpio.o
 COBJS-$(CONFIG_S3C2440_GPIO)	+= s3c2440_gpio.o
-COBJS-$(CONFIG_XILINX_GPIO)	+= xilinx_gpio.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 543c845..5bc7b8b 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -25,6 +25,8 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmtd.o
 
+obj-y += spi/ nand/ onenand/ ubi/
+
 COBJS-$(CONFIG_MTD_DEVICE) += mtdcore.o
 COBJS-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
 COBJS-$(CONFIG_MTD_CONCAT) += mtdconcat.o
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 35769c5..9fbba43 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -25,12 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libnand.o
 
-ifdef CONFIG_CMD_NAND
-
 ifdef CONFIG_SPL_BUILD
 
 ifdef CONFIG_SPL_NAND_DRIVERS
-NORMAL_DRIVERS=y
+NORMAL_DRIVERS=$(CONFIG_CMD_NAND)
 endif
 
 COBJS-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o
@@ -41,18 +39,18 @@ COBJS-$(CONFIG_SPL_NAND_BASE) += nand_base.o
 
 else # not spl
 
-NORMAL_DRIVERS=y
+NORMAL_DRIVERS=$(CONFIG_CMD_NAND)
 
-COBJS-y += nand.o
-COBJS-y += nand_bbt.o
-COBJS-y += nand_ids.o
-COBJS-y += nand_util.o
-COBJS-y += nand_ecc.o
-COBJS-y += nand_base.o
+COBJS-$(CONFIG_CMD_NAND) += nand.o
+COBJS-$(CONFIG_CMD_NAND) += nand_bbt.o
+COBJS-$(CONFIG_CMD_NAND) += nand_ids.o
+COBJS-$(CONFIG_CMD_NAND) += nand_util.o
+COBJS-$(CONFIG_CMD_NAND) += nand_ecc.o
+COBJS-$(CONFIG_CMD_NAND) += nand_base.o
 
 endif # not spl
 
-ifdef NORMAL_DRIVERS
+ifeq ($NORMAL_DRIVERS),y)
 
 COBJS-$(CONFIG_NAND_ECC_BCH) += nand_bch.o
 
@@ -84,7 +82,6 @@ COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_spl.o
 COBJS-$(CONFIG_NAND_MXC) += mxc_nand_spl.o
 
 endif # drivers
-endif # nand
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/mtd/ubi/Makefile b/drivers/mtd/ubi/Makefile
index b2e6014..ba338af 100644
--- a/drivers/mtd/ubi/Makefile
+++ b/drivers/mtd/ubi/Makefile
@@ -25,12 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB 	:= $(obj)libubi.o
 
-ifdef CONFIG_CMD_UBI
-COBJS-y += build.o vtbl.o vmt.o upd.o kapi.o eba.o io.o wl.o scan.o crc32.o
-
-COBJS-y += misc.o
-COBJS-y += debug.o
-endif
+COBJS-$(CONFIG_CMD_UBI) += build.o vtbl.o vmt.o upd.o kapi.o eba.o
+COBJS-$(CONFIG_CMD_UBI) += io.o wl.o scan.o crc32.o
+COBJS-$(CONFIG_CMD_UBI) += misc.o
+COBJS-$(CONFIG_CMD_UBI) += debug.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 1dac16a..d5c50b4 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -25,6 +25,8 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libpower.o
 
+obj-y	+= battery/ fuel_gauge/ pmic/
+
 COBJS-$(CONFIG_EXYNOS_TMU)	+= exynos-tmu.o
 COBJS-$(CONFIG_FTPMU010_POWER)	+= ftpmu010.o
 COBJS-$(CONFIG_TPS6586X_POWER)	+= tps6586x.o
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
new file mode 100644
index 0000000..dfbe8eb
--- /dev/null
+++ b/drivers/usb/Makefile
@@ -0,0 +1,26 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# 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 Foundatio; 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
+#
+
+obj-y += eth/
+obj-y += gadget/
+obj-y += host/
+obj-y += musb/
+obj-y += musb-new/
+obj-y += phy/
+obj-y += ulpi/
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index e545b6b..b6a5b07 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -45,9 +45,9 @@ COBJS-$(CONFIG_MV_UDC)	+= mv_udc.o
 COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
 else
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
+COBJS-$(CONFIG_USB_DEVICE) += core.o
+COBJS-$(CONFIG_USB_DEVICE) += ep0.o
 ifdef CONFIG_USB_DEVICE
-COBJS-y += core.o
-COBJS-y += ep0.o
 COBJS-$(CONFIG_DW_UDC) += designware_udc.o
 COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
 COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
diff --git a/drivers/usb/musb-new/Makefile b/drivers/usb/musb-new/Makefile
index c23bef1..25b4dfe 100644
--- a/drivers/usb/musb-new/Makefile
+++ b/drivers/usb/musb-new/Makefile
@@ -16,7 +16,11 @@ COBJS-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
 CFLAGS_NO_WARN := $(call cc-option,-Wno-unused-variable) \
 			$(call cc-option,-Wno-unused-but-set-variable) \
 			$(call cc-option,-Wno-unused-label)
+ifeq ($(KCONFIG_CONFIG),)
 CFLAGS += $(CFLAGS_NO_WARN)
+else
+ccflags-y += $(CFLAGS_NO_WARN)
+endif
 
 COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
diff --git a/fs/Makefile b/fs/Makefile
index d0ab3ae..ab5e62d 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -28,6 +28,10 @@ LIB	= $(obj)libfs.o
 
 COBJS-y				+= fs.o
 
+obj-y	+= ext4/
+obj-y	+= fat/
+obj-y	+= sandbox/
+
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
index 3bde824..8ea2124 100644
--- a/fs/ext4/Makefile
+++ b/fs/ext4/Makefile
@@ -33,8 +33,9 @@ AOBJS	=
 COBJS-$(CONFIG_FS_EXT4) := ext4fs.o ext4_common.o dev.o
 COBJS-$(CONFIG_EXT4_WRITE) += ext4_write.o ext4_journal.o crc16.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
+COBJS	:= $(COBJS-y)
+SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 
 all:	$(LIB) $(AOBJS)
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index 969715b..89c8439 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -31,8 +31,9 @@ ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_FS_FAT)	+= file.o
 endif
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
+COBJS	:= $(COBJS-y)
+SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 all:	$(LIB) $(AOBJS)
 
diff --git a/fs/sandbox/Makefile b/fs/sandbox/Makefile
index b3155b0..f192d00 100644
--- a/fs/sandbox/Makefile
+++ b/fs/sandbox/Makefile
@@ -29,8 +29,9 @@ LIB	= $(obj)libsandboxfs.o
 
 COBJS-$(CONFIG_SANDBOX) := sandboxfs.o
 
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
+COBJS	:= $(COBJS-y)
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 all:	$(LIB) $(AOBJS)
 
diff --git a/lib/Makefile b/lib/Makefile
index 8f81862..f4b14a2 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -25,6 +25,9 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)libgeneric.o
 
+obj-y += libfdt/
+obj-y += zlib/
+
 ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
 COBJS-$(CONFIG_AES) += aes.o
-- 
1.8.2.1



More information about the U-Boot mailing list