Skip to contentSkip to conversation

First step towards Kbuild: Use Kbuild style makefiles

PATCH Superseded Masahiro Yamada 2 participants 27 messages Sep 26, 2013 – Oct 21, 2013

Subsystems (42)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover First step towards Kbuild: Use Kbuild style makefiles

Kbuild in U-Boot has been talked for a while
and RFC patches were posted by Simon Glass.

(Refer to "RFC: Add Kbuild system to U-Boot"
posted by Simon, May 12, 2013)

Simon's effort is a good start point but
varous critical features were missing from his patch series.

I have also been eager to introduce Kbuild to U-Boot. So I have been working on this task for a while with a little different migration path from Simon's way. At last I succeeded to build a few boards
with support of SPL build, Out-of-tree build, correct output file names, which were missing from Simon's patches.

While I were working on my local branch,
the build system and makefiles in U-Boot master repository always kept changing, of course.

Now my fruit got too old to fit with the current u-boot/master anymore. But if someone is interested in my work,
I can push my local branch to somewhere in my GitHub space. (RFC quality, but might be helpful for just discussions)

I recognize those patches are so rough that they could support only a few ARM boards. Perfectly covering all architectures and all boards without breaking any U-Boot features is a too big task for a sigle indivisual.

Even if I could do that, the patch series would
be extremely big size and the adjustment for U-Boot would be complecated.
So the review would probably take very long time. Along with the review process, as time goes by,
the posted patches would become not appled to the master branch.

So we would need to repeat post, review, fix, rebase on the master and post again, review, ...
again and again for a very big patch series.

I began to be wondering whether it is really possible to switch to Kbuild in this way.

So I decided to begin with what I can do, one by one. By stepping little by litte, we can get close to Kbuild and finally we will arrive at our goal.
I think this strategy is more realistic rather than adding a big change at one time.

Before importing a real Kbuild, I'd like to adjust our makefiles in the form suitable for Kbuild.

First of all, this series converts makefiles in sub directories to Kbuild style.

What this series do is quite simple:
- Moving common lines in sub makefiles to a new file 'scripts/Makefile.build'
- Renaming COBJS-y and SOBJS-y to obj-y in each sub makefile.
- A little bit more tweaks

That's all.

01/19 creates scripts/Makefile.build and tweaks Makefile and spl/Makefile to use scripts/Makefile.build.

U-Boot conventional makefiles are like this:

    include $(TOPDIR)/config.mk

    LIB     = $(obj)libfoo.o

    COBJS := ...
    COBJS += ...
    SOBJS := ...

    SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
    OBJS    := $(addprefix $(obj),$(COBJS) $(SOBJS))

    all:     $(obj).depend $(LIB)

    $(LIB): $(OBJS)
            $(call cmd_link_o_target, $(OBJS))

    #########################################################################

    include $(SRCTREE)/rules.mk

    sinclude $(obj).depend

    #########################################################################

Top and bottom parts are common in almost all makefiles.
Writing those lines in all makefiles is a big waste.
So common lines have been pushed into scripts/Makefile.build.
In addition, scripts/Makefile.build includes a glue code for supporting 'obj-y'. Be aware U-Boot conventional (non-Kbuild) makefile sytle is still supported. So we can change sub makefiles little by little in the following patches.

02/19-19/19 change sub makefiles into a Kbuild suitable form using obj-y. In order to avoid creating a big patch file, they are divided by CPU architectures and categories.

02/19-07/19: refactor under arch/arm/
08/19-16/19: refactor libraries which are commonly used for all architectures

  17/19      : refactor under arch/sandbox
  18/19      : refactor under arch/powerpc/
  19/19      : refactor under board/ti/

Conversion rule is pretty easy:

  (1) Delete common parts at top and bottom.
  (2) Rename
     COBJS  -> obj-y
     SOBJS  -> obj-y
     COBJS-$(CONFIG_FOO) -> obj-$(CONFIG_FOO)
     SOBJS-$(CONFIG_FOO) -> obj-$(CONFIG_FOO)
     START  -> extra-y

We can convert almost automatically althogh in some cases we may need to tweak a little.

I refactored more than 150 makefiles in this series. But we still have more than 600 makefiles. (Most of them reside under board/ directory) We can convert them lator little by little. Your contribution is welcome! :-)

Note1:
This series breaks _NO_ features in U-Boot
beucase it just moves common parts into scripts/Makefile.build

In order to prove this series does no harm,
I compiled all boards excepts nds32 and nios2 architectures
and checked md5sum matching for ./u-boot (and spl/u-boot-spl if it exists).

I tried md5sum for version 1 and I did the same thing again for version 2. I confirmed md5sum perfectly matched.

For the detailed steps how to compare md5sum,
please refer to the discussion in version 1:
[U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles

Note2:
This series is _NOT_ RFC.
I believe what these patches are doing is clear.
01/19 changes less than 100 lines.
02/19-19/19 changes lots of makefiles, but the conversion rule is simple.

So, I expect this series will be reviewed in a few weeks and applied to master when the next merge window opens or hopefully included into u-boot-2013.10 release.

Note3:
obj-y := foo/ (descending into foo sub directory) syntax is not supprted in this series.
It is implemented in upcoming patch series.
The reason why I postpone this feature is
I don't want to add a big change at one time. Adjusting for Kbuild little by litte is my strategy here for easy review.

Note4:
Of course, scripts/Makefile.build added by 01/19 patch is temporary. It shall be replaced with the one of Linux Kernel in future.

Note5:
01/19 is a prerequisite for 02/19 to 19/19.
But 02/19 thru 19/19 are order-independent.
If some of 02/19-19/19 becomes not applied to u-boot/master, they can be omitted.

Changes for v2:
01/19: fix commit log (purely cosmetic)
02/19: updated 3 files to rebase on the master
arch/arm/cpu/armv7/mx6/Makefile arch/arm/cpu/armv7/socfpga/Makefile arch/arm/cpu/armv7/zynq/Makefile
03/19-10/19: No change
11/19: updated 6 files to rebase on the master
drivers/serial/Makefile
drivers/mmc/Makefile
drivers/video/Makefile
drivers/watchdog/Makefile
drivers/rtc/Makefile
drivers/i2c/Makefile
12/19-17/19: No change
18/19: fixed one file
arch/powerpc/cpu/mpc8260/Makefile
(See version 1 thread for detailed readon why this file should be fixed)
19/19: No change

Cc Simon Glass <[email protected]>
Cc Tom Rini <[email protected]>
Cc Gerhard Sittig <[email protected]>

Masahiro Yamada (19):
Makefile: prepare for using Kbuild-style Makefile
armv7: convert makefiles to Kbuild style
arm926ejs: convert makefiles to Kbuild style
arm920t: convert makefiles to Kbuild style
arm720t: convert makefiles to Kbuild style
ARM: convert makefiles to Kbuild style
ARM: imx-common: convert makefiles to Kbuild style
drivers: net: convert makefiles to Kbuild style
drivers: mtd: convert makefiles to Kbuild style
drivers: usb: convert makefiles to Kbuild style
drivers: convert makefiles to Kbuild style
fs: convert makefiles to Kbuild style
common: convert makefiles to Kbuild style
net: convert a makefile to Kbuild style
lib: convert makefiles to Kbuild style
disk: convert a makefile to Kbuild style
sandbox: convert makefiles to Kbuild style
powerpc: convert makefiles to Kbuild style
board: ti: convert makefiles to Kbuild style

 Makefile                                   |  42 +++-
 arch/arm/cpu/arm1136/Makefile              |  26 +-
 arch/arm/cpu/arm1136/mx31/Makefile         |  27 +-
 arch/arm/cpu/arm1136/mx35/Makefile         |  28 +--
 arch/arm/cpu/arm1176/Makefile              |  26 +-
 arch/arm/cpu/arm1176/bcm2835/Makefile      |  25 +-
 arch/arm/cpu/arm1176/tnetv107x/Makefile    |  27 +-
 arch/arm/cpu/arm720t/Makefile              |  26 +-
 arch/arm/cpu/arm720t/tegra-common/Makefile |  25 +-
 arch/arm/cpu/arm720t/tegra114/Makefile     |  25 +-
 arch/arm/cpu/arm720t/tegra20/Makefile      |  23 +-
 arch/arm/cpu/arm720t/tegra30/Makefile      |  23 +-
 arch/arm/cpu/arm920t/Makefile              |  28 +--
 arch/arm/cpu/arm920t/a320/Makefile         |  25 +-
 arch/arm/cpu/arm920t/at91/Makefile         |  33 +--
 arch/arm/cpu/arm920t/ep93xx/Makefile       |  24 +-
 arch/arm/cpu/arm920t/imx/Makefile          |  27 +-
 arch/arm/cpu/arm920t/ks8695/Makefile       |  26 +-
 arch/arm/cpu/arm920t/s3c24x0/Makefile      |  29 +--
 arch/arm/cpu/arm925t/Makefile              |  30 +--
 arch/arm/cpu/arm926ejs/Makefile            |  28 +--
 arch/arm/cpu/arm926ejs/armada100/Makefile  |  23 +-
 arch/arm/cpu/arm926ejs/at91/Makefile       |  59 ++---
 arch/arm/cpu/arm926ejs/davinci/Makefile    |  48 +---
 arch/arm/cpu/arm926ejs/kirkwood/Makefile   |  31 +--
 arch/arm/cpu/arm926ejs/lpc32xx/Makefile    |  23 +-
 arch/arm/cpu/arm926ejs/mb86r0x/Makefile    |  25 +-
 arch/arm/cpu/arm926ejs/mx25/Makefile       |  23 +-
 arch/arm/cpu/arm926ejs/mx27/Makefile       |  23 +-
 arch/arm/cpu/arm926ejs/mxs/Makefile        |  26 +-
 arch/arm/cpu/arm926ejs/nomadik/Makefile    |  25 +-
 arch/arm/cpu/arm926ejs/omap/Makefile       |  26 +-
 arch/arm/cpu/arm926ejs/orion5x/Makefile    |  29 +--
 arch/arm/cpu/arm926ejs/pantheon/Makefile   |  23 +-
 arch/arm/cpu/arm926ejs/spear/Makefile      |  36 +--
 arch/arm/cpu/arm926ejs/versatile/Makefile  |  26 +-
 arch/arm/cpu/arm946es/Makefile             |  26 +-
 arch/arm/cpu/arm_intcm/Makefile            |  26 +-
 arch/arm/cpu/armv7/Makefile                |  32 +--
 arch/arm/cpu/armv7/am33xx/Makefile         |  51 +---
 arch/arm/cpu/armv7/at91/Makefile           |  31 +--
 arch/arm/cpu/armv7/exynos/Makefile         |  34 +--
 arch/arm/cpu/armv7/highbank/Makefile       |  24 +-
 arch/arm/cpu/armv7/mx5/Makefile            |  25 +-
 arch/arm/cpu/armv7/mx6/Makefile            |  25 +-
 arch/arm/cpu/armv7/omap-common/Makefile    |  43 +---
 arch/arm/cpu/armv7/omap3/Makefile          |  41 +--
 arch/arm/cpu/armv7/omap4/Makefile          |  31 +--
 arch/arm/cpu/armv7/omap5/Makefile          |  33 +--
 arch/arm/cpu/armv7/rmobile/Makefile        |  51 +---
 arch/arm/cpu/armv7/s5p-common/Makefile     |  29 +--
 arch/arm/cpu/armv7/s5pc1xx/Makefile        |  27 +-
 arch/arm/cpu/armv7/socfpga/Makefile        |  29 +--
 arch/arm/cpu/armv7/tegra-common/Makefile   |  24 +-
 arch/arm/cpu/armv7/tegra114/Makefile       |  22 +-
 arch/arm/cpu/armv7/tegra20/Makefile        |  26 +-
 arch/arm/cpu/armv7/tegra30/Makefile        |  22 +-
 arch/arm/cpu/armv7/u8500/Makefile          |  25 +-
 arch/arm/cpu/armv7/vf610/Makefile          |  25 +-
 arch/arm/cpu/armv7/zynq/Makefile           |  31 +--
 arch/arm/cpu/ixp/Makefile                  |  30 +--
 arch/arm/cpu/pxa/Makefile                  |  36 +--
 arch/arm/cpu/sa1100/Makefile               |  28 +--
 arch/arm/cpu/tegra-common/Makefile         |  25 +-
 arch/arm/cpu/tegra114-common/Makefile      |  23 +-
 arch/arm/cpu/tegra20-common/Makefile       |  29 +--
 arch/arm/cpu/tegra30-common/Makefile       |  26 +-
 arch/arm/imx-common/Makefile               |  35 +--
 arch/arm/lib/Makefile                      |  86 ++-----
 arch/powerpc/cpu/74xx_7xx/Makefile         |  28 +--
 arch/powerpc/cpu/mpc512x/Makefile          |  51 ++--
 arch/powerpc/cpu/mpc5xx/Makefile           |  27 +-
 arch/powerpc/cpu/mpc5xxx/Makefile          |  54 ++--
 arch/powerpc/cpu/mpc824x/Makefile          |  28 +--
 arch/powerpc/cpu/mpc8260/Makefile          |  32 +--
 arch/powerpc/cpu/mpc83xx/Makefile          |  58 ++---
 arch/powerpc/cpu/mpc85xx/Makefile          | 233 ++++++++---------
 arch/powerpc/cpu/mpc86xx/Makefile          |  50 ++--
 arch/powerpc/cpu/mpc8xx/Makefile           |  58 ++---
 arch/powerpc/cpu/mpc8xxx/Makefile          |  30 +--
 arch/powerpc/cpu/mpc8xxx/ddr/Makefile      |  30 +--
 arch/powerpc/cpu/ppc4xx/Makefile           |  90 +++----
 arch/powerpc/lib/Makefile                  |  78 ++----
 arch/sandbox/cpu/Makefile                  |  23 +-
 arch/sandbox/lib/Makefile                  |  25 +-
 board/ti/am335x/Makefile                   |  29 +--
 board/ti/am3517crane/Makefile              |  19 +-
 board/ti/am43xx/Makefile                   |  29 +--
 board/ti/beagle/Makefile                   |  24 +-
 board/ti/dra7xx/Makefile                   |  27 +-
 board/ti/evm/Makefile                      |  19 +-
 board/ti/omap1510inn/Makefile              |  24 +-
 board/ti/omap5912osk/Makefile              |  24 +-
 board/ti/omap5_uevm/Makefile               |  27 +-
 board/ti/omap730p2/Makefile                |  24 +-
 board/ti/panda/Makefile                    |  21 +-
 board/ti/sdp3430/Makefile                  |  21 +-
 board/ti/sdp4430/Makefile                  |  23 +-
 board/ti/ti814x/Makefile                   |  29 +--
 board/ti/ti816x/Makefile                   |  27 +-
 board/ti/tnetv107xevm/Makefile             |  25 +-
 common/Makefile                            | 389 ++++++++++++++---------------
 common/spl/Makefile                        |  36 +--
 disk/Makefile                              |  34 +--
 drivers/bios_emulator/Makefile             |  23 +-
 drivers/block/Makefile                     |  52 ++--
 drivers/bootcount/Makefile                 |  30 +--
 drivers/crypto/Makefile                    |  25 +-
 drivers/dfu/Makefile                       |  25 +-
 drivers/dma/Makefile                       |  30 +--
 drivers/fpga/Makefile                      |  44 +---
 drivers/gpio/Makefile                      |  73 ++----
 drivers/hwmon/Makefile                     |  40 +--
 drivers/i2c/Makefile                       |  68 ++---
 drivers/input/Makefile                     |  36 +--
 drivers/misc/Makefile                      |  52 ++--
 drivers/mmc/Makefile                       |  71 ++----
 drivers/mtd/Makefile                       |  44 +---
 drivers/mtd/nand/Makefile                  | 102 +++-----
 drivers/mtd/onenand/Makefile               |  27 +-
 drivers/mtd/spi/Makefile                   |  48 +---
 drivers/mtd/ubi/Makefile                   |  28 +--
 drivers/net/Makefile                       | 136 +++++-----
 drivers/net/fm/Makefile                    |  59 ++---
 drivers/net/npe/Makefile                   |  24 +-
 drivers/net/phy/Makefile                   |  60 ++---
 drivers/pci/Makefile                       |  44 +---
 drivers/pcmcia/Makefile                    |  34 +--
 drivers/power/Makefile                     |  47 +---
 drivers/power/battery/Makefile             |  25 +-
 drivers/power/fuel_gauge/Makefile          |  25 +-
 drivers/power/pmic/Makefile                |  31 +--
 drivers/qe/Makefile                        |  25 +-
 drivers/rtc/Makefile                       | 108 ++++----
 drivers/serial/Makefile                    |  82 +++---
 drivers/sound/Makefile                     |  30 +--
 drivers/spi/Makefile                       |  82 +++---
 drivers/tpm/Makefile                       |  29 +--
 drivers/twserial/Makefile                  |  24 +-
 drivers/usb/eth/Makefile                   |  28 +--
 drivers/usb/gadget/Makefile                |  54 ++--
 drivers/usb/host/Makefile                  |  74 ++----
 drivers/usb/musb-new/Makefile              |  36 +--
 drivers/usb/musb/Makefile                  |  36 +--
 drivers/usb/phy/Makefile                   |  24 +-
 drivers/usb/ulpi/Makefile                  |  28 +--
 drivers/video/Makefile                     |  86 +++----
 drivers/watchdog/Makefile                  |  38 +--
 fs/Makefile                                |  24 +-
 fs/cbfs/Makefile                           |  24 +-
 fs/cramfs/Makefile                         |  29 +--
 fs/ext4/Makefile                           |  27 +-
 fs/fat/Makefile                            |  31 +--
 fs/fdos/Makefile                           |  27 +-
 fs/jffs2/Makefile                          |  38 +--
 fs/reiserfs/Makefile                       |  26 +-
 fs/sandbox/Makefile                        |  23 +-
 fs/ubifs/Makefile                          |  29 +--
 fs/yaffs2/Makefile                         |  33 +--
 fs/zfs/Makefile                            |  25 +-
 lib/Makefile                               | 114 ++++-----
 lib/libfdt/Makefile                        |  27 +-
 lib/lzma/Makefile                          |  24 +-
 lib/lzo/Makefile                           |  24 +-
 lib/rsa/Makefile                           |  22 +-
 lib/tizen/Makefile                         |  24 +-
 lib/zlib/Makefile                          |  22 +-
 net/Makefile                               |  46 +---
 scripts/Makefile.build                     |  48 ++++
 spl/Makefile                               |  24 +-
 170 files changed, 1515 insertions(+), 5099 deletions(-)
 create mode 100644 scripts/Makefile.build
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/19 Makefile: prepare for using Kbuild-style Makefile

In every sub directory, Makefile is like follows:

    include $(TOPDIR)/config.mk

    LIB     = $(obj)libfoo.o

    COBJS := ...
    COBJS += ...
    SOBJS := ...

    SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
    OBJS    := $(addprefix $(obj),$(COBJS) $(SOBJS))

    all:     $(obj).depend $(LIB)

    $(LIB): $(OBJS)
            $(call cmd_link_o_target, $(OBJS))

    #########################################################################

    include $(SRCTREE)/rules.mk

    sinclude $(obj).depend

    #########################################################################

Top and bottom parts are common in almost all sub-makefiles. This is a big waste.
This commit pushes common parts of makefiles into script/Makefile.build.

Going forward sub-makefiles only need to describe this part:

    COBJS := ...
    COBJS += ...
    SOBJS := ...

But, script/Makefile.build includes the glue code to support obj-y, the following style (the same as Kbuild) is preferable:

    obj-y := ...
    obj-$(CONFIG_FOO) += ...
    obj-$(CONFIG_BAR) += ...

The conventional (non-Kbuild) Makefile style is still supported. This is achieved by greping the Makefile before entering into it. U-Boot conventional sub makefiles always include some other makefiles. So the build system searches a line beginning with "include" keyword in the makefile in order to distinguish which style it is. If the Makefile include a "include" line, we assume it is a conventional U-Boot style. Otherwise, it is treated as a Kbuild-style makefile.

(At first, I tried to grep "rules.mk" keyword instead,
but I found it does not work.
Almost all sub makefiles include "rules.mk", but there exist three exception:
- board/avnet/fx12mm/Makefile
- board/avnet/v5fx30teval/Makefile
- board/xilinx/ml507/Makefile
These three makefiles include "rules.mk" indirectly.
Anyway, they look weird, so they should be fixed lator.)

With this tweak, we can switch sub-makefiles from U-Boot style to Kbuild style little by little.

This refactoring of sub makefiles is the first step towards Kbuild, and makes it easy to import a "real" Kbuild from Linux Kernel.

Note that this refactoring breaks nothing because it just moves the common parts into scripts/Makefile.build.

Note one more thing:

obj-y := foo/ # descending into foo sub directory

syntax is not supported yet.
(This feature will be implemented in the upcoming commit.)

Of course, scripts/Makefile.build added by this commit is temporary. It shall be replaced with the one of Linux Kernel in future.

---

Changes for v2:
- fix commit log (purely cosmetic)

 Makefile               | 34 ++++++++++++++++++++++++++++++----
 scripts/Makefile.build | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 spl/Makefile           | 20 ++++++++++++++++++--
 3 files changed, 96 insertions(+), 6 deletions(-)
 create mode 100644 scripts/Makefile.build
Makefile +30 -4
index 07abef4..36bbd09 100644
@@ -593,14 +593,35 @@ ifeq ($(CONFIG_KALLSYMS),y)
 		$(GEN_UBOOT) $(obj)common/system_map.o
 endif
 
+# Tentative step for Kbuild-style makefiles coexist with conventional U-Boot style makefiles
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with "include" before entering into the sub makefile
+#  in order to distinguish which style it is.
+#  If the Makefile include a "include" line, we assume it is an U-Boot style makefile.
+#  Otherwise, it is treated as a Kbuild-style makefile.
+
+# We do not need to build $(OBJS) explicitly.
+# It is built while we are at $(CPUDIR)/lib$(CPU).o build.
 $(OBJS):	depend
-		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+		if grep -q "^include" $(CPUDIR)/Makefile; then \
+		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@)); \
+		fi
 
 $(LIBS):	depend $(SUBDIR_TOOLS)
-		$(MAKE) -C $(dir $(subst $(obj),,$@))
+		if grep -q "^include" $(dir $(subst $(obj),,$@))Makefile; then \
+		$(MAKE) -C $(dir $(subst $(obj),,$@)); \
+		else \
+		$(MAKE) -C $(dir $(subst $(obj),,$@)) -f $(TOPDIR)/scripts/Makefile.build; \
+		mv $(dir $@)built-in.o $@; \
+		fi
 
 $(LIBBOARD):	depend $(LIBS)
-		$(MAKE) -C $(dir $(subst $(obj),,$@))
+		if grep -q "^include" $(dir $(subst $(obj),,$@))/Makefile; then \
+		$(MAKE) -C $(dir $(subst $(obj),,$@)); \
+		else \
+		$(MAKE) -C $(dir $(subst $(obj),,$@)) -f $(TOPDIR)/scripts/Makefile.build; \
+		mv $(dir $@)built-in.o $@; \
+		fi
 
 $(SUBDIRS):	depend
 		$(MAKE) -C $@ all
@@ -637,7 +658,12 @@ depend dep:	$(TIMESTAMP_FILE) $(VERSION_FILE) \
 		$(obj)include/generated/generic-asm-offsets.h \
 		$(obj)include/generated/asm-offsets.h
 		for dir in $(SUBDIRS) $(CPUDIR) $(LDSCRIPT_MAKEFILE_DIR) ; do \
-			$(MAKE) -C $$dir _depend ; done
+		if grep -q "^include" $$dir/Makefile; then \
+			$(MAKE) -C $$dir _depend ; \
+		else \
+			$(MAKE) -C $$dir -f $(TOPDIR)/scripts/Makefile.build _depend; \
+		fi; \
+		done
 
 TAG_SUBDIRS = $(SUBDIRS)
 TAG_SUBDIRS += $(dir $(__LIBS))
scripts/Makefile.build new file +48 -0

48 lines not on this page · raw message

spl/Makefile +18 -2
index 174d0a7..48f2c65 100644
@@ -199,11 +199,27 @@ GEN_UBOOT = \
 $(obj)$(SPL_BIN):	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
 	$(GEN_UBOOT)
 
+# Tentative step for Kbuild-style makefiles coexist with conventional U-Boot style makefiles
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with "include" before entering into the sub makefile
+#  in order to distinguish which style it is.
+#  If the Makefile include a "include" line, we assume it is an U-Boot style makefile.
+#  Otherwise, it is treated as a Kbuild-style makefile.
+
+# We do not need to build $(START) explicitly.
+# It is built while we are at $(CPUDIR)/lib$(CPU).o build.
 $(START):	depend
-	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@
+	if grep -q "^include" $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))Makefile; then \
+	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@; \
+	fi
 
 $(LIBS):	depend
-	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
+	if grep -q "^include" $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))Makefile; then \
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@)); \
+	else \
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@)) -f $(TOPDIR)/scripts/Makefile.build; \
+	mv $(dir $@)built-in.o $@; \
+	fi
 
 $(obj)u-boot-spl.lds: $(LDSCRIPT) depend
 	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj). -ansi -D__ASSEMBLY__ -P - < $< > $@
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH v2 1/19 Makefile: prepare for using Kbuild-style Makefile

Hi,

Quoted 109 lines · Masahiro Yamada

In every sub directory, Makefile is like follows:

    include $(TOPDIR)/config.mk

    LIB     = $(obj)libfoo.o

    COBJS := ...
    COBJS += ...
    SOBJS := ...

    SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
    OBJS    := $(addprefix $(obj),$(COBJS) $(SOBJS))

    all:     $(obj).depend $(LIB)

    $(LIB): $(OBJS)
            $(call cmd_link_o_target, $(OBJS))

#########################################################################

    include $(SRCTREE)/rules.mk

    sinclude $(obj).depend

#########################################################################

Top and bottom parts are common in almost all sub-makefiles. This is a big waste.
This commit pushes common parts of makefiles into script/Makefile.build.

Going forward sub-makefiles only need to describe this part:

    COBJS := ...
    COBJS += ...
    SOBJS := ...

But, script/Makefile.build includes the glue code to support obj-y, the following style (the same as Kbuild) is preferable:

    obj-y := ...
    obj-$(CONFIG_FOO) += ...
    obj-$(CONFIG_BAR) += ...

The conventional (non-Kbuild) Makefile style is still supported. This is achieved by greping the Makefile before entering into it. U-Boot conventional sub makefiles always include some other makefiles. So the build system searches a line beginning with "include" keyword in the makefile in order to distinguish which style it is. If the Makefile include a "include" line, we assume it is a conventional U-Boot style. Otherwise, it is treated as a Kbuild-style makefile.

(At first, I tried to grep "rules.mk" keyword instead, but I found it does not work.
Almost all sub makefiles include "rules.mk", but there exist three exception:
- board/avnet/fx12mm/Makefile
- board/avnet/v5fx30teval/Makefile
- board/xilinx/ml507/Makefile
These three makefiles include "rules.mk" indirectly. Anyway, they look weird, so they should be fixed lator.)

With this tweak, we can switch sub-makefiles from U-Boot style to Kbuild style little by little.

This refactoring of sub makefiles is the first step towards Kbuild, and makes it easy to import a "real" Kbuild from Linux Kernel.

Note that this refactoring breaks nothing because it just moves the common parts into scripts/Makefile.build.

Note one more thing:

obj-y := foo/ # descending into foo sub directory

syntax is not supported yet.
(This feature will be implemented in the upcoming commit.)

Of course, scripts/Makefile.build added by this commit is temporary. It shall be replaced with the one of Linux Kernel in future.

---

Changes for v2:
- fix commit log (purely cosmetic)

 Makefile               | 34 ++++++++++++++++++++++++++++++----
 scripts/Makefile.build | 48
++++++++++++++++++++++++++++++++++++++++++++++++
 spl/Makefile           | 20 ++++++++++++++++++--
 3 files changed, 96 insertions(+), 6 deletions(-)
 create mode 100644 scripts/Makefile.build
Makefile +1 -0
index 07abef4..36bbd09 100644
@@ -593,14 +593,35 @@ ifeq ($(CONFIG_KALLSYMS),y)
                $(GEN_UBOOT) $(obj)common/system_map.o
 endif
 
+# Tentative step for Kbuild-style makefiles coexist with conventional

U-Boot style makefiles

Makefile +2 -0
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with "include" before
Quoted 3 lines

entering into the sub makefile
+# in order to distinguish which style it is.

Would looking for obj- be better or worse?

Quoted 10 lines

+# If the Makefile include a "include" line, we assume it is an U-Boot style makefile.

Makefile +6 -1
+#  Otherwise, it is treated as a Kbuild-style makefile.
+
+# We do not need to build $(OBJS) explicitly.
+# It is built while we are at $(CPUDIR)/lib$(CPU).o build.
 $(OBJS):       depend
-               $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+               if grep -q "^include" $(CPUDIR)/Makefile; then \
+               $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir
Quoted 2 lines

$@)); \

an indent might help here, and below.

Quoted 7 lines
Makefile +2 -1
+               fi
 
 $(LIBS):       depend $(SUBDIR_TOOLS)
-               $(MAKE) -C $(dir $(subst $(obj),,$@))
+               if grep -q "^include" $(dir $(subst $(obj),,$@))Makefile;

then \

This check seems to appear a lot - could it become a $(call ...) perhaps?

Quoted 133 lines
Makefile +3 -0
+               $(MAKE) -C $(dir $(subst $(obj),,$@)); \
+               else \
+               $(MAKE) -C $(dir $(subst $(obj),,$@)) -f

$(TOPDIR)/scripts/Makefile.build; \

Makefile +3 -1
+               mv $(dir $@)built-in.o $@; \
+               fi
 
 $(LIBBOARD):   depend $(LIBS)
-               $(MAKE) -C $(dir $(subst $(obj),,$@))
+               if grep -q "^include" $(dir $(subst $(obj),,$@))/Makefile;

then \

Makefile +3 -0
+               $(MAKE) -C $(dir $(subst $(obj),,$@)); \
+               else \
+               $(MAKE) -C $(dir $(subst $(obj),,$@)) -f

$(TOPDIR)/scripts/Makefile.build; \

Makefile +8 -1
+               mv $(dir $@)built-in.o $@; \
+               fi
 
 $(SUBDIRS):    depend
                $(MAKE) -C $@ all
@@ -637,7 +658,12 @@ depend dep:        $(TIMESTAMP_FILE) $(VERSION_FILE) \
                $(obj)include/generated/generic-asm-offsets.h \
                $(obj)include/generated/asm-offsets.h
                for dir in $(SUBDIRS) $(CPUDIR) $(LDSCRIPT_MAKEFILE_DIR) ;
 do \
-                       $(MAKE) -C $$dir _depend ; done
+               if grep -q "^include" $$dir/Makefile; then \
+                       $(MAKE) -C $$dir _depend ; \
+               else \
+                       $(MAKE) -C $$dir -f
 $(TOPDIR)/scripts/Makefile.build _depend; \
+               fi; \
+               done
 

TAG_SUBDIRS = $(SUBDIRS)
TAG_SUBDIRS += $(dir $(__LIBS))

scripts/Makefile.build new file +23 -0
new file mode 100644
index 0000000..f969ec5
@@ -0,0 +1,48 @@
+# our default target
+.PHONY: all
+all:
+
+include $(TOPDIR)/config.mk
+
+LIB := $(obj)built-in.o
+LIBGCC = $(obj)libgcc.o
+SRCS :=
+
+include Makefile
+
+# Backward compatible: obj-y is preferable
+COBJS := $(sort $(COBJS) $(COBJS-y))
+SOBJS := $(sort $(SOBJS) $(SOBJS-y))
+
+# Going forward use the following
+obj-y := $(sort $(obj-y))
+extra-y := $(sort $(extra-y))
+lib-y := $(sort $(lib-y))
+
+SRCS   += $(COBJS:.o=.c) $(SOBJS:.o=.S) \
+ $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) $(lib-y:.o=.S)

$(extra-y:.o=.c) $(extra-y:.o=.S))

scripts/Makefile.build new file +25 -0
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS) $(obj-y))
+
+LGOBJS := $(addprefix $(obj),$(sort $(GLSOBJS) $(GLCOBJS)) $(lib-y))
+
+all: $(LIB) $(addprefix $(obj),$(extra-y))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(call cmd_link_o_target, $(OBJS))
+
+ifneq ($(strip $(lib-y)),)
+all: $(LIBGCC)
+
+$(LIBGCC): $(obj).depend $(LGOBJS)
+       $(call cmd_link_o_target, $(LGOBJS))
+endif
+
+#########################################################################
+
+# defines $(obj).depend target
+
+include $(TOPDIR)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
spl/Makefile +1 -0
index 174d0a7..48f2c65 100644
@@ -199,11 +199,27 @@ GEN_UBOOT = \
 $(obj)$(SPL_BIN):      depend $(START) $(LIBS) $(obj)u-boot-spl.lds
        $(GEN_UBOOT)
 
+# Tentative step for Kbuild-style makefiles coexist with conventional

U-Boot style makefiles

spl/Makefile +2 -0
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with "include" before

entering into the sub makefile

spl/Makefile +2 -0
+#  in order to distinguish which style it is.
+#  If the Makefile include a "include" line, we assume it is an U-Boot

style makefile.

spl/Makefile +5 -1
+#  Otherwise, it is treated as a Kbuild-style makefile.
+
+# We do not need to build $(START) explicitly.
+# It is built while we are at $(CPUDIR)/lib$(CPU).o build.
 $(START):      depend
-       $(MAKE) -C $(SRCTREE)/$(START_PATH) $@
+       if grep -q "^include" $(SRCTREE)$(dir $(subst

$(SPLTREE),,$@))Makefile; then \

spl/Makefile +3 -1
+       $(MAKE) -C $(SRCTREE)/$(START_PATH) $@; \
+       fi
 
 $(LIBS):       depend
-       $(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
+       if grep -q "^include" $(SRCTREE)$(dir $(subst

$(SPLTREE),,$@))Makefile; then \

spl/Makefile +3 -0
+       $(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@)); \
+       else \
+       $(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@)) -f

$(TOPDIR)/scripts/Makefile.build; \

spl/Makefile +2 -2
+       mv $(dir $@)built-in.o $@; \
+       fi
 
 $(obj)u-boot-spl.lds: $(LDSCRIPT) depend
        $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -I$(obj). -ansi -D__ASSEMBLY__ -P
- < $< > $@
--
Quoted 3 lines

1.8.1.2

Re testing, I used:

$ ./tools/buildman/buildman -b try-kbuild -k

and confirmed that the binaries do change, for example, with cm41xx:

$ wc ...
   1348    5418  123176
try-kbuild/01_of_20_g0c5274e6_Prepare-v2013.04-rc4/cm41xx/u-boot.bin
   1348    5417  123188
try-kbuild/02_of_20_gd3068182_Makefile--prepare-fo/cm41xx/u-boot.bin

The change may well be harmless though.

It would be nice to add a feature to buildman to compare binaries. Of course we would need to add a Makefile option to disable the timestamp embedding first, since all binaries are different because of that.

Regards,
Simon

#3 lore raw

PATCH v2 1/19 Makefile: prepare for using Kbuild-style Makefile

Hello Simon

Quoted 9 lines
Quoted 7 lines

+# Tentative step for Kbuild-style makefiles coexist with conventional U-Boot style makefiles

(quoted diff) +2 -0
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with "include" before

entering into the sub makefile
+# in order to distinguish which style it is.

Would looking for obj- be better or worse?

At first I thought of this but I was kind of worried whether all makefiles should forcibly have obj-y or obj-.

arch/arm/cpu/armv7/tegra114/ arch/arm/cpu/armv7/tegra30/
directories have no source files but only a Makefile.

After all, I simply added
obj- :=
line in them, so I think your suggestion will work.

If you prefer to search obj-, I will consider to change at version 3.

In any case, this ugly grep switch is tentative. I want to refactor all makefiles and delete this switch as soon as possible.

Quoted 1 line

an indent might help here, and below.

I will fix at v3.

Quoted 9 lines
Quoted 7 lines
Makefile +2 -1
+               fi
 
 $(LIBS):       depend $(SUBDIR_TOOLS)
-               $(MAKE) -C $(dir $(subst $(obj),,$@))
+               if grep -q "^include" $(dir $(subst $(obj),,$@))Makefile;

then \

This check seems to appear a lot - could it become a $(call ...) perhaps?

I did not care so much about this part becuase it is temporary. But re-writing it shortly with $(call ...) is not difficult. I will try at v3.
Thanks for your advice.

Quoted 6 lines

Re testing, I used:

$ ./tools/buildman/buildman -b try-kbuild -k

and confirmed that the binaries do change, for example, with cm41xx:

Quoted 7 lines
$ wc ...
   1348    5418  123176
try-kbuild/01_of_20_g0c5274e6_Prepare-v2013.04-rc4/cm41xx/u-boot.bin
   1348    5417  123188
try-kbuild/02_of_20_gd3068182_Makefile--prepare-fo/cm41xx/u-boot.bin

The change may well be harmless though.

It is probably because of include/generated/version_autogenerated.h

The length of PLAIN_VERSION and U_BOOT_VERSION changes because the output git describe command is used for here.

Actually I gave it a try.

For master branch (Prepare v2013.04-rc4), I got:

#define PLAIN_VERSION "2013.10-rc4"
#define U_BOOT_VERSION "U-Boot 2013.10-rc4"
#define CC_VERSION_STRING "arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3" #define LD_VERSION_STRING "GNU ld (GNU Binutils for Ubuntu) 2.23.2"

For try-kbuild branch (Makefile: prepare for using Kbuild-style Makefile) I got:

#define PLAIN_VERSION "2013.10-rc4-00001-gc31a399"
#define U_BOOT_VERSION "U-Boot 2013.10-rc4-00001-gc31a399"
#define CC_VERSION_STRING "arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3" #define LD_VERSION_STRING "GNU ld (GNU Binutils for Ubuntu) 2.23.2"

For the list of things you should take into account to get identical output files, please refer the thread of version1 of this series:
[U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles
Message-Id: <[email protected]>

Quoted 5 lines

(2) Git commit hash

Git commit hash is contained in include/generated/version_autogenerated.h. So, I also modified include/version.h not to include it as follows:

Quoted 8 lines
     #ifndef DO_DEPS_ONLY
    -#include "generated/version_autogenerated.h"
    +/* #include "generated/version_autogenerated.h" */
    +#define PLAIN_VERSION "__DUMMY__"
    +#define U_BOOT_VERSION "__DUMMY__"
    +#define CC_VERSION_STRING "__DUMMY__"
    +#define LD_VERSION_STRING "__DUMMY__"
     #endif

This is what I did when I compared md5sum. After applying above as a prerequisite commit, I tried 'tools/buildman/buildman -b try-kbuild -k' again and I got the same size for cm41xx/u-boot.bin

If you compare the size of u-boot.bin, please take care of the order of object files too.

I also mentioned this in the thread of v1.

Quoted 3 lines

It would be nice to add a feature to buildman to compare binaries. Of course we would need to add a Makefile option to disable the timestamp embedding first, since all binaries are different because of that.

Sounds a good idea.
I will take a look when I have time.

Best Regards
Masahiro Yamada

#4 lore raw

PATCH v2 1/19 Makefile: prepare for using Kbuild-style Makefile

Hi Masahiro,

Quoted 21 lines · Masahiro Yamada

Hello Simon

Quoted 9 lines
Quoted 7 lines

+# Tentative step for Kbuild-style makefiles coexist with conventional U-Boot style makefiles

(quoted diff) +2 -0
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with "include" before

entering into the sub makefile
+# in order to distinguish which style it is.

Would looking for obj- be better or worse?

At first I thought of this but I was kind of worried whether all makefiles should forcibly have obj-y or obj-.

arch/arm/cpu/armv7/tegra114/ arch/arm/cpu/armv7/tegra30/
directories have no source files but only a Makefile.

Quoted 5 lines

After all, I simply added
obj- :=
line in them, so I think your suggestion will work.

If you prefer to search obj-, I will consider to change at version 3.

No, it doesn't matter, it sounds like what you are doing is just as good, and it is temporary as you say. I wonder how temporary?

Quoted 106 lines

In any case, this ugly grep switch is tentative. I want to refactor all makefiles and delete this switch as soon as possible.

Quoted 1 line

an indent might help here, and below.

I will fix at v3.

Quoted 9 lines
Quoted 7 lines
Makefile +2 -1
+               fi
 
 $(LIBS):       depend $(SUBDIR_TOOLS)
-               $(MAKE) -C $(dir $(subst $(obj),,$@))
+               if grep -q "^include" $(dir $(subst $(obj),,$@))Makefile;

then \

This check seems to appear a lot - could it become a $(call ...) perhaps?

I did not care so much about this part becuase it is temporary. But re-writing it shortly with $(call ...) is not difficult. I will try at v3.
Thanks for your advice.

Quoted 6 lines

Re testing, I used:

$ ./tools/buildman/buildman -b try-kbuild -k

and confirmed that the binaries do change, for example, with cm41xx:

Quoted 7 lines
$ wc ...
   1348    5418 123176
try-kbuild/01_of_20_g0c5274e6_Prepare-v2013.04-rc4/cm41xx/u-boot.bin
   1348    5417  123188
try-kbuild/02_of_20_gd3068182_Makefile--prepare-fo/cm41xx/u-boot.bin

The change may well be harmless though.

It is probably because of include/generated/version_autogenerated.h

The length of PLAIN_VERSION and U_BOOT_VERSION changes because the output git describe command is used for here.

Actually I gave it a try.

For master branch (Prepare v2013.04-rc4), I got:

#define PLAIN_VERSION "2013.10-rc4"
#define U_BOOT_VERSION "U-Boot 2013.10-rc4"
#define CC_VERSION_STRING "arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3" #define LD_VERSION_STRING "GNU ld (GNU Binutils for Ubuntu) 2.23.2"

For try-kbuild branch (Makefile: prepare for using Kbuild-style Makefile) I got:

#define PLAIN_VERSION "2013.10-rc4-00001-gc31a399"
#define U_BOOT_VERSION "U-Boot 2013.10-rc4-00001-gc31a399"
#define CC_VERSION_STRING "arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3" #define LD_VERSION_STRING "GNU ld (GNU Binutils for Ubuntu) 2.23.2"

For the list of things you should take into account to get identical output files, please refer the thread of version1 of this series:
[U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles
Message-Id: <[email protected]>

Quoted 5 lines

(2) Git commit hash

Git commit hash is contained in include/generated/version_autogenerated.h. So, I also modified include/version.h not to include it as follows:

Quoted 8 lines
     #ifndef DO_DEPS_ONLY
    -#include "generated/version_autogenerated.h"
    +/* #include "generated/version_autogenerated.h" */
    +#define PLAIN_VERSION "__DUMMY__"
    +#define U_BOOT_VERSION "__DUMMY__"
    +#define CC_VERSION_STRING "__DUMMY__"
    +#define LD_VERSION_STRING "__DUMMY__"
     #endif

This is what I did when I compared md5sum. After applying above as a prerequisite commit, I tried 'tools/buildman/buildman -b try-kbuild -k' again and I got the same size for cm41xx/u-boot.bin

If you compare the size of u-boot.bin, please take care of the order of object files too.

I also mentioned this in the thread of v1.

Quoted 8 lines
Quoted 3 lines

It would be nice to add a feature to buildman to compare binaries. Of course we would need to add a Makefile option to disable the timestamp embedding first, since all binaries are different because of that.

Sounds a good idea.
I will take a look when I have time.

Regards,
Simon

#5 lore raw

PATCH v2 1/19 Makefile: prepare for using Kbuild-style Makefile

Hello, Simon.

Quoted 9 lines
Quoted 9 lines
Quoted 1 line

Would looking for obj- be better or worse?

At first I thought of this but I was kind of worried whether all makefiles should forcibly have obj-y or obj-.

arch/arm/cpu/armv7/tegra114/ arch/arm/cpu/armv7/tegra30/
directories have no source files but only a Makefile.

Quoted 8 lines
Quoted 5 lines

After all, I simply added
obj- :=
line in them, so I think your suggestion will work.

If you prefer to search obj-, I will consider to change at version 3.

No, it doesn't matter, it sounds like what you are doing is just as good, and it is temporary as you say. I wonder how temporary?

I posted a new series
"Third step towards Kbuild: Convert rest of makefiles" (consists of 18 patch files) The series deletes the temporary grep switch.

Altough it is Tom who decides when the series should be applied, I hope it is not so late.

Best Regards
Masahiro Yamada

#6 lore raw

PATCH v2 1/19 Makefile: prepare for using Kbuild-style Makefile

Hi Masahiro,

Quoted 22 lines · Masahiro Yamada

Hello, Simon.

Quoted 9 lines
Quoted 9 lines
Quoted 1 line

Would looking for obj- be better or worse?

At first I thought of this but I was kind of worried whether all makefiles should forcibly have obj-y or obj-.

arch/arm/cpu/armv7/tegra114/ arch/arm/cpu/armv7/tegra30/
directories have no source files but only a Makefile.

Quoted 8 lines
Quoted 5 lines

After all, I simply added
obj- :=
line in them, so I think your suggestion will work.

If you prefer to search obj-, I will consider to change at version 3.

No, it doesn't matter, it sounds like what you are doing is just as good, and it is temporary as you say. I wonder how temporary?

Quoted 6 lines

I posted a new series
"Third step towards Kbuild: Convert rest of makefiles" (consists of 18 patch files) The series deletes the temporary grep switch.

Altough it is Tom who decides when the series should be applied, I hope it is not so late.

The merge window only opened recently so it should be fine.

Regards,
Simon

Quoted 5 lines

Best Regards
Masahiro Yamada

#7 lore raw

PATCH v2 2/19 armv7: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2:
-2/19: updated 3 files to rebase on the master
arch/arm/cpu/armv7/mx6/Makefile
arch/arm/cpu/armv7/socfpga/Makefile
arch/arm/cpu/armv7/zynq/Makefile

 arch/arm/cpu/armv7/Makefile              | 32 ++++----------------
 arch/arm/cpu/armv7/am33xx/Makefile       | 51 ++++++++------------------------
 arch/arm/cpu/armv7/at91/Makefile         | 31 ++++---------------
 arch/arm/cpu/armv7/exynos/Makefile       | 34 ++++-----------------
 arch/arm/cpu/armv7/highbank/Makefile     | 24 +--------------
 arch/arm/cpu/armv7/mx5/Makefile          | 25 ++--------------
 arch/arm/cpu/armv7/mx6/Makefile          | 25 ++--------------
 arch/arm/cpu/armv7/omap-common/Makefile  | 43 +++++++--------------------
 arch/arm/cpu/armv7/omap3/Makefile        | 41 +++++++------------------
 arch/arm/cpu/armv7/omap4/Makefile        | 31 ++++---------------
 arch/arm/cpu/armv7/omap5/Makefile        | 33 ++++-----------------
 arch/arm/cpu/armv7/rmobile/Makefile      | 51 ++++++++------------------------
 arch/arm/cpu/armv7/s5p-common/Makefile   | 29 +++---------------
 arch/arm/cpu/armv7/s5pc1xx/Makefile      | 27 ++---------------
 arch/arm/cpu/armv7/socfpga/Makefile      | 29 ++----------------
 arch/arm/cpu/armv7/tegra-common/Makefile | 24 +--------------
 arch/arm/cpu/armv7/tegra114/Makefile     | 22 +-------------
 arch/arm/cpu/armv7/tegra20/Makefile      | 26 ++--------------
 arch/arm/cpu/armv7/tegra30/Makefile      | 22 +-------------
 arch/arm/cpu/armv7/u8500/Makefile        | 25 ++--------------
 arch/arm/cpu/armv7/vf610/Makefile        | 25 ++--------------
 arch/arm/cpu/armv7/zynq/Makefile         | 31 +++----------------
 22 files changed, 101 insertions(+), 580 deletions(-)
arch/arm/cpu/armv7/Makefile +5 -27
index b723e22..75fac4b 100644
@@ -5,35 +5,13 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	:= start.o
 
-LIB	= $(obj)lib$(CPU).o
+obj-y	+= cache_v7.o
 
-START	:= start.o
-
-COBJS	+= cache_v7.o
-
-COBJS	+= cpu.o
-COBJS	+= syslib.o
+obj-y	+= cpu.o
+obj-y	+= syslib.o
 
 ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX),)
-SOBJS	+= lowlevel_init.o
+obj-y	+= lowlevel_init.o
 endif
-
-SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/arm/cpu/armv7/am33xx/Makefile +12 -39

58 lines not on this page · raw message

arch/arm/cpu/armv7/at91/Makefile +5 -26
index 90b9bd6..0a2e48d 100644
@@ -8,29 +8,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-$(CONFIG_SAMA5D3)	+= sama5d3_devices.o
-COBJS-y += clock.o
-COBJS-y += cpu.o
-COBJS-y += reset.o
-COBJS-y += timer.o
-
-SRCS    := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-OBJS    := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_SAMA5D3)	+= sama5d3_devices.o
+obj-y += clock.o
+obj-y += cpu.o
+obj-y += reset.o
+obj-y += timer.o
arch/arm/cpu/armv7/exynos/Makefile +6 -28
index eb1633f..e207bd6 100644
@@ -5,34 +5,12 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	+= clock.o power.o soc.o system.o pinmux.o tzpc.o
+obj-y	+= clock.o power.o soc.o system.o pinmux.o tzpc.o
 
 ifdef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_EXYNOS5)	+= clock_init_exynos5.o
-COBJS-$(CONFIG_EXYNOS5)	+= dmc_common.o dmc_init_ddr3.o
-COBJS-$(CONFIG_EXYNOS4210)+= dmc_init_exynos4.o clock_init_exynos4.o
-COBJS-y	+= spl_boot.o
-COBJS-y	+= lowlevel_init.o
+obj-$(CONFIG_EXYNOS5)	+= clock_init_exynos5.o
+obj-$(CONFIG_EXYNOS5)	+= dmc_common.o dmc_init_ddr3.o
+obj-$(CONFIG_EXYNOS4210)+= dmc_init_exynos4.o clock_init_exynos4.o
+obj-y	+= spl_boot.o
+obj-y	+= lowlevel_init.o
 endif
-
-COBJS   := $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/arm/cpu/armv7/highbank/Makefile +1 -23
index 22e3b72..876099d 100644
@@ -5,26 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	:= timer.o
-SOBJS	:=
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= timer.o
arch/arm/cpu/armv7/mx5/Makefile +2 -23
index 7c86ae3..d021842 100644
@@ -7,26 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= soc.o clock.o
-SOBJS = lowlevel_init.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y := soc.o clock.o
+obj-y += lowlevel_init.o
arch/arm/cpu/armv7/mx6/Makefile +2 -23
index 6d73617..d7285fc 100644
@@ -7,26 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	= soc.o clock.o
-COBJS-$(CONFIG_SECURE_BOOT)	+= hab.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= soc.o clock.o
+obj-$(CONFIG_SECURE_BOOT)    += hab.o
arch/arm/cpu/armv7/omap-common/Makefile +11 -32

57 lines not on this page · raw message

arch/arm/cpu/armv7/omap3/Makefile +10 -31

48 lines not on this page · raw message

arch/arm/cpu/armv7/omap4/Makefile +5 -26
index fc6e2dd..76a032a 100644
@@ -5,29 +5,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	=  $(obj)lib$(SOC).o
-
-COBJS	+= sdram_elpida.o
-COBJS	+= hwinit.o
-COBJS	+= emif.o
-COBJS	+= prcm-regs.o
-COBJS	+= hw_data.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= sdram_elpida.o
+obj-y	+= hwinit.o
+obj-y	+= emif.o
+obj-y	+= prcm-regs.o
+obj-y	+= hw_data.o
arch/arm/cpu/armv7/omap5/Makefile +6 -27
index 168302d..64c6879 100644
@@ -5,30 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	=  $(obj)lib$(SOC).o
-
-COBJS	+= hwinit.o
-COBJS	+= emif.o
-COBJS	+= sdram.o
-COBJS	+= prcm-regs.o
-COBJS	+= hw_data.o
-COBJS	+= abb.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= hwinit.o
+obj-y	+= emif.o
+obj-y	+= sdram.o
+obj-y	+= prcm-regs.o
+obj-y	+= hw_data.o
+obj-y	+= abb.o
arch/arm/cpu/armv7/rmobile/Makefile +13 -38

58 lines not on this page · raw message

arch/arm/cpu/armv7/s5p-common/Makefile +4 -25
index fd7290c..f571d8a 100644
@@ -5,30 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libs5p-common.o
-
-COBJS-y		+= cpu_info.o
+obj-y		+= cpu_info.o
 ifndef CONFIG_SPL_BUILD
-COBJS-y		+= timer.o
-COBJS-y		+= sromc.o
-COBJS-$(CONFIG_PWM)	+= pwm.o
+obj-y		+= timer.o
+obj-y		+= sromc.o
+obj-$(CONFIG_PWM)	+= pwm.o
 endif
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y) $(SOBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/arm/cpu/armv7/s5pc1xx/Makefile +3 -24
index 09fed66..9f43ded 100644
@@ -8,28 +8,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+obj-y	= cache.o
+obj-y	+= reset.o
 
-LIB	= $(obj)lib$(SOC).o
-
-SOBJS	= cache.o
-SOBJS	+= reset.o
-
-COBJS	+= clock.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= clock.o
arch/arm/cpu/armv7/socfpga/Makefile +3 -26
index 5024fc5..d361b78 100644
@@ -7,29 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-
-include $(TOPDIR)/config.mk
-
-LIB	=  $(obj)lib$(SOC).o
-
-SOBJS	:= lowlevel_init.o
-COBJS-y	:= misc.o timer.o reset_manager.o
-COBJS-$(CONFIG_SPL_BUILD) += spl.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= lowlevel_init.o
+obj-y	+= misc.o timer.o reset_manager.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
arch/arm/cpu/armv7/tegra-common/Makefile +1 -23
index d97542d..463c260 100644
@@ -7,26 +7,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	=  $(obj)libtegra-common.o
-
-COBJS-$(CONFIG_CMD_ENTERRCM) += cmd_enterrcm.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_ENTERRCM) += cmd_enterrcm.o
arch/arm/cpu/armv7/tegra114/Makefile +1 -21
index eb98c8e..886b509 100644
@@ -17,24 +17,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj- :=
arch/arm/cpu/armv7/tegra20/Makefile +2 -24
index 4ee8e5b..9b4295c 100644
@@ -7,27 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	=  $(obj)lib$(SOC).o
-
-COBJS-$(CONFIG_PWM_TEGRA) += pwm.o
-COBJS-$(CONFIG_VIDEO_TEGRA) += display.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	 $(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_PWM_TEGRA) += pwm.o
+obj-$(CONFIG_VIDEO_TEGRA) += display.o
arch/arm/cpu/armv7/tegra30/Makefile +1 -21
index 04adb52..518d6d1 100644
@@ -17,24 +17,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj- :=
arch/arm/cpu/armv7/u8500/Makefile +2 -23
index 3d7a592..fad9d4a 100644
@@ -5,26 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= timer.o clock.o prcmu.o cpu.o
-SOBJS	= lowlevel.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= timer.o clock.o prcmu.o cpu.o
+obj-y	+= lowlevel.o
arch/arm/cpu/armv7/vf610/Makefile +2 -23
index 7d3c454..68cb756 100644
@@ -4,26 +4,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	+= generic.o
-COBJS	+= timer.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= generic.o
+obj-y	+= timer.o
arch/arm/cpu/armv7/zynq/Makefile +4 -27
index de6b081..d382d49 100644
@@ -8,30 +8,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	:= timer.o
-COBJS-y	+= cpu.o
-COBJS-y	+= ddrc.o
-COBJS-y	+= slcr.o
-
-COBJS	:= $(COBJS-y)
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB): $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= timer.o
+obj-y	+= cpu.o
+obj-y	+= ddrc.o
+obj-y	+= slcr.o
Signature · 1 line
1.8.1.2
#8 lore raw

PATCH v2 3/19 arm926ejs: convert makefiles to Kbuild style

In reply to Masahiro Yamada

Note1:
In arch/arm/cpu/arm926ejs/spear/Makefile
START := start.o
was changed
extra-$(CONFIG_SPL_BUILD) := start.o
because spear/start.o is only used for SPL.

Note2:
START := start.o
was missing from arch/arm/cpu/arm926ejs/mxs/Makefile. This commit simply adds extra-$(CONFIG_SPL_BUILD) := start.o

---

Changes for v2
- No change

 arch/arm/cpu/arm926ejs/Makefile           | 28 ++-------------
 arch/arm/cpu/arm926ejs/armada100/Makefile | 23 +-----------
 arch/arm/cpu/arm926ejs/at91/Makefile      | 59 ++++++++++---------------------
 arch/arm/cpu/arm926ejs/davinci/Makefile   | 48 +++++++------------------
 arch/arm/cpu/arm926ejs/kirkwood/Makefile  | 31 +++-------------
 arch/arm/cpu/arm926ejs/lpc32xx/Makefile   | 23 +-----------
 arch/arm/cpu/arm926ejs/mb86r0x/Makefile   | 25 +------------
 arch/arm/cpu/arm926ejs/mx25/Makefile      | 23 +-----------
 arch/arm/cpu/arm926ejs/mx27/Makefile      | 23 +-----------
 arch/arm/cpu/arm926ejs/mxs/Makefile       | 26 ++------------
 arch/arm/cpu/arm926ejs/nomadik/Makefile   | 25 ++-----------
 arch/arm/cpu/arm926ejs/omap/Makefile      | 26 ++------------
 arch/arm/cpu/arm926ejs/orion5x/Makefile   | 29 +++------------
 arch/arm/cpu/arm926ejs/pantheon/Makefile  | 23 +-----------
 arch/arm/cpu/arm926ejs/spear/Makefile     | 36 +++++--------------
 arch/arm/cpu/arm926ejs/versatile/Makefile | 26 ++------------
 16 files changed, 67 insertions(+), 407 deletions(-)
arch/arm/cpu/arm926ejs/Makefile +3 -25
index b4c214c..1252995 100644
@@ -5,33 +5,11 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= cpu.o cache.o
+extra-y	= start.o
+obj-y	= cpu.o cache.o
 
 ifdef	CONFIG_SPL_BUILD
 ifdef	CONFIG_SPL_NO_CPU_SUPPORT_CODE
-START	:=
+extra-y	:=
 endif
 endif
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/arm/cpu/arm926ejs/armada100/Makefile +1 -22
index a1a6df0..fca98ef 100644
@@ -6,25 +6,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	= cpu.o timer.o dram.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= cpu.o timer.o dram.o
arch/arm/cpu/arm926ejs/at91/Makefile +19 -40

65 lines not on this page · raw message

arch/arm/cpu/arm926ejs/davinci/Makefile +13 -35

57 lines not on this page · raw message

arch/arm/cpu/arm926ejs/kirkwood/Makefile +5 -26
index 20ccf20..c230ce8 100644
@@ -6,29 +6,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	= cpu.o
-COBJS-y	+= dram.o
-COBJS-y	+= mpp.o
-COBJS-y	+= timer.o
-COBJS-y	+= cache.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= cpu.o
+obj-y	+= dram.o
+obj-y	+= mpp.o
+obj-y	+= timer.o
+obj-y	+= cache.o
arch/arm/cpu/arm926ejs/lpc32xx/Makefile +1 -22
index 603051a..314f004 100644
@@ -5,25 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB     = $(obj)lib$(SOC).o
-
-COBJS   = cpu.o clk.o devices.o timer.o
-
-SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS    := $(addprefix $(obj),$(COBJS) $(SOBJS))
-
-all:    $(obj).depend $(LIB)
-
-$(LIB): $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y   = cpu.o clk.o devices.o timer.o
arch/arm/cpu/arm926ejs/mb86r0x/Makefile +1 -24
index a780dfe..365892c 100644
@@ -5,27 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= clock.o reset.o timer.o
-SOBJS	=
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= clock.o reset.o timer.o
arch/arm/cpu/arm926ejs/mx25/Makefile +1 -22
index 75a09ff..134c69d 100644
@@ -4,25 +4,4 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= generic.o timer.o reset.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= generic.o timer.o reset.o
arch/arm/cpu/arm926ejs/mx27/Makefile +1 -22
index 53ffaf2..4976bbb 100644
@@ -4,25 +4,4 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= generic.o reset.o timer.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= generic.o reset.o timer.o
arch/arm/cpu/arm926ejs/mxs/Makefile +3 -23
index 3d66892..13b5a54 100644
@@ -5,25 +5,14 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-$(CONFIG_SPL_BUILD) := start.o
 
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= clock.o mxs.o iomux.o timer.o
+obj-y	= clock.o mxs.o iomux.o timer.o
 
 ifdef	CONFIG_SPL_BUILD
-COBJS	+= spl_boot.o spl_lradc_init.o spl_mem_init.o spl_power_init.o
+obj-y	+= spl_boot.o spl_lradc_init.o spl_mem_init.o spl_power_init.o
 endif
 
-SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
 # Specify the target for use in elftosb call
 ELFTOSB_TARGET-$(CONFIG_MX23) = imx23
 ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
@@ -33,12 +22,3 @@ $(OBJTREE)/u-boot.bd: $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd
 
 $(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/u-boot.bd
 		elftosb -zf $(ELFTOSB_TARGET-y) -c $(OBJTREE)/u-boot.bd -o $(OBJTREE)/u-boot.sb
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/arm/cpu/arm926ejs/nomadik/Makefile +2 -23
index 8896b0b..cdf1345 100644
@@ -5,26 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= timer.o gpio.o
-SOBJS	= reset.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS)) $(addprefix $(obj),$(SOBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= timer.o gpio.o
+obj-y	+= reset.o
arch/arm/cpu/arm926ejs/omap/Makefile +2 -24
index b519477..bd0a2fb 100644
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= timer.o cpuinfo.o
-SOBJS	= reset.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= timer.o cpuinfo.o
+obj-y	+= reset.o
arch/arm/cpu/arm926ejs/orion5x/Makefile +4 -25
index 8f36dc0..546ebcb 100644
@@ -9,31 +9,10 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	= cpu.o
-COBJS-y	+= dram.o
-COBJS-y	+= timer.o
+obj-y	= cpu.o
+obj-y	+= dram.o
+obj-y	+= timer.o
 
 ifndef CONFIG_SKIP_LOWLEVEL_INIT
-SOBJS	:= lowlevel_init.o
+obj-y	+= lowlevel_init.o
 endif
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/arm/cpu/arm926ejs/pantheon/Makefile +1 -22
index fb6bf63..988341f 100644
@@ -6,25 +6,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	= cpu.o timer.o dram.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= cpu.o timer.o dram.o
arch/arm/cpu/arm926ejs/spear/Makefile +8 -28
index 3006cd6..3f190bc 100644
@@ -5,37 +5,17 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	:= cpu.o \
+obj-y	:= cpu.o \
 	   reset.o \
 	   timer.o
 
 ifdef CONFIG_SPL_BUILD
-COBJS-y	+= spl.o spl_boot.o
-COBJS-$(CONFIG_SPEAR600) += spear600.o
-COBJS-$(CONFIG_DDR_MT47H64M16) += spr600_mt47h64m16_3_333_cl5_psync.o
-COBJS-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_333_cl5_psync.o
-COBJS-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_37e_166_cl4_sync.o
-COBJS-$(CONFIG_DDR_MT47H128M8) += spr600_mt47h128m8_3_266_cl5_async.o
+obj-y	+= spl.o spl_boot.o
+obj-$(CONFIG_SPEAR600) += spear600.o
+obj-$(CONFIG_DDR_MT47H64M16) += spr600_mt47h64m16_3_333_cl5_psync.o
+obj-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_333_cl5_psync.o
+obj-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_37e_166_cl4_sync.o
+obj-$(CONFIG_DDR_MT47H128M8) += spr600_mt47h128m8_3_266_cl5_async.o
 endif
 
-SRCS	:= $(START:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-$(CONFIG_SPL_BUILD) := start.o
arch/arm/cpu/arm926ejs/versatile/Makefile +2 -24
index d4659f9..907f516 100644
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	= timer.o
-SOBJS	= reset.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= timer.o
+obj-y	+= reset.o
Signature · 1 line
1.8.1.2
#9 lore raw

PATCH v2 4/19 arm920t: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 arch/arm/cpu/arm920t/Makefile         | 28 +++-------------------------
 arch/arm/cpu/arm920t/a320/Makefile    | 25 ++-----------------------
 arch/arm/cpu/arm920t/at91/Makefile    | 33 ++++++---------------------------
 arch/arm/cpu/arm920t/ep93xx/Makefile  | 24 ++----------------------
 arch/arm/cpu/arm920t/imx/Makefile     | 27 +++------------------------
 arch/arm/cpu/arm920t/ks8695/Makefile  | 26 ++------------------------
 arch/arm/cpu/arm920t/s3c24x0/Makefile | 29 ++++-------------------------
 7 files changed, 22 insertions(+), 170 deletions(-)
arch/arm/cpu/arm920t/Makefile +3 -25
index 4758f02..aac8043 100644
@@ -5,29 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	= start.o
 
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-
-COBJS-y	+= cpu.o
-COBJS-$(CONFIG_USE_IRQ)	+= interrupts.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpu.o
+obj-$(CONFIG_USE_IRQ)	+= interrupts.o
arch/arm/cpu/arm920t/a320/Makefile +2 -23
index 88c7d9b..bbdab58 100644
@@ -5,26 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-SOBJS	+= reset.o
-COBJS	+= timer.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= reset.o
+obj-y	+= timer.o
arch/arm/cpu/arm920t/at91/Makefile +6 -27
index b2b1e56..561b4b4 100644
@@ -5,30 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-SOBJS	+= lowlevel_init.o
-COBJS	+= reset.o
-COBJS	+= timer.o
-COBJS	+= clock.o
-COBJS	+= cpu.o
-COBJS	+= at91rm9200_devices.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= lowlevel_init.o
+obj-y	+= reset.o
+obj-y	+= timer.o
+obj-y	+= clock.o
+obj-y	+= cpu.o
+obj-y	+= at91rm9200_devices.o
arch/arm/cpu/arm920t/ep93xx/Makefile +2 -22
index 7a75c86..638333a 100644
@@ -16,26 +16,6 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
-include $(TOPDIR)/config.mk
 
-LIB = $(obj)lib$(SOC).o
-
-COBJS   = cpu.o led.o speed.o timer.o
-SOBJS   = lowlevel_init.o
-
-SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:    $(obj).depend $(LIB)
-
-$(LIB): $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y   = cpu.o led.o speed.o timer.o
+obj-y   += lowlevel_init.o
arch/arm/cpu/arm920t/imx/Makefile +3 -24
index c9c85b8..54ce646 100644
@@ -5,27 +5,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	+= generic.o
-COBJS	+= speed.o
-COBJS	+= timer.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= generic.o
+obj-y	+= speed.o
+obj-y	+= timer.o
arch/arm/cpu/arm920t/ks8695/Makefile +2 -24
index eef0530..400aa89 100644
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-SOBJS	= lowlevel_init.o
-
-COBJS	= timer.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= lowlevel_init.o
+obj-y	+= timer.o
arch/arm/cpu/arm920t/s3c24x0/Makefile +4 -25
index 9717533..e44c549 100644
@@ -5,28 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-$(CONFIG_USE_IRQ) += interrupts.o
-COBJS-$(CONFIG_DISPLAY_CPUINFO)	+= cpu_info.o
-COBJS-y	+= speed.o
-COBJS-y	+= timer.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_USE_IRQ) += interrupts.o
+obj-$(CONFIG_DISPLAY_CPUINFO)	+= cpu_info.o
+obj-y	+= speed.o
+obj-y	+= timer.o
Signature · 1 line
1.8.1.2
#10 lore raw

PATCH v2 5/19 arm720t: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 arch/arm/cpu/arm720t/Makefile              | 26 ++------------------------
 arch/arm/cpu/arm720t/tegra-common/Makefile | 25 ++-----------------------
 arch/arm/cpu/arm720t/tegra114/Makefile     | 25 ++-----------------------
 arch/arm/cpu/arm720t/tegra20/Makefile      | 23 +----------------------
 arch/arm/cpu/arm720t/tegra30/Makefile      | 23 +----------------------
 5 files changed, 8 insertions(+), 114 deletions(-)
arch/arm/cpu/arm720t/Makefile +2 -24
index 73e1635..243a123 100644
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= interrupts.o cpu.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-y	= start.o
+obj-y	= interrupts.o cpu.o
arch/arm/cpu/arm720t/tegra-common/Makefile +2 -23
index 37ec43f..a9c2b67 100644
@@ -7,26 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libtegra-common.o
-
-COBJS-$(CONFIG_SPL_BUILD) += spl.o
-COBJS-y	+= cpu.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_SPL_BUILD) += spl.o
+obj-y	+= cpu.o
arch/arm/cpu/arm720t/tegra114/Makefile +2 -23
index 6cf7fe9..ea3e55e 100644
@@ -17,26 +17,5 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-#COBJS-y	+= cpu.o t11x.o
-COBJS-y	+= cpu.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+#obj-y	+= cpu.o t11x.o
+obj-y	+= cpu.o
arch/arm/cpu/arm720t/tegra20/Makefile +1 -22
index eef5922..12243fa 100644
@@ -7,25 +7,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	+= cpu.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpu.o
arch/arm/cpu/arm720t/tegra30/Makefile +1 -22
index bd96997..6ff4c55 100644
@@ -17,25 +17,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS-y	+= cpu.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpu.o
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH v2 6/19 ARM: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 arch/arm/cpu/arm1136/Makefile           | 26 +---------
 arch/arm/cpu/arm1136/mx31/Makefile      | 27 ++---------
 arch/arm/cpu/arm1136/mx35/Makefile      | 28 ++---------
 arch/arm/cpu/arm1176/Makefile           | 26 +---------
 arch/arm/cpu/arm1176/bcm2835/Makefile   | 25 +---------
 arch/arm/cpu/arm1176/tnetv107x/Makefile | 27 +----------
 arch/arm/cpu/arm925t/Makefile           | 30 ++----------
 arch/arm/cpu/arm946es/Makefile          | 26 +---------
 arch/arm/cpu/arm_intcm/Makefile         | 26 +---------
 arch/arm/cpu/ixp/Makefile               | 30 ++----------
 arch/arm/cpu/pxa/Makefile               | 36 +++-----------
 arch/arm/cpu/sa1100/Makefile            | 28 ++---------
 arch/arm/cpu/tegra-common/Makefile      | 25 +---------
 arch/arm/cpu/tegra114-common/Makefile   | 23 +--------
 arch/arm/cpu/tegra20-common/Makefile    | 29 ++---------
 arch/arm/cpu/tegra30-common/Makefile    | 26 +---------
 arch/arm/lib/Makefile                   | 86 ++++++++++-----------------------
 17 files changed, 69 insertions(+), 455 deletions(-)
arch/arm/cpu/arm1136/Makefile +2 -24
index cc516f7..3279f12 100644
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= cpu.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-y	= start.o
+obj-y	= cpu.o
arch/arm/cpu/arm1136/mx31/Makefile +3 -24
index c75adec..9670ed9 100644
@@ -5,27 +5,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	+= generic.o
-COBJS	+= timer.o
-COBJS	+= devices.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= generic.o
+obj-y	+= timer.o
+obj-y	+= devices.o
arch/arm/cpu/arm1136/mx35/Makefile +3 -25
index ee534a9..c533215 100644
@@ -7,28 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	+= generic.o
-COBJS	+= timer.o
-COBJS	+= mx35_sdram.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= generic.o
+obj-y	+= timer.o
+obj-y	+= mx35_sdram.o
arch/arm/cpu/arm1176/Makefile +2 -24
index 5d451a7..deec427 100644
@@ -8,27 +8,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= cpu.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-y	= start.o
+obj-y	= cpu.o
arch/arm/cpu/arm1176/bcm2835/Makefile +2 -23
index 135de42..0ad3690 100644
@@ -12,26 +12,5 @@
 # GNU General Public License for more details.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-SOBJS	:= lowlevel_init.o
-COBJS	:= init.o reset.o timer.o mbox.o
-
-SRCS	:= $(SOBJS:.o=.c) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= lowlevel_init.o
+obj-y	+= init.o reset.o timer.o mbox.o
arch/arm/cpu/arm1176/tnetv107x/Makefile +2 -25
index 1eb27ed..a4c1edf 100644
@@ -2,28 +2,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC).o
-
-COBJS	+= aemif.o clock.o init.o mux.o timer.o
-SOBJS	+= lowlevel_init.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= aemif.o clock.o init.o mux.o timer.o
+obj-y	+= lowlevel_init.o
arch/arm/cpu/arm925t/Makefile +4 -26
index 40d2156..ffe2ff5 100644
@@ -5,30 +5,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	= start.o
 
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-
-COBJS	+= cpu.o
-COBJS	+= omap925.o
-COBJS	+= timer.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpu.o
+obj-y	+= omap925.o
+obj-y	+= timer.o
arch/arm/cpu/arm946es/Makefile +2 -24
index 87e6c65..a44bddc 100644
@@ -5,28 +5,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	= start.o
 
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-
-COBJS	= cpu.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	= cpu.o
arch/arm/cpu/arm_intcm/Makefile +2 -24
index cc516f7..3279f12 100644
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= cpu.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-y	= start.o
+obj-y	= cpu.o
arch/arm/cpu/ixp/Makefile +4 -26
index 788598e..4e66523 100644
@@ -5,30 +5,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	= start.o
 
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-
-COBJS-y	+= cpu.o
-COBJS-$(CONFIG_USE_IRQ)	+= interrupts.o
-COBJS-y	+= timer.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpu.o
+obj-$(CONFIG_USE_IRQ)	+= interrupts.o
+obj-y	+= timer.o
arch/arm/cpu/pxa/Makefile +6 -30
index c84186a..8cd475e 100644
@@ -5,35 +5,11 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	= start.o
 
-LIB	= $(obj)lib$(CPU).o
+obj-$(CONFIG_CPU_PXA25X)	+= pxa2xx.o
+obj-$(CONFIG_CPU_PXA27X)	+= pxa2xx.o
 
-START	= start.o
-
-COBJS-$(CONFIG_CPU_PXA25X)	= pxa2xx.o
-COBJS-$(CONFIG_CPU_PXA27X)	= pxa2xx.o
-
-COBJS-y	+= cpuinfo.o
-
-COBJS	= $(COBJS-y)
-COBJS	+= timer.o
-COBJS	+= usb.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpuinfo.o
+obj-y	+= timer.o
+obj-y	+= usb.o
arch/arm/cpu/sa1100/Makefile +3 -25
index c84b7b9..85a0d28 100644
@@ -5,29 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y	= start.o
 
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-
-COBJS	+= cpu.o
-COBJS	+= timer.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= cpu.o
+obj-y	+= timer.o
arch/arm/cpu/tegra-common/Makefile +2 -23
index 1b6cdf7..3aac655 100644
@@ -7,26 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-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))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y += lowlevel_init.o
+obj-y	+= ap.o board.o sys_info.o timer.o clock.o cache.o
arch/arm/cpu/tegra114-common/Makefile +1 -22
index 5b53a71..d959b57 100644
@@ -17,25 +17,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(SOC)-common.o
-
-COBJS-y	+= clock.o funcmux.o pinmux.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= clock.o funcmux.o pinmux.o
arch/arm/cpu/tegra20-common/Makefile +4 -25
index 175387f..32ddbda 100644
@@ -7,32 +7,11 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 # The AVP is ARMv4T architecture so we must use special compiler
 # flags for any startup files it might use.
 CFLAGS_arch/arm/cpu/tegra20-common/warmboot_avp.o += -march=armv4t
 
-LIB	= $(obj)lib$(SOC)-common.o
-
-COBJS-y	+= clock.o funcmux.o pinmux.o
-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))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= clock.o funcmux.o pinmux.o
+obj-$(CONFIG_TEGRA_LP0) += warmboot.o crypto.o warmboot_avp.o
+obj-$(CONFIG_TEGRA_CLOCK_SCALING) += emc.o
+obj-$(CONFIG_TEGRA_PMU) += pmu.o
arch/arm/cpu/tegra30-common/Makefile +1 -25
index 75fef32..d2d616e 100644
@@ -17,28 +17,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-include $(TOPDIR)/config.mk
-
-# The AVP is ARMv4T architecture so we must use special compiler
-# flags for any startup files it might use.
-
-LIB	= $(obj)lib$(SOC)-common.o
-
-COBJS-y	+= clock.o funcmux.o pinmux.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= clock.o funcmux.o pinmux.o
arch/arm/lib/Makefile +26 -60

103 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#12 lore raw

PATCH v2 7/19 ARM: imx-common: convert makefiles to Kbuild style

In reply to Masahiro Yamada

Multiple targets are included in arch/arm/imx-common/Makefile In order to refactor it,
we need to tweak Makefile and spl/Makefile.

---

Changes for v2
- No change

 Makefile                     |  8 +++++---
 arch/arm/imx-common/Makefile | 35 ++++++-----------------------------
 spl/Makefile                 |  4 +++-
 3 files changed, 14 insertions(+), 33 deletions(-)
Makefile +5 -3
index 36bbd09..66c8c66 100644
@@ -414,6 +414,8 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin
 endif
 endif
 
+build := -f $(TOPDIR)/scripts/Makefile.build -C
+
 all:		$(ALL-y) $(SUBDIR_EXAMPLES)
 
 $(obj)u-boot.dtb:	checkdtc $(obj)u-boot
@@ -461,7 +463,7 @@ $(obj)u-boot.img:	$(obj)u-boot.bin
 		-d $< $@
 
 $(obj)u-boot.imx: $(obj)u-boot.bin depend
-		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
+		$(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
 
 $(obj)u-boot.kwb:       $(obj)u-boot.bin
 		$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
@@ -499,11 +501,11 @@ $(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin
 		$(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
 
 $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+		$(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
 			$(OBJTREE)/u-boot-with-spl.imx
 
 $(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+		$(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
 			$(OBJTREE)/u-boot-with-nand-spl.imx
 
 $(obj)u-boot.ubl:       $(obj)u-boot-with-spl.bin
arch/arm/imx-common/Makefile +6 -29
index 727a052..50873d8 100644
@@ -7,31 +7,18 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB     = $(obj)libimx-common.o
-
 ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610))
-COBJS-y	= iomux-v3.o
+obj-y	= iomux-v3.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
-COBJS-y	+= timer.o cpu.o speed.o
-COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o
+obj-y	+= timer.o cpu.o speed.o
+obj-$(CONFIG_I2C_MXC) += i2c-mxv7.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
-COBJS-y	+= misc.o
+obj-y	+= misc.o
 endif
-COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o
-COBJS-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
-COBJS	:= $(sort $(COBJS-y))
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
+obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
+obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
 
 $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/%
 	mkdir -p $(dir $@)
@@ -67,13 +54,3 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
 		$(OBJTREE)/u-boot.uim
 	cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@
 	rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
spl/Makefile +3 -1
index 48f2c65..3197d61 100644
@@ -153,6 +153,8 @@ ifeq ($(wildcard $(LDSCRIPT)),)
 $(error could not find linker script)
 endif
 
+build := -f $(TOPDIR)/scripts/Makefile.build -C
+
 # Special flags for CPP when processing the linker script.
 # Pass the version down so we can handle backwards compatibility
 # on the fly.
@@ -172,7 +174,7 @@ $(OBJTREE)/MLO.byteswap: $(obj)u-boot-spl.bin
 		-a $(CONFIG_SPL_TEXT_BASE) -d $< $@
 
 $(OBJTREE)/SPL : $(obj)u-boot-spl.bin depend
-		$(MAKE) -C $(SRCTREE)/arch/arm/imx-common $@
+		$(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $@
 
 ALL-y	+= $(obj)$(SPL_BIN).bin
 
Signature · 1 line
1.8.1.2
#13 lore raw

PATCH v2 8/19 drivers: net: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 drivers/net/Makefile     | 136 ++++++++++++++++++++---------------------------
 drivers/net/fm/Makefile  |  59 +++++++-------------
 drivers/net/npe/Makefile |  24 +--------
 drivers/net/phy/Makefile |  60 +++++++--------------
 4 files changed, 96 insertions(+), 183 deletions(-)
drivers/net/Makefile +57 -79
index 18fd54f..7f9ce90 100644
@@ -5,83 +5,61 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libnet.o
-
-COBJS-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
-COBJS-$(CONFIG_ALTERA_TSE) += altera_tse.o
-COBJS-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
-COBJS-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
-COBJS-$(CONFIG_DRIVER_AX88180) += ax88180.o
-COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
-COBJS-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o
-COBJS-$(CONFIG_CS8900) += cs8900.o
-COBJS-$(CONFIG_TULIP) += dc2114x.o
-COBJS-$(CONFIG_DESIGNWARE_ETH) += designware.o
-COBJS-$(CONFIG_DRIVER_DM9000) += dm9000x.o
-COBJS-$(CONFIG_DNET) += dnet.o
-COBJS-$(CONFIG_E1000) += e1000.o
-COBJS-$(CONFIG_E1000_SPI) += e1000_spi.o
-COBJS-$(CONFIG_EEPRO100) += eepro100.o
-COBJS-$(CONFIG_ENC28J60) += enc28j60.o
-COBJS-$(CONFIG_EP93XX) += ep93xx_eth.o
-COBJS-$(CONFIG_ETHOC) += ethoc.o
-COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o
-COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
-COBJS-$(CONFIG_FTGMAC100) += ftgmac100.o
-COBJS-$(CONFIG_FTMAC110) += ftmac110.o
-COBJS-$(CONFIG_FTMAC100) += ftmac100.o
-COBJS-$(CONFIG_GRETH) += greth.o
-COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
-COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
-COBJS-$(CONFIG_KS8851_MLL) += ks8851_mll.o
-COBJS-$(CONFIG_LAN91C96) += lan91c96.o
-COBJS-$(CONFIG_MACB) += macb.o
-COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
-COBJS-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
-COBJS-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
-COBJS-$(CONFIG_MVGBE) += mvgbe.o
-COBJS-$(CONFIG_NATSEMI) += natsemi.o
-COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
-COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
-COBJS-$(CONFIG_NETCONSOLE) += netconsole.o
-COBJS-$(CONFIG_NS8382X) += ns8382x.o
-COBJS-$(CONFIG_PCNET) += pcnet.o
-COBJS-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
-COBJS-$(CONFIG_RTL8139) += rtl8139.o
-COBJS-$(CONFIG_RTL8169) += rtl8169.o
-COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
-COBJS-$(CONFIG_SMC91111) += smc91111.o
-COBJS-$(CONFIG_SMC911X) += smc911x.o
-COBJS-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o
-COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
-COBJS-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
-COBJS-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o
-COBJS-$(CONFIG_FMAN_ENET) += fsl_mdio.o
-COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
-COBJS-$(CONFIG_ULI526X) += uli526x.o
-COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
-COBJS-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o
-COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
-COBJS-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
+obj-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
+obj-$(CONFIG_ALTERA_TSE) += altera_tse.o
+obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
+obj-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
+obj-$(CONFIG_DRIVER_AX88180) += ax88180.o
+obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
+obj-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o
+obj-$(CONFIG_CS8900) += cs8900.o
+obj-$(CONFIG_TULIP) += dc2114x.o
+obj-$(CONFIG_DESIGNWARE_ETH) += designware.o
+obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o
+obj-$(CONFIG_DNET) += dnet.o
+obj-$(CONFIG_E1000) += e1000.o
+obj-$(CONFIG_E1000_SPI) += e1000_spi.o
+obj-$(CONFIG_EEPRO100) += eepro100.o
+obj-$(CONFIG_ENC28J60) += enc28j60.o
+obj-$(CONFIG_EP93XX) += ep93xx_eth.o
+obj-$(CONFIG_ETHOC) += ethoc.o
+obj-$(CONFIG_FEC_MXC) += fec_mxc.o
+obj-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
+obj-$(CONFIG_FTGMAC100) += ftgmac100.o
+obj-$(CONFIG_FTMAC110) += ftmac110.o
+obj-$(CONFIG_FTMAC100) += ftmac100.o
+obj-$(CONFIG_GRETH) += greth.o
+obj-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
+obj-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
+obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
+obj-$(CONFIG_LAN91C96) += lan91c96.o
+obj-$(CONFIG_MACB) += macb.o
+obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
+obj-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
+obj-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
+obj-$(CONFIG_MVGBE) += mvgbe.o
+obj-$(CONFIG_NATSEMI) += natsemi.o
+obj-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
+obj-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
+obj-$(CONFIG_NETCONSOLE) += netconsole.o
+obj-$(CONFIG_NS8382X) += ns8382x.o
+obj-$(CONFIG_PCNET) += pcnet.o
+obj-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
+obj-$(CONFIG_RTL8139) += rtl8139.o
+obj-$(CONFIG_RTL8169) += rtl8169.o
+obj-$(CONFIG_SH_ETHER) += sh_eth.o
+obj-$(CONFIG_SMC91111) += smc91111.o
+obj-$(CONFIG_SMC911X) += smc911x.o
+obj-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o
+obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
+obj-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
+obj-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o
+obj-$(CONFIG_FMAN_ENET) += fsl_mdio.o
+obj-$(CONFIG_TSI108_ETH) += tsi108_eth.o
+obj-$(CONFIG_ULI526X) += uli526x.o
+obj-$(CONFIG_VSC7385_ENET) += vsc7385.o
+obj-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o
+obj-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+obj-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
 		xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o
-COBJS-$(CONFIG_ZYNQ_GEM) += zynq_gem.o
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_ZYNQ_GEM) += zynq_gem.o
drivers/net/fm/Makefile +19 -40

69 lines not on this page · raw message

drivers/net/npe/Makefile +1 -23
index a982678..7fa5ea6 100644
@@ -5,16 +5,12 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB := $(obj)libnpe.o
-
 LOCAL_CFLAGS  += -I$(TOPDIR)/drivers/net/npe/include -DCONFIG_IXP425_COMPONENT_ETHDB -D__linux
 CFLAGS  += $(LOCAL_CFLAGS)
 CPPFLAGS  += $(LOCAL_CFLAGS) # needed for depend
 HOSTCFLAGS  += $(LOCAL_CFLAGS)
 
-COBJS-$(CONFIG_IXP4XX_NPE) := npe.o \
+obj-$(CONFIG_IXP4XX_NPE) := npe.o \
 	miiphy.o \
 	IxOsalBufferMgt.o \
 	IxOsalIoMem.o \
@@ -63,21 +59,3 @@ COBJS-$(CONFIG_IXP4XX_NPE) := npe.o \
 	IxNpeMhSend.o \
 	IxNpeMhSolicitedCbMgr.o \
 	IxNpeMhUnsolicitedCbMgr.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
drivers/net/phy/Makefile +19 -41

63 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#14 lore raw

PATCH v2 9/19 drivers: mtd: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 drivers/mtd/Makefile         |  44 +++++--------------
 drivers/mtd/nand/Makefile    | 102 +++++++++++++++++--------------------------
 drivers/mtd/onenand/Makefile |  27 ++----------
 drivers/mtd/spi/Makefile     |  48 ++++++--------------
 drivers/mtd/ubi/Makefile     |  28 ++----------
 5 files changed, 70 insertions(+), 179 deletions(-)
drivers/mtd/Makefile +11 -33
index d2c3bda..5467a95 100644
@@ -5,38 +5,16 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libmtd.o
-
 ifneq (,$(findstring y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)))
-COBJS-y += mtdcore.o
+obj-y += mtdcore.o
 endif
-COBJS-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
-COBJS-$(CONFIG_MTD_CONCAT) += mtdconcat.o
-COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
-COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
-COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
-COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
-COBJS-$(CONFIG_FTSMC020) += ftsmc020.o
-COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
-COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
-COBJS-$(CONFIG_ST_SMI) += st_smi.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
+obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o
+obj-$(CONFIG_HAS_DATAFLASH) += at45.o
+obj-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
+obj-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
+obj-$(CONFIG_HAS_DATAFLASH) += dataflash.o
+obj-$(CONFIG_FTSMC020) += ftsmc020.o
+obj-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
+obj-$(CONFIG_MW_EEPROM) += mw_eeprom.o
+obj-$(CONFIG_ST_SMI) += st_smi.o
drivers/mtd/nand/Makefile +40 -62

127 lines not on this page · raw message

drivers/mtd/onenand/Makefile +3 -24
index 993d317..b249348 100644
@@ -5,30 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libonenand.o
-
 ifndef	CONFIG_SPL_BUILD
-COBJS-$(CONFIG_CMD_ONENAND)	:= onenand_uboot.o onenand_base.o onenand_bbt.o
-COBJS-$(CONFIG_SAMSUNG_ONENAND)	+= samsung.o
+obj-$(CONFIG_CMD_ONENAND)	:= onenand_uboot.o onenand_base.o onenand_bbt.o
+obj-$(CONFIG_SAMSUNG_ONENAND)	+= samsung.o
 else
-COBJS-y				:= onenand_spl.o
+obj-y				:= onenand_spl.o
 endif
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB): $(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
drivers/mtd/spi/Makefile +13 -35

54 lines not on this page · raw message

drivers/mtd/ubi/Makefile +3 -25
index 1a88e94..e1f3a24 100644
@@ -5,31 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-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
+obj-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
+obj-y += misc.o
+obj-y += debug.o
 endif
-
-COBJS	:= $(COBJS-y)
-SRCS 	:= $(COBJS:.o=.c)
-OBJS 	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
Signature · 1 line
1.8.1.2
#15 lore raw

PATCH v2 10/19 drivers: usb: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 drivers/usb/eth/Makefile      | 28 ++--------------
 drivers/usb/gadget/Makefile   | 54 ++++++++++---------------------
 drivers/usb/host/Makefile     | 74 +++++++++++++++----------------------------
 drivers/usb/musb-new/Makefile | 36 ++++-----------------
 drivers/usb/musb/Makefile     | 36 ++++-----------------
 drivers/usb/phy/Makefile      | 24 +-------------
 drivers/usb/ulpi/Makefile     | 28 ++--------------
 7 files changed, 62 insertions(+), 218 deletions(-)
drivers/usb/eth/Makefile +3 -25
index 04a8b58..03f5474 100644
@@ -3,31 +3,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libusb_eth.o
-
 # new USB host ethernet layer dependencies
-COBJS-$(CONFIG_USB_HOST_ETHER) += usb_ether.o
+obj-$(CONFIG_USB_HOST_ETHER) += usb_ether.o
 ifdef CONFIG_USB_ETHER_ASIX
-COBJS-y += asix.o
+obj-y += asix.o
 endif
-COBJS-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
drivers/usb/gadget/Makefile +16 -38

72 lines not on this page · raw message

drivers/usb/host/Makefile +26 -48

83 lines not on this page · raw message

drivers/usb/musb-new/Makefile +6 -30
index c23bef1..ba72348 100644
@@ -2,38 +2,14 @@
 # for USB OTG silicon based on Mentor Graphics INVENTRA designs
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libusb_musb-new.o
-
-COBJS-$(CONFIG_MUSB_GADGET) += musb_gadget.o musb_gadget_ep0.o musb_core.o
-COBJS-$(CONFIG_MUSB_GADGET) += musb_uboot.o
-COBJS-$(CONFIG_MUSB_HOST) += musb_host.o musb_core.o musb_uboot.o
-COBJS-$(CONFIG_USB_MUSB_DSPS) += musb_dsps.o
-COBJS-$(CONFIG_USB_MUSB_AM35X) += am35x.o
-COBJS-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
+obj-$(CONFIG_MUSB_GADGET) += musb_gadget.o musb_gadget_ep0.o musb_core.o
+obj-$(CONFIG_MUSB_GADGET) += musb_uboot.o
+obj-$(CONFIG_MUSB_HOST) += musb_host.o musb_core.o musb_uboot.o
+obj-$(CONFIG_USB_MUSB_DSPS) += musb_dsps.o
+obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
+obj-$(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)
 CFLAGS += $(CFLAGS_NO_WARN)
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-#$(LIB):	$(OBJS)
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
-
drivers/usb/musb/Makefile +7 -29
index aa2126d..3c9ed98 100644
@@ -5,32 +5,10 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libusb_musb.o
-
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_MUSB_UDC) += musb_udc.o musb_core.o
-COBJS-$(CONFIG_USB_BLACKFIN) += blackfin_usb.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
-COBJS-$(CONFIG_USB_OMAP3) += omap3.o
-COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
-COBJS-$(CONFIG_USB_AM35X) += am35x.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
+obj-$(CONFIG_MUSB_UDC) += musb_udc.o musb_core.o
+obj-$(CONFIG_USB_BLACKFIN) += blackfin_usb.o
+obj-$(CONFIG_USB_DAVINCI) += davinci.o
+obj-$(CONFIG_USB_OMAP3) += omap3.o
+obj-$(CONFIG_USB_DA8XX) += da8xx.o
+obj-$(CONFIG_USB_AM35X) += am35x.o
drivers/usb/phy/Makefile +1 -23
index f93121a..535cf51 100644
@@ -5,26 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libusb_phy.o
-
-COBJS-$(CONFIG_TWL4030_USB) += twl4030.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_TWL4030_USB) += twl4030.o
drivers/usb/ulpi/Makefile +3 -25
index ba5a1ab..a21fe2c 100644
@@ -4,28 +4,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libusb_ulpi.o
-
-COBJS-$(CONFIG_USB_ULPI)		+= ulpi.o
-COBJS-$(CONFIG_USB_ULPI_VIEWPORT)	+= ulpi-viewport.o
-COBJS-$(CONFIG_USB_ULPI_VIEWPORT_OMAP)	+= omap-ulpi-viewport.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_USB_ULPI)		+= ulpi.o
+obj-$(CONFIG_USB_ULPI_VIEWPORT)	+= ulpi-viewport.o
+obj-$(CONFIG_USB_ULPI_VIEWPORT_OMAP)	+= omap-ulpi-viewport.o
Signature · 1 line
1.8.1.2
#16 lore raw

PATCH v2 11/19 drivers: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changed for v2:

- updated 6 files to rebase on the master
drivers/serial/Makefile
drivers/mmc/Makefile
drivers/video/Makefile
drivers/watchdog/Makefile
drivers/rtc/Makefile
drivers/i2c/Makefile

 drivers/bios_emulator/Makefile    |  23 +-------
 drivers/block/Makefile            |  52 ++++++------------
 drivers/bootcount/Makefile        |  30 ++---------
 drivers/crypto/Makefile           |  25 +--------
 drivers/dfu/Makefile              |  25 ++-------
 drivers/dma/Makefile              |  30 ++---------
 drivers/fpga/Makefile             |  44 ++++------------
 drivers/gpio/Makefile             |  73 +++++++++-----------------
 drivers/hwmon/Makefile            |  40 ++++----------
 drivers/i2c/Makefile              |  68 ++++++++----------------
 drivers/input/Makefile            |  36 +++----------
 drivers/misc/Makefile             |  52 ++++++------------
 drivers/mmc/Makefile              |  71 +++++++++----------------
 drivers/pci/Makefile              |  44 ++++------------
 drivers/pcmcia/Makefile           |  34 +++---------
 drivers/power/Makefile            |  47 +++++------------
 drivers/power/battery/Makefile    |  25 +--------
 drivers/power/fuel_gauge/Makefile |  25 +--------
 drivers/power/pmic/Makefile       |  31 ++---------
 drivers/qe/Makefile               |  25 +--------
 drivers/rtc/Makefile              | 108 +++++++++++++++-----------------------
 drivers/serial/Makefile           |  82 +++++++++++------------------
 drivers/sound/Makefile            |  30 ++---------
 drivers/spi/Makefile              |  82 +++++++++++------------------
 drivers/tpm/Makefile              |  29 ++--------
 drivers/twserial/Makefile         |  24 +--------
 drivers/video/Makefile            |  86 +++++++++++-------------------
 drivers/watchdog/Makefile         |  38 +++-----------
 28 files changed, 332 insertions(+), 947 deletions(-)
drivers/bios_emulator/Makefile +1 -22
index d94a144..dd42e0f 100644
@@ -1,12 +1,8 @@
-include $(TOPDIR)/config.mk
-
-LIB := $(obj)libatibiosemu.o
-
 X86DIR  = x86emu
 
 $(shell mkdir -p $(obj)$(X86DIR))
 
-COBJS-$(CONFIG_BIOSEMU)	= atibios.o biosemu.o besys.o bios.o \
+obj-$(CONFIG_BIOSEMU)	= atibios.o biosemu.o besys.o bios.o \
 	$(X86DIR)/decode.o \
 	$(X86DIR)/ops2.o \
 	$(X86DIR)/ops.o \
@@ -14,26 +10,9 @@ COBJS-$(CONFIG_BIOSEMU)	= atibios.o biosemu.o besys.o bios.o \
 	$(X86DIR)/sys.o \
 	$(X86DIR)/debug.o
 
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
 EXTRA_CFLAGS += -I. -I./include -I$(TOPDIR)/include \
 	-D__PPC__  -D__BIG_ENDIAN__
 
 CFLAGS += $(EXTRA_CFLAGS)
 HOSTCFLAGS += $(EXTRA_CFLAGS)
 CPPFLAGS += $(EXTRA_CFLAGS)
-
-all:	$(LIB)
-
-$(LIB): $(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
drivers/block/Makefile +15 -37

55 lines not on this page · raw message

drivers/bootcount/Makefile +5 -25
index 2b517b6..012acef 100644
@@ -2,28 +2,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB 	:= $(obj)libbootcount.o
-
-COBJS-y				+= bootcount.o
-COBJS-$(CONFIG_AT91SAM9XE)	+= bootcount_at91.o
-COBJS-$(CONFIG_BLACKFIN)	+= bootcount_blackfin.o
-COBJS-$(CONFIG_SOC_DA8XX)	+= bootcount_davinci.o
-COBJS-$(CONFIG_BOOTCOUNT_RAM)	+= bootcount_ram.o
-
-COBJS	:= $(COBJS-y)
-SRCS 	:= $(COBJS:.o=.c)
-OBJS 	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-########################################################################
+obj-y				+= bootcount.o
+obj-$(CONFIG_AT91SAM9XE)	+= bootcount_at91.o
+obj-$(CONFIG_BLACKFIN)		+= bootcount_blackfin.o
+obj-$(CONFIG_SOC_DA8XX)		+= bootcount_davinci.o
+obj-$(CONFIG_BOOTCOUNT_RAM)	+= bootcount_ram.o
drivers/crypto/Makefile +1 -24
index 02c53bf..b807795 100644
@@ -5,27 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libcrypto.o
-
-COBJS-$(CONFIG_EXYNOS_ACE_SHA)	+= ace_sha.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-########################################################################
+obj-$(CONFIG_EXYNOS_ACE_SHA)	+= ace_sha.o
drivers/dfu/Makefile +3 -22
index fca370a..f7b7014 100644
@@ -5,25 +5,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libdfu.o
-
-COBJS-$(CONFIG_DFU_FUNCTION) += dfu.o
-COBJS-$(CONFIG_DFU_MMC) += dfu_mmc.o
-COBJS-$(CONFIG_DFU_NAND) += dfu_nand.o
-
-SRCS    := $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_DFU_FUNCTION) += dfu.o
+obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
+obj-$(CONFIG_DFU_NAND) += dfu_nand.o
drivers/dma/Makefile +4 -26
index a6132e2..8b2821b 100644
@@ -5,29 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libdma.o
-
-COBJS-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
-COBJS-$(CONFIG_APBH_DMA) += apbh_dma.o
-COBJS-$(CONFIG_FSL_DMA) += fsl_dma.o
-COBJS-$(CONFIG_OMAP3_DMA) += omap3_dma.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o
+obj-$(CONFIG_APBH_DMA) += apbh_dma.o
+obj-$(CONFIG_FSL_DMA) += fsl_dma.o
+obj-$(CONFIG_OMAP3_DMA) += omap3_dma.o
drivers/fpga/Makefile +11 -33

51 lines not on this page · raw message

drivers/gpio/Makefile +25 -48

76 lines not on this page · raw message

drivers/hwmon/Makefile +9 -31
index 6e203a3..a78a724 100644
@@ -8,36 +8,14 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 #CFLAGS += -DDEBUG
 
-LIB	= $(obj)libhwmon.o
-
-COBJS-$(CONFIG_DTT_ADM1021) += adm1021.o
-COBJS-$(CONFIG_DTT_ADT7460) += adt7460.o
-COBJS-$(CONFIG_DTT_DS1621) += ds1621.o
-COBJS-$(CONFIG_DTT_DS1722) += ds1722.o
-COBJS-$(CONFIG_DTT_DS1775) += ds1775.o
-COBJS-$(CONFIG_DTT_LM63) += lm63.o
-COBJS-$(CONFIG_DTT_LM73) += lm73.o
-COBJS-$(CONFIG_DTT_LM75) += lm75.o
-COBJS-$(CONFIG_DTT_LM81) += lm81.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_DTT_ADM1021) += adm1021.o
+obj-$(CONFIG_DTT_ADT7460) += adt7460.o
+obj-$(CONFIG_DTT_DS1621) += ds1621.o
+obj-$(CONFIG_DTT_DS1722) += ds1722.o
+obj-$(CONFIG_DTT_DS1775) += ds1775.o
+obj-$(CONFIG_DTT_LM63) += lm63.o
+obj-$(CONFIG_DTT_LM73) += lm73.o
+obj-$(CONFIG_DTT_LM75) += lm75.o
+obj-$(CONFIG_DTT_LM81) += lm81.o
drivers/i2c/Makefile +23 -45

71 lines not on this page · raw message

drivers/input/Makefile +7 -29
index 7885403..a8e9be2 100644
@@ -5,34 +5,12 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libinput.o
-
-COBJS-$(CONFIG_I8042_KBD) += i8042.o
-COBJS-$(CONFIG_TEGRA_KEYBOARD) += tegra-kbc.o
-COBJS-$(CONFIG_CROS_EC_KEYB) += cros_ec_keyb.o
+obj-$(CONFIG_I8042_KBD) += i8042.o
+obj-$(CONFIG_TEGRA_KEYBOARD) += tegra-kbc.o
+obj-$(CONFIG_CROS_EC_KEYB) += cros_ec_keyb.o
 ifdef CONFIG_PS2KBD
-COBJS-y += keyboard.o pc_keyb.o
-COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
+obj-y += keyboard.o pc_keyb.o
+obj-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
 endif
-COBJS-y += input.o
-COBJS-$(CONFIG_OF_CONTROL) += key_matrix.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y += input.o
+obj-$(CONFIG_OF_CONTROL) += key_matrix.o
drivers/misc/Makefile +15 -37

55 lines not on this page · raw message

drivers/mmc/Makefile +24 -47

77 lines not on this page · raw message

drivers/pci/Makefile +11 -33

47 lines not on this page · raw message

drivers/pcmcia/Makefile +6 -28
index 80a132e..ae3cafb 100644
@@ -5,31 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libpcmcia.o
-
-COBJS-$(CONFIG_I82365) += i82365.o
-COBJS-$(CONFIG_8xx) += mpc8xx_pcmcia.o
-COBJS-y += rpx_pcmcia.o
-COBJS-$(CONFIG_IDE_TI_CARDBUS) += ti_pci1410a.o
-COBJS-y += tqm8xx_pcmcia.o
-COBJS-$(CONFIG_MARUBUN_PCCARD) += marubun_pcmcia.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_I82365) += i82365.o
+obj-$(CONFIG_8xx) += mpc8xx_pcmcia.o
+obj-y += rpx_pcmcia.o
+obj-$(CONFIG_IDE_TI_CARDBUS) += ti_pci1410a.o
+obj-y += tqm8xx_pcmcia.o
+obj-$(CONFIG_MARUBUN_PCCARD) += marubun_pcmcia.o
drivers/power/Makefile +12 -35

50 lines not on this page · raw message

drivers/power/battery/Makefile +1 -24
index 637d1ff..a1f6ad9 100644
@@ -5,27 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libbattery.o
-
-COBJS-$(CONFIG_POWER_BATTERY_TRATS) += bat_trats.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-########################################################################
+obj-$(CONFIG_POWER_BATTERY_TRATS) += bat_trats.o
drivers/power/fuel_gauge/Makefile +1 -24
index 5166a30..3b349f9 100644
@@ -5,27 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libfuel_gauge.o
-
-COBJS-$(CONFIG_POWER_FG_MAX17042) += fg_max17042.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-########################################################################
+obj-$(CONFIG_POWER_FG_MAX17042) += fg_max17042.o
drivers/power/pmic/Makefile +4 -27
index f054470..476cae5 100644
@@ -5,30 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libpmic.o
-
-COBJS-$(CONFIG_POWER_MAX8998) += pmic_max8998.o
-COBJS-$(CONFIG_POWER_MAX8997) += pmic_max8997.o
-COBJS-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
-COBJS-$(CONFIG_POWER_MAX77686) += pmic_max77686.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-########################################################################
+obj-$(CONFIG_POWER_MAX8998) += pmic_max8998.o
+obj-$(CONFIG_POWER_MAX8997) += pmic_max8997.o
+obj-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
+obj-$(CONFIG_POWER_MAX77686) += pmic_max77686.o
drivers/qe/Makefile +2 -23
index 3aaf757..b8c15f8 100644
@@ -4,26 +4,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libqe.o
-
-COBJS-$(and $(CONFIG_QE),$(CONFIG_OF_LIBFDT)) += fdt.o
-COBJS-$(CONFIG_QE) += qe.o uccf.o uec.o uec_phy.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(and $(CONFIG_QE),$(CONFIG_OF_LIBFDT)) += fdt.o
+obj-$(CONFIG_QE) += qe.o uccf.o uec.o uec_phy.o
drivers/rtc/Makefile +43 -65

113 lines not on this page · raw message

drivers/serial/Makefile +30 -52

88 lines not on this page · raw message

drivers/sound/Makefile +4 -26
index c50dd15..6d25292 100644
@@ -5,29 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libsound.o
-
-COBJS-$(CONFIG_SOUND)	+= sound.o
-COBJS-$(CONFIG_I2S)	+= samsung-i2s.o
-COBJS-$(CONFIG_SOUND_WM8994)	+= wm8994.o
-COBJS-$(CONFIG_SOUND_MAX98095)	+= max98095.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_SOUND)	+= sound.o
+obj-$(CONFIG_I2S)	+= samsung-i2s.o
+obj-$(CONFIG_SOUND_WM8994)	+= wm8994.o
+obj-$(CONFIG_SOUND_MAX98095)	+= max98095.o
drivers/spi/Makefile +30 -52

86 lines not on this page · raw message

drivers/tpm/Makefile +4 -25
index 4457a78..4b8cbec 100644
@@ -3,31 +3,10 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB := $(obj)libtpm.o
-
 $(shell mkdir -p $(obj)slb9635_i2c)
 
 # TODO: Merge tpm_tis_lpc.c with tpm.c
-COBJS-$(CONFIG_TPM_ATMEL_TWI) += tpm_atmel_twi.o
-COBJS-$(CONFIG_TPM_TIS_I2C) += tpm.o
-COBJS-$(CONFIG_TPM_TIS_I2C) += tpm_tis_i2c.o
-COBJS-$(CONFIG_TPM_TIS_LPC) += tpm_tis_lpc.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB): $(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_TPM_ATMEL_TWI) += tpm_atmel_twi.o
+obj-$(CONFIG_TPM_TIS_I2C) += tpm.o
+obj-$(CONFIG_TPM_TIS_I2C) += tpm_tis_i2c.o
+obj-$(CONFIG_TPM_TIS_LPC) += tpm_tis_lpc.o
drivers/twserial/Makefile +1 -23
index ac22735..7cc7c4d 100644
@@ -5,26 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libtws.o
-
-COBJS-$(CONFIG_SOFT_TWS) += soft_tws.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_SOFT_TWS) += soft_tws.o
drivers/video/Makefile +32 -54

90 lines not on this page · raw message

drivers/watchdog/Makefile +8 -30
index 3ade624..06ced10 100644
@@ -5,35 +5,13 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	:= $(obj)libwatchdog.o
-
-COBJS-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
-COBJS-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
+obj-$(CONFIG_AT91SAM9_WATCHDOG) += at91sam9_wdt.o
+obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
 ifneq (,$(filter $(SOC), mx31 mx35 mx5 mx6 vf610))
-COBJS-y += imx_watchdog.o
+obj-y += imx_watchdog.o
 endif
-COBJS-$(CONFIG_TNETV107X_WATCHDOG) += tnetv107x_wdt.o
-COBJS-$(CONFIG_S5P)               += s5p_wdt.o
-COBJS-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
-COBJS-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
-COBJS-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_TNETV107X_WATCHDOG) += tnetv107x_wdt.o
+obj-$(CONFIG_S5P)               += s5p_wdt.o
+obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
+obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
+obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
Signature · 1 line
1.8.1.2
#17 lore raw

PATCH v2 12/19 fs: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 fs/Makefile          | 24 +-----------------------
 fs/cbfs/Makefile     | 24 +-----------------------
 fs/cramfs/Makefile   | 29 ++---------------------------
 fs/ext4/Makefile     | 27 ++-------------------------
 fs/fat/Makefile      | 31 +++----------------------------
 fs/fdos/Makefile     | 27 +--------------------------
 fs/jffs2/Makefile    | 38 ++++++--------------------------------
 fs/reiserfs/Makefile | 26 +-------------------------
 fs/sandbox/Makefile  | 23 +----------------------
 fs/ubifs/Makefile    | 29 ++++-------------------------
 fs/yaffs2/Makefile   | 33 +--------------------------------
 fs/zfs/Makefile      | 25 +------------------------
 12 files changed, 24 insertions(+), 312 deletions(-)
fs/Makefile +1 -23
index 7e753e9..ea2eb09 100644
@@ -6,26 +6,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libfs.o
-
-COBJS-y				+= fs.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y				+= fs.o
fs/cbfs/Makefile +1 -23
index 190fd8e..6f33d28 100644
@@ -3,26 +3,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libcbfs.o
-
-COBJS-$(CONFIG_CMD_CBFS)	:= cbfs.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_CBFS)	:= cbfs.o
fs/cramfs/Makefile +2 -27
index 9b1a3d7..e2b2c73 100644
@@ -5,30 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libcramfs.o
-
-AOBJS	=
-COBJS-$(CONFIG_CMD_CRAMFS) := cramfs.o
-COBJS-$(CONFIG_CMD_CRAMFS) += uncompress.o
-
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-#CPPFLAGS +=
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_CRAMFS) := cramfs.o
+obj-$(CONFIG_CMD_CRAMFS) += uncompress.o
fs/ext4/Makefile +2 -25
index f45bb32..0f5d399 100644
@@ -9,28 +9,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libext4fs.o
-
-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))
-
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_FS_EXT4) := ext4fs.o ext4_common.o dev.o
+obj-$(CONFIG_EXT4_WRITE) += ext4_write.o ext4_journal.o crc16.o
fs/fat/Makefile +3 -28
index c00681f..b60e848 100644
@@ -3,34 +3,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libfat.o
-
-AOBJS	=
-COBJS-$(CONFIG_FS_FAT)	:= fat.o
-COBJS-$(CONFIG_FAT_WRITE):= fat_write.o
+obj-$(CONFIG_FS_FAT)	:= fat.o
+obj-$(CONFIG_FAT_WRITE):= fat_write.o
 
 ifndef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_FS_FAT)	+= file.o
+obj-$(CONFIG_FS_FAT)	+= file.o
 endif
-
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-# SEE README.arm-unaligned-accesses
-$(obj)file.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
fs/fdos/Makefile +1 -26
index 867c5ca..95480af 100644
@@ -10,29 +10,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libfdos.o
-
-AOBJS	=
-COBJS-$(CONFIG_CMD_FDOS) := fat.o vfat.o dev.o fdos.o fs.o subdir.o
-
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-#CPPFLAGS +=
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_FDOS) := fat.o vfat.o dev.o fdos.o fs.o subdir.o
fs/jffs2/Makefile +6 -32
index a11ca32..02e481f 100644
@@ -5,37 +5,11 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libjffs2.o
-
-AOBJS	=
 ifdef CONFIG_CMD_JFFS2
-COBJS-$(CONFIG_JFFS2_LZO) += compr_lzo.o
-COBJS-y += compr_rtime.o
-COBJS-y += compr_rubin.o
-COBJS-y += compr_zlib.o
-COBJS-y += jffs2_1pass.o
-COBJS-y += mini_inflate.o
+obj-$(CONFIG_JFFS2_LZO) += compr_lzo.o
+obj-y += compr_rtime.o
+obj-y += compr_rubin.o
+obj-y += compr_zlib.o
+obj-y += jffs2_1pass.o
+obj-y += mini_inflate.o
 endif
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
-
-#CPPFLAGS +=
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
fs/reiserfs/Makefile +1 -25
index d81d71d..55f70b1 100644
@@ -9,28 +9,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libreiserfs.o
-
-AOBJS	=
-COBJS-$(CONFIG_CMD_REISER) := reiserfs.o dev.o mode_string.o
-
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-#CPPFLAGS +=
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_REISER) := reiserfs.o dev.o mode_string.o
fs/sandbox/Makefile +1 -22
index df2fc32..faa7c16 100644
@@ -10,25 +10,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libsandboxfs.o
-
-COBJS-$(CONFIG_SANDBOX) := sandboxfs.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_SANDBOX) := sandboxfs.o
fs/ubifs/Makefile +4 -25
index 47949c1..47d5a8f 100644
@@ -9,31 +9,10 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libubifs.o
-
-COBJS-$(CONFIG_CMD_UBIFS) := ubifs.o io.o super.o sb.o master.o lpt.o
-COBJS-$(CONFIG_CMD_UBIFS) += lpt_commit.o scan.o lprops.o
-COBJS-$(CONFIG_CMD_UBIFS) += tnc.o tnc_misc.o debug.o crc16.o budget.o
-COBJS-$(CONFIG_CMD_UBIFS) += log.o orphan.o recovery.o replay.o
-
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
+obj-$(CONFIG_CMD_UBIFS) := ubifs.o io.o super.o sb.o master.o lpt.o
+obj-$(CONFIG_CMD_UBIFS) += lpt_commit.o scan.o lprops.o
+obj-$(CONFIG_CMD_UBIFS) += tnc.o tnc_misc.o debug.o crc16.o budget.o
+obj-$(CONFIG_CMD_UBIFS) += log.o orphan.o recovery.o replay.o
 
 # SEE README.arm-unaligned-accesses
 $(obj)super.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
fs/yaffs2/Makefile +1 -32
index 9b29d22..077af78 100644
@@ -16,11 +16,7 @@
 #
 # $Id: Makefile,v 1.15 2007/07/18 19:40:38 charles Exp $
 
-include $(TOPDIR)/config.mk
-
-LIB = $(obj)libyaffs2.o
-
-COBJS-$(CONFIG_YAFFS2) := \
+obj-$(CONFIG_YAFFS2) := \
 	yaffs_allocator.o yaffs_attribs.o yaffs_bitmap.o yaffs_uboot_glue.o\
 	yaffs_checkptrw.o yaffs_ecc.o yaffs_error.o \
 	yaffsfs.o yaffs_guts.o yaffs_nameval.o yaffs_nand.o\
@@ -28,36 +24,9 @@ COBJS-$(CONFIG_YAFFS2) := \
 	yaffs_summary.o yaffs_tagscompat.o yaffs_verify.o yaffs_yaffs1.o \
 	yaffs_yaffs2.o yaffs_mtdif.o yaffs_mtdif2.o
 
-SRCS    := $(COBJS-y:.o=.c)
-OBJS    := $(addprefix $(obj),$(COBJS-y))
-
 YCFLAGS =  -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM
 YCFLAGS += -DCONFIG_YAFFS_YAFFS2 -DNO_Y_INLINE
 YCFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
 
 CFLAGS += $(YCFLAGS)
 CPPFLAGS +=  $(YCFLAGS)
-
-all:  $(LIB)
-
-$(obj)libyaffs2.a: $(obj).depend $(OBJS)
-	$(AR) $(ARFLAGS) $@ $(OBJS)
-
-$(obj)libyaffs2.o: $(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-.PHONY: clean distclean
-clean:
-	rm -f $(OBJS)
-
-distclean:  clean
-	rm -f $(LIB) core *.bak .depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
fs/zfs/Makefile +1 -24
index 32070de..7090416 100644
@@ -5,27 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libzfs.o
-
-AOBJS	=
-COBJS-$(CONFIG_CMD_ZFS) := dev.o zfs.o zfs_fletcher.o zfs_sha256.o zfs_lzjb.o
-
-SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-
-all:	$(LIB) $(AOBJS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_ZFS) := dev.o zfs.o zfs_fletcher.o zfs_sha256.o zfs_lzjb.o
Signature · 1 line
1.8.1.2
#18 lore raw

PATCH v2 13/19 common: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 common/Makefile     | 389 ++++++++++++++++++++++++----------------------------
 common/spl/Makefile |  36 +----
 2 files changed, 189 insertions(+), 236 deletions(-)
common/Makefile +182 -207
index 288690b..745d447 100644
@@ -5,215 +5,211 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libcommon.o
-
 # core
 ifndef CONFIG_SPL_BUILD
-COBJS-y += main.o
-COBJS-y += command.o
-COBJS-y += exports.o
-COBJS-y += hash.o
-COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
-COBJS-y += s_record.o
-COBJS-y += xyzModem.o
-COBJS-y += cmd_disk.o
+obj-y += main.o
+obj-y += command.o
+obj-y += exports.o
+obj-y += hash.o
+obj-$(CONFIG_SYS_HUSH_PARSER) += hush.o
+obj-y += s_record.o
+obj-y += xyzModem.o
+obj-y += cmd_disk.o
 
 # boards
-COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
-COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
+obj-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
+obj-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
 
 # core command
-COBJS-y += cmd_boot.o
-COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
-COBJS-y += cmd_help.o
-COBJS-y += cmd_version.o
+obj-y += cmd_boot.o
+obj-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
+obj-y += cmd_help.o
+obj-y += cmd_version.o
 
 # environment
-COBJS-y += env_attr.o
-COBJS-y += env_callback.o
-COBJS-y += env_flags.o
-COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
-XCOBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-XCOBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
-COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
-COBJS-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
-COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
-COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
-COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
-COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
-COBJS-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
-COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
+obj-y += env_attr.o
+obj-y += env_callback.o
+obj-y += env_flags.o
+obj-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
+obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
+extra-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
+obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
+extra-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
+obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
+obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
+obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
+obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
+obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
+obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
+obj-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
+obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
+obj-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
+obj-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
+obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
 
 # command
-COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-$(CONFIG_SOURCE) += cmd_source.o
-COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
-COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
-COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
-COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
-COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
-COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
-COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
-COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
-COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o
-COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
-COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
-COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
-COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
-COBJS-$(CONFIG_CMD_SOUND) += cmd_sound.o
+obj-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
+obj-$(CONFIG_SOURCE) += cmd_source.o
+obj-$(CONFIG_CMD_SOURCE) += cmd_source.o
+obj-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
+obj-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
+obj-$(CONFIG_CMD_BMP) += cmd_bmp.o
+obj-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
+obj-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
+obj-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
+obj-$(CONFIG_CMD_CACHE) += cmd_cache.o
+obj-$(CONFIG_CMD_CBFS) += cmd_cbfs.o
+obj-$(CONFIG_CMD_CONSOLE) += cmd_console.o
+obj-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
+obj-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
+obj-$(CONFIG_CMD_DATE) += cmd_date.o
+obj-$(CONFIG_CMD_SOUND) += cmd_sound.o
 ifdef CONFIG_4xx
-COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
+obj-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
 endif
 ifdef CONFIG_POST
-COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
+obj-$(CONFIG_CMD_DIAG) += cmd_diag.o
 endif
-COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
-COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
-COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
-COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
-COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
-COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
-COBJS-$(CONFIG_CMD_EXT4) += cmd_ext4.o
-COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
-COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
-COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
-COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
-COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
-COBJS-$(CONFIG_CMD_FITUPD) += cmd_fitupd.o
-COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
+obj-$(CONFIG_CMD_DISPLAY) += cmd_display.o
+obj-$(CONFIG_CMD_DTT) += cmd_dtt.o
+obj-$(CONFIG_CMD_ECHO) += cmd_echo.o
+obj-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
+obj-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
+obj-$(CONFIG_CMD_ELF) += cmd_elf.o
+obj-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
+obj-$(CONFIG_CMD_EXT4) += cmd_ext4.o
+obj-$(CONFIG_CMD_EXT2) += cmd_ext2.o
+obj-$(CONFIG_CMD_FAT) += cmd_fat.o
+obj-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
+obj-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
+obj-$(CONFIG_CMD_FDOS) += cmd_fdos.o
+obj-$(CONFIG_CMD_FITUPD) += cmd_fitupd.o
+obj-$(CONFIG_CMD_FLASH) += cmd_flash.o
 ifdef CONFIG_FPGA
-COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
+obj-$(CONFIG_CMD_FPGA) += cmd_fpga.o
 endif
-COBJS-$(CONFIG_CMD_FPGAD) += cmd_fpgad.o
-COBJS-$(CONFIG_CMD_FS_GENERIC) += cmd_fs.o
-COBJS-$(CONFIG_CMD_FUSE) += cmd_fuse.o
-COBJS-$(CONFIG_CMD_GETTIME) += cmd_gettime.o
-COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
-COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
-COBJS-$(CONFIG_CMD_HASH) += cmd_hash.o
-COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
-COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
-COBJS-$(CONFIG_CMD_INI) += cmd_ini.o
-COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
-COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
-COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
-COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
-COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o
-COBJS-$(CONFIG_CMD_LED) += cmd_led.o
-COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
-COBJS-y += cmd_load.o
-COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
-COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
-COBJS-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o
-COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
-COBJS-$(CONFIG_CMD_IO) += cmd_io.o
-COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
-COBJS-$(CONFIG_MII) += miiphyutil.o
-COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
-COBJS-$(CONFIG_PHYLIB) += miiphyutil.o
-COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
+obj-$(CONFIG_CMD_FPGAD) += cmd_fpgad.o
+obj-$(CONFIG_CMD_FS_GENERIC) += cmd_fs.o
+obj-$(CONFIG_CMD_FUSE) += cmd_fuse.o
+obj-$(CONFIG_CMD_GETTIME) += cmd_gettime.o
+obj-$(CONFIG_CMD_GPIO) += cmd_gpio.o
+obj-$(CONFIG_CMD_I2C) += cmd_i2c.o
+obj-$(CONFIG_CMD_HASH) += cmd_hash.o
+obj-$(CONFIG_CMD_IDE) += cmd_ide.o
+obj-$(CONFIG_CMD_IMMAP) += cmd_immap.o
+obj-$(CONFIG_CMD_INI) += cmd_ini.o
+obj-$(CONFIG_CMD_IRQ) += cmd_irq.o
+obj-$(CONFIG_CMD_ITEST) += cmd_itest.o
+obj-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
+obj-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
+obj-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o
+obj-$(CONFIG_CMD_LED) += cmd_led.o
+obj-$(CONFIG_CMD_LICENSE) += cmd_license.o
+obj-y += cmd_load.o
+obj-$(CONFIG_LOGBUFFER) += cmd_log.o
+obj-$(CONFIG_ID_EEPROM) += cmd_mac.o
+obj-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o
+obj-$(CONFIG_CMD_MEMORY) += cmd_mem.o
+obj-$(CONFIG_CMD_IO) += cmd_io.o
+obj-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
+obj-$(CONFIG_MII) += miiphyutil.o
+obj-$(CONFIG_CMD_MII) += miiphyutil.o
+obj-$(CONFIG_PHYLIB) += miiphyutil.o
+obj-$(CONFIG_CMD_MII) += cmd_mii.o
 ifdef CONFIG_PHYLIB
-COBJS-$(CONFIG_CMD_MII) += cmd_mdio.o
+obj-$(CONFIG_CMD_MII) += cmd_mdio.o
 endif
-COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
-COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
-COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
-COBJS-$(CONFIG_MP) += cmd_mp.o
-COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
-COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
-COBJS-$(CONFIG_CMD_NET) += cmd_net.o
-COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
-COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
-COBJS-$(CONFIG_CMD_PART) += cmd_part.o
+obj-$(CONFIG_CMD_MISC) += cmd_misc.o
+obj-$(CONFIG_CMD_MMC) += cmd_mmc.o
+obj-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
+obj-$(CONFIG_MP) += cmd_mp.o
+obj-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
+obj-$(CONFIG_CMD_NAND) += cmd_nand.o
+obj-$(CONFIG_CMD_NET) += cmd_net.o
+obj-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
+obj-$(CONFIG_CMD_OTP) += cmd_otp.o
+obj-$(CONFIG_CMD_PART) += cmd_part.o
 ifdef CONFIG_PCI
-COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
+obj-$(CONFIG_CMD_PCI) += cmd_pci.o
 endif
-COBJS-y += cmd_pcmcia.o
-COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
-COBJS-$(CONFIG_CMD_PXE) += cmd_pxe.o
-COBJS-$(CONFIG_CMD_READ) += cmd_read.o
-COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
-COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
-COBJS-$(CONFIG_SANDBOX) += cmd_sandbox.o
-COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
-COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
-COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
-COBJS-$(CONFIG_CMD_SHA1SUM) += cmd_sha1sum.o
-COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
-COBJS-$(CONFIG_CMD_SOFTSWITCH) += cmd_softswitch.o
-COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
-COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
-COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
-COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
-COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
-COBJS-$(CONFIG_CMD_TRACE) += cmd_trace.o
-COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
-COBJS-$(CONFIG_CMD_TPM) += cmd_tpm.o
-COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
-COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
-COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
-COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
-COBJS-$(CONFIG_CMD_UNZIP) += cmd_unzip.o
+obj-y += cmd_pcmcia.o
+obj-$(CONFIG_CMD_PORTIO) += cmd_portio.o
+obj-$(CONFIG_CMD_PXE) += cmd_pxe.o
+obj-$(CONFIG_CMD_READ) += cmd_read.o
+obj-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
+obj-$(CONFIG_CMD_REISER) += cmd_reiser.o
+obj-$(CONFIG_SANDBOX) += cmd_sandbox.o
+obj-$(CONFIG_CMD_SATA) += cmd_sata.o
+obj-$(CONFIG_CMD_SF) += cmd_sf.o
+obj-$(CONFIG_CMD_SCSI) += cmd_scsi.o
+obj-$(CONFIG_CMD_SHA1SUM) += cmd_sha1sum.o
+obj-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
+obj-$(CONFIG_CMD_SOFTSWITCH) += cmd_softswitch.o
+obj-$(CONFIG_CMD_SPI) += cmd_spi.o
+obj-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
+obj-$(CONFIG_CMD_STRINGS) += cmd_strings.o
+obj-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
+obj-$(CONFIG_CMD_TIME) += cmd_time.o
+obj-$(CONFIG_CMD_TRACE) += cmd_trace.o
+obj-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
+obj-$(CONFIG_CMD_TPM) += cmd_tpm.o
+obj-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
+obj-$(CONFIG_CMD_UBI) += cmd_ubi.o
+obj-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
+obj-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
+obj-$(CONFIG_CMD_UNZIP) += cmd_unzip.o
 ifdef CONFIG_CMD_USB
-COBJS-y += cmd_usb.o
-COBJS-y += usb.o usb_hub.o
-COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
+obj-y += cmd_usb.o
+obj-y += usb.o usb_hub.o
+obj-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
-COBJS-$(CONFIG_CMD_USB_MASS_STORAGE) += cmd_usb_mass_storage.o
-COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
-COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
-COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
-COBJS-$(CONFIG_CMD_ZIP) += cmd_zip.o
-COBJS-$(CONFIG_CMD_ZFS) += cmd_zfs.o
+obj-$(CONFIG_CMD_USB_MASS_STORAGE) += cmd_usb_mass_storage.o
+obj-$(CONFIG_CMD_XIMG) += cmd_ximg.o
+obj-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+obj-$(CONFIG_CMD_SPL) += cmd_spl.o
+obj-$(CONFIG_CMD_ZIP) += cmd_zip.o
+obj-$(CONFIG_CMD_ZFS) += cmd_zfs.o
 
 # others
-COBJS-$(CONFIG_BOOTSTAGE) += bootstage.o
-COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
-COBJS-y += flash.o
-COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
-COBJS-$(CONFIG_I2C_EDID) += edid.o
-COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
-COBJS-y += splash.o
-COBJS-$(CONFIG_LCD) += lcd.o
-COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
-COBJS-$(CONFIG_MENU) += menu.o
-COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
-COBJS-$(CONFIG_UPDATE_TFTP) += update.o
-COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-$(CONFIG_CMD_DFU) += cmd_dfu.o
-COBJS-$(CONFIG_CMD_GPT) += cmd_gpt.o
+obj-$(CONFIG_BOOTSTAGE) += bootstage.o
+obj-$(CONFIG_CONSOLE_MUX) += iomux.o
+obj-y += flash.o
+obj-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
+obj-$(CONFIG_I2C_EDID) += edid.o
+obj-$(CONFIG_KALLSYMS) += kallsyms.o
+obj-y += splash.o
+obj-$(CONFIG_LCD) += lcd.o
+obj-$(CONFIG_LYNXKDI) += lynxkdi.o
+obj-$(CONFIG_MENU) += menu.o
+obj-$(CONFIG_MODEM_SUPPORT) += modem.o
+obj-$(CONFIG_UPDATE_TFTP) += update.o
+obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+obj-$(CONFIG_CMD_DFU) += cmd_dfu.o
+obj-$(CONFIG_CMD_GPT) += cmd_gpt.o
 endif
 
 ifdef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
-COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
+obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
+obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
+obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 # environment
-COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
-COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
-COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
+obj-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
+obj-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
+obj-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
 ifneq ($(CONFIG_SPL_NET_SUPPORT),y)
-COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
-COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
-COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
-COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
+obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
+obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
+obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
+obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
+obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 else
-COBJS-y += env_nowhere.o
+obj-y += env_nowhere.o
 endif
 endif
 # core command
-COBJS-y += cmd_nvedit.o
+obj-y += cmd_nvedit.o
 #environment
-COBJS-y += env_common.o
+obj-y += env_common.o
 #others
 ifdef CONFIG_DDR_SPD
 SPD := y
@@ -221,32 +217,20 @@ endif
 ifdef CONFIG_SPD_EEPROM
 SPD := y
 endif
-COBJS-$(SPD) += ddr_spd.o
-COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
-COBJS-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
-COBJS-y += console.o
-COBJS-y += dlmalloc.o
-COBJS-y += image.o
-COBJS-$(CONFIG_OF_LIBFDT) += image-fdt.o
-COBJS-$(CONFIG_FIT) += image-fit.o
-COBJS-$(CONFIG_FIT_SIGNATURE) += image-sig.o
-COBJS-y += memsize.o
-COBJS-y += stdio.o
-
-
-COBJS	:= $(sort $(COBJS-y))
-XCOBJS	:= $(sort $(XCOBJS-y))
-SRCS	:= $(COBJS:.o=.c) $(XCOBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-XOBJS	:= $(addprefix $(obj),$(XCOBJS))
+obj-$(SPD) += ddr_spd.o
+obj-$(CONFIG_HWCONFIG) += hwconfig.o
+obj-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
+obj-y += console.o
+obj-y += dlmalloc.o
+obj-y += image.o
+obj-$(CONFIG_OF_LIBFDT) += image-fdt.o
+obj-$(CONFIG_FIT) += image-fit.o
+obj-$(CONFIG_FIT_SIGNATURE) += image-sig.o
+obj-y += memsize.o
+obj-y += stdio.o
 
 CPPFLAGS += -I..
 
-all:	$(LIB) $(XOBJS)
-
-$(LIB): $(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
 $(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
 	$(CC) $(AFLAGS) -Wa,--no-warn \
 		-DENV_CRC=$(shell $(obj)../tools/envcrc) \
@@ -258,12 +242,3 @@ $(obj)../tools/envcrc:
 # SEE README.arm-unaligned-accesses
 $(obj)hush.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
 $(obj)fdt_support.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
common/spl/Makefile +7 -29
index e8144f7..5c0637b 100644
@@ -8,34 +8,12 @@
 # Based on common/Makefile.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libspl.o
-
 ifdef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
-COBJS-$(CONFIG_SPL_NOR_SUPPORT) += spl_nor.o
-COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
-COBJS-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o
-COBJS-$(CONFIG_SPL_ONENAND_SUPPORT) += spl_onenand.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
-COBJS-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
+obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
+obj-$(CONFIG_SPL_NOR_SUPPORT) += spl_nor.o
+obj-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
+obj-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o
+obj-$(CONFIG_SPL_ONENAND_SUPPORT) += spl_onenand.o
+obj-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
+obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
 endif
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
Signature · 1 line
1.8.1.2
#19 lore raw

PATCH v2 14/19 net: convert a makefile to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 net/Makefile | 46 ++++++++++++----------------------------------
 1 file changed, 12 insertions(+), 34 deletions(-)
net/Makefile +12 -34
index 4c9a97f..31aadc2 100644
@@ -5,39 +5,17 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 # CFLAGS += -DDEBUG
 
-LIB	= $(obj)libnet.o
-
-COBJS-$(CONFIG_CMD_NET)  += arp.o
-COBJS-$(CONFIG_CMD_NET)  += bootp.o
-COBJS-$(CONFIG_CMD_CDP)  += cdp.o
-COBJS-$(CONFIG_CMD_DNS)  += dns.o
-COBJS-$(CONFIG_CMD_NET)  += eth.o
-COBJS-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
-COBJS-$(CONFIG_CMD_NET)  += net.o
-COBJS-$(CONFIG_CMD_NFS)  += nfs.o
-COBJS-$(CONFIG_CMD_PING) += ping.o
-COBJS-$(CONFIG_CMD_RARP) += rarp.o
-COBJS-$(CONFIG_CMD_SNTP) += sntp.o
-COBJS-$(CONFIG_CMD_NET)  += tftp.o
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_CMD_NET)  += arp.o
+obj-$(CONFIG_CMD_NET)  += bootp.o
+obj-$(CONFIG_CMD_CDP)  += cdp.o
+obj-$(CONFIG_CMD_DNS)  += dns.o
+obj-$(CONFIG_CMD_NET)  += eth.o
+obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
+obj-$(CONFIG_CMD_NET)  += net.o
+obj-$(CONFIG_CMD_NFS)  += nfs.o
+obj-$(CONFIG_CMD_PING) += ping.o
+obj-$(CONFIG_CMD_RARP) += rarp.o
+obj-$(CONFIG_CMD_SNTP) += sntp.o
+obj-$(CONFIG_CMD_NET)  += tftp.o
Signature · 1 line
1.8.1.2
#20 lore raw

PATCH v2 15/19 lib: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 lib/Makefile        | 114 ++++++++++++++++++++++------------------------------
 lib/libfdt/Makefile |  27 +------------
 lib/lzma/Makefile   |  24 +----------
 lib/lzo/Makefile    |  24 +----------
 lib/rsa/Makefile    |  22 +---------
 lib/tizen/Makefile  |  24 +----------
 lib/zlib/Makefile   |  22 +---------
 7 files changed, 54 insertions(+), 203 deletions(-)
lib/Makefile +47 -67
index df0cdd4..4e3b500 100644
@@ -5,78 +5,58 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libgeneric.o
-
 ifndef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_AES) += aes.o
-COBJS-$(CONFIG_BZIP2) += bzlib.o
-COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
-COBJS-$(CONFIG_BZIP2) += bzlib_decompress.o
-COBJS-$(CONFIG_BZIP2) += bzlib_randtable.o
-COBJS-$(CONFIG_BZIP2) += bzlib_huffman.o
-COBJS-$(CONFIG_USB_TTY) += circbuf.o
-COBJS-y += crc7.o
-COBJS-y += crc16.o
-COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o
-COBJS-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
-COBJS-$(CONFIG_GZIP) += gunzip.o
-COBJS-$(CONFIG_GZIP_COMPRESSED) += gzip.o
-COBJS-y += initcall.o
-COBJS-$(CONFIG_LMB) += lmb.o
-COBJS-y += ldiv.o
-COBJS-$(CONFIG_MD5) += md5.o
-COBJS-y += net_utils.o
-COBJS-$(CONFIG_PHYSMEM) += physmem.o
-COBJS-y += qsort.o
-COBJS-$(CONFIG_SHA1) += sha1.o
-COBJS-$(CONFIG_SHA256) += sha256.o
-COBJS-y	+= strmhz.o
-COBJS-$(CONFIG_TPM) += tpm.o
-COBJS-$(CONFIG_RBTREE)	+= rbtree.o
-COBJS-$(CONFIG_BITREVERSE) += bitrev.o
+obj-$(CONFIG_AES) += aes.o
+obj-$(CONFIG_BZIP2) += bzlib.o
+obj-$(CONFIG_BZIP2) += bzlib_crctable.o
+obj-$(CONFIG_BZIP2) += bzlib_decompress.o
+obj-$(CONFIG_BZIP2) += bzlib_randtable.o
+obj-$(CONFIG_BZIP2) += bzlib_huffman.o
+obj-$(CONFIG_USB_TTY) += circbuf.o
+obj-y += crc7.o
+obj-y += crc16.o
+obj-$(CONFIG_OF_CONTROL) += fdtdec.o
+obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
+obj-$(CONFIG_GZIP) += gunzip.o
+obj-$(CONFIG_GZIP_COMPRESSED) += gzip.o
+obj-y += initcall.o
+obj-$(CONFIG_LMB) += lmb.o
+obj-y += ldiv.o
+obj-$(CONFIG_MD5) += md5.o
+obj-y += net_utils.o
+obj-$(CONFIG_PHYSMEM) += physmem.o
+obj-y += qsort.o
+obj-$(CONFIG_SHA1) += sha1.o
+obj-$(CONFIG_SHA256) += sha256.o
+obj-y	+= strmhz.o
+obj-$(CONFIG_TPM) += tpm.o
+obj-$(CONFIG_RBTREE)	+= rbtree.o
+obj-$(CONFIG_BITREVERSE) += bitrev.o
 endif
 
 ifdef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o
+obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
+obj-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o
 endif
-COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
-COBJS-y += hashtable.o
-COBJS-y += errno.o
-COBJS-y += display_options.o
-COBJS-$(CONFIG_BCH) += bch.o
-COBJS-y += crc32.o
-COBJS-y += ctype.o
-COBJS-y += div64.o
-COBJS-y += hang.o
-COBJS-y += linux_string.o
-COBJS-$(CONFIG_REGEX) += slre.o
-COBJS-y += string.o
-COBJS-y += time.o
-COBJS-$(CONFIG_TRACE) += trace.o
-COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
-COBJS-y += vsprintf.o
-COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
-COBJS-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
-COBJS-$(CONFIG_CMD_LINK_LOCAL) += rand.o
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
+obj-$(CONFIG_ADDR_MAP) += addr_map.o
+obj-y += hashtable.o
+obj-y += errno.o
+obj-y += display_options.o
+obj-$(CONFIG_BCH) += bch.o
+obj-y += crc32.o
+obj-y += ctype.o
+obj-y += div64.o
+obj-y += hang.o
+obj-y += linux_string.o
+obj-$(CONFIG_REGEX) += slre.o
+obj-y += string.o
+obj-y += time.o
+obj-$(CONFIG_TRACE) += trace.o
+obj-$(CONFIG_BOOTP_PXE) += uuid.o
+obj-y += vsprintf.o
+obj-$(CONFIG_RANDOM_MACADDR) += rand.o
+obj-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
+obj-$(CONFIG_CMD_LINK_LOCAL) += rand.o
 
 # SEE README.arm-unaligned-accesses
 $(obj)bzlib.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
lib/libfdt/Makefile +2 -25
index 07373df..a02c9b0 100644
@@ -5,30 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libfdt.o
-
-SOBJS	=
-
 COBJS-libfdt += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o fdt_empty_tree.o
 
-COBJS-$(CONFIG_OF_LIBFDT) += $(COBJS-libfdt)
-COBJS-$(CONFIG_FIT) += $(COBJS-libfdt)
-
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_OF_LIBFDT) += $(COBJS-libfdt)
+obj-$(CONFIG_FIT) += $(COBJS-libfdt)
lib/lzma/Makefile +1 -23
index 412e187..25c6797 100644
@@ -8,28 +8,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)liblzma.o
-
-SOBJS	=
-
 CFLAGS += -D_LZMA_PROB32
 
-COBJS-$(CONFIG_LZMA) += LzmaDec.o LzmaTools.o
-
-COBJS	= $(COBJS-y)
-SRCS 	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_LZMA) += LzmaDec.o LzmaTools.o
lib/lzo/Makefile +1 -23
index 516519a..dd853ea 100644
@@ -5,26 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)liblzo.o
-
-SOBJS	=
-
-COBJS-$(CONFIG_LZO) += lzo1x_decompress.o
-
-COBJS	= $(COBJS-y)
-SRCS 	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_LZO) += lzo1x_decompress.o
lib/rsa/Makefile +1 -21
index decd6e5..693c745 100644
@@ -7,26 +7,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)librsa.o
-
 ifdef CONFIG_FIT_SIGNATURE
-COBJS-$(CONFIG_RSA) += rsa-verify.o
+obj-$(CONFIG_RSA) += rsa-verify.o
 endif
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
lib/tizen/Makefile +1 -23
index 80d76cf..e1a9cf4 100644
@@ -5,26 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libtizen.o
-
-SOBJS	=
-
-COBJS-$(CONFIG_TIZEN) += tizen.o
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_TIZEN) += tizen.o
lib/zlib/Makefile +1 -21
index b69e234..1e9e04d 100644
@@ -5,24 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libz.o
-
-COBJS-$(CONFIG_ZLIB) += zlib.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_ZLIB) += zlib.o
Signature · 1 line
1.8.1.2
#21 lore raw

PATCH v2 16/19 disk: convert a makefile to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 disk/Makefile | 34 ++++++----------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)
disk/Makefile +6 -28
index 2b04e03..48abec8 100644
@@ -5,33 +5,11 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 #CFLAGS += -DET_DEBUG -DDEBUG
 
-LIB	= $(obj)libdisk.o
-
-COBJS-$(CONFIG_PARTITIONS) 	+= part.o
-COBJS-$(CONFIG_MAC_PARTITION)   += part_mac.o
-COBJS-$(CONFIG_DOS_PARTITION)   += part_dos.o
-COBJS-$(CONFIG_ISO_PARTITION)   += part_iso.o
-COBJS-$(CONFIG_AMIGA_PARTITION) += part_amiga.o
-COBJS-$(CONFIG_EFI_PARTITION)   += part_efi.o
-
-COBJS	:= $(COBJS-y)
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(LIB)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-$(CONFIG_PARTITIONS) 	+= part.o
+obj-$(CONFIG_MAC_PARTITION)   += part_mac.o
+obj-$(CONFIG_DOS_PARTITION)   += part_dos.o
+obj-$(CONFIG_ISO_PARTITION)   += part_iso.o
+obj-$(CONFIG_AMIGA_PARTITION) += part_amiga.o
+obj-$(CONFIG_EFI_PARTITION)   += part_efi.o
Signature · 1 line
1.8.1.2
#22 lore raw

PATCH v2 17/19 sandbox: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 arch/sandbox/cpu/Makefile | 23 +----------------------
 arch/sandbox/lib/Makefile | 25 +------------------------
 2 files changed, 2 insertions(+), 46 deletions(-)
arch/sandbox/cpu/Makefile +1 -22
index e386867..404ff67 100644
@@ -7,29 +7,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-COBJS	:= cpu.o os.o start.o state.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
+obj-y	:= cpu.o os.o start.o state.o
 
 # os.c is build in the system environment, so needs standard includes
 $(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
 $(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,$(CPPFLAGS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/sandbox/lib/Makefile +1 -24
index 993fb4e..4c1a38d 100644
@@ -7,28 +7,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 
-LIB	= $(obj)lib$(ARCH).o
-
-COBJS-y	+= interrupts.o
-
-SRCS	:= $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS-y))
-
-# Always build libsandbox.o
-TARGETS	:= $(LIB)
-
-all:	$(TARGETS)
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= interrupts.o
Signature · 1 line
1.8.1.2
#24 lore raw

PATCH v2 18/19 powerpc: convert makefiles to Kbuild style

In reply to Masahiro Yamada

Note:
arch/powerpc/cpu/mpc8260/Makefile is originally like follows:

    ---<snip>---
    START   = start.o kgdb.o
    COBJS   = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
    ---<snip>---
    COBJS-$(CONFIG_ETHER_ON_SCC) = ether_scc.o
    ---<snip>---
    $(LIB): $(OBJS)
            $(call cmd_link_o_target, $(OBJS) $(obj)kgdb.o)

The link rule `$(call cmd_link_o_target, $(OBJS) $(obj)kgdb.o)' is weird.
kbdg.o is not included in $(OBJS) but linked into $(LIB) and $(LIB) is not dependent on kgdb.o.
(Broken dependency tracking)

So,
START = start.o kgdb.o
shoud have been
START = start.o
SOBJS = kgdb.o

That is why this commit adds kgdb.o to obj-y, not to extra-y.

Cc Wolfgang Denk <[email protected]>
Cc Stefan Roese <[email protected]>

---

Changed v2:
- fix arch/powerpc/cpu/mpc8260/Makefile as shown above

 arch/powerpc/cpu/74xx_7xx/Makefile    |  28 +---
 arch/powerpc/cpu/mpc512x/Makefile     |  51 ++------
 arch/powerpc/cpu/mpc5xx/Makefile      |  27 +---
 arch/powerpc/cpu/mpc5xxx/Makefile     |  54 +++-----
 arch/powerpc/cpu/mpc824x/Makefile     |  28 +---
 arch/powerpc/cpu/mpc8260/Makefile     |  32 +----
 arch/powerpc/cpu/mpc83xx/Makefile     |  58 +++------
 arch/powerpc/cpu/mpc85xx/Makefile     | 233 +++++++++++++++-------------------
 arch/powerpc/cpu/mpc86xx/Makefile     |  50 ++------
 arch/powerpc/cpu/mpc8xx/Makefile      |  58 +++------
 arch/powerpc/cpu/mpc8xxx/Makefile     |  30 +----
 arch/powerpc/cpu/mpc8xxx/ddr/Makefile |  30 +----
 arch/powerpc/cpu/ppc4xx/Makefile      |  90 +++++--------
 arch/powerpc/lib/Makefile             |  78 ++++--------
 14 files changed, 267 insertions(+), 580 deletions(-)
arch/powerpc/cpu/74xx_7xx/Makefile +3 -25
index de9b4a7..f31fe75 100644
@@ -8,28 +8,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-SOBJS	= cache.o kgdb.o io.o
-COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-y	= start.o
+obj-y	= cache.o kgdb.o io.o
+obj-y	+= traps.o cpu.o cpu_init.o speed.o interrupts.o
arch/powerpc/cpu/mpc512x/Makefile +14 -37

58 lines not on this page · raw message

arch/powerpc/cpu/mpc5xx/Makefile +2 -25
index e3e50af..7b8826a 100644
@@ -16,28 +16,5 @@
 #			uses the definitions made in arch/powerpc/cpu/mpc5xx/config.mk
 #
 
-
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= serial.o cpu.o cpu_init.o interrupts.o traps.o speed.o spi.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+extra-y	= start.o
+obj-y	= serial.o cpu.o cpu_init.o interrupts.o traps.o speed.o spi.o
arch/powerpc/cpu/mpc5xxx/Makefile +16 -38

60 lines not on this page · raw message

arch/powerpc/cpu/mpc824x/Makefile +4 -24
index 8f27aac..67b0d17 100644
@@ -5,35 +5,15 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 ifneq ($(OBJTREE),$(SRCTREE))
 $(shell mkdir -p $(obj)drivers/epic $(obj)drivers/i2c)
 endif
 
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o
-COBJS	= traps.o cpu.o cpu_init.o interrupts.o speed.o \
+extra-y	= start.o
+obj-y	= traps.o cpu.o cpu_init.o interrupts.o speed.o \
 	  drivers/epic/epic1.o drivers/i2c/i2c.o pci.o
-COBJS_LN = bedbug_603e.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix $(obj),$(COBJS_LN:.o=.c))
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS) $(COBJS_LN))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
+obj-y += bedbug_603e.o
 
+SRCS += $(obj)bedbug_603e.c
 $(obj)bedbug_603e.c:
 	ln -sf $(src)../mpc8260/bedbug_603e.c $(obj)bedbug_603e.c
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
arch/powerpc/cpu/mpc8260/Makefile +4 -28
index d87eff6..83adc4c 100644
@@ -5,33 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(CPU).o
-
-START	= start.o kgdb.o
-COBJS	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
+extra-y	= start.o
+obj-y	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
 	  interrupts.o ether_fcc.o i2c.o commproc.o \
-	  bedbug_603e.o pci.o spi.o
-
-COBJS-$(CONFIG_ETHER_ON_SCC) = ether_scc.o
-
-COBJS	+= $(COBJS-y)
-
-SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-START	:= $(addprefix $(obj),$(START))
-
-all:	$(obj).depend $(START) $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS) $(obj)kgdb.o)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
+	  bedbug_603e.o pci.o spi.o kgdb.o
 
-#########################################################################
+obj-$(CONFIG_ETHER_ON_SCC) += ether_scc.o
arch/powerpc/cpu/mpc83xx/Makefile +18 -40

88 lines not on this page · raw message

arch/powerpc/cpu/mpc85xx/Makefile +104 -129

263 lines not on this page · raw message

arch/powerpc/cpu/mpc86xx/Makefile +14 -36

56 lines not on this page · raw message

arch/powerpc/cpu/mpc8xx/Makefile +18 -40

63 lines not on this page · raw message

arch/powerpc/cpu/mpc8xxx/Makefile +7 -23
index 3dc8e05..395fed1 100644
@@ -6,10 +6,6 @@
 # Version 2 as published by the Free Software Foundation.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib8xxx.o
-
 MINIMAL=
 
 ifdef CONFIG_SPL_BUILD
@@ -20,30 +16,18 @@ endif
 
 ifdef MINIMAL
 
-COBJS-$(CONFIG_FSL_LAW) += law.o
+obj-$(CONFIG_FSL_LAW) += law.o
 
 else
 
 ifneq ($(CPU),mpc83xx)
-COBJS-y	+= cpu.o
+obj-y	+= cpu.o
 endif
 
-COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
-COBJS-$(CONFIG_FSL_IFC) += fsl_ifc.o
-COBJS-$(CONFIG_FSL_LBC) += fsl_lbc.o
-COBJS-$(CONFIG_SYS_SRIO) += srio.o
-COBJS-$(CONFIG_FSL_LAW) += law.o
+obj-$(CONFIG_OF_LIBFDT) += fdt.o
+obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
+obj-$(CONFIG_FSL_LBC) += fsl_lbc.o
+obj-$(CONFIG_SYS_SRIO) += srio.o
+obj-$(CONFIG_FSL_LAW) += law.o
 
 endif
-
-SRCS	:= $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
arch/powerpc/cpu/mpc8xxx/ddr/Makefile +7 -23
index 29523aa..8cbc06c 100644
@@ -6,17 +6,13 @@
 # Version 2 as published by the Free Software Foundation.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)libddr.o
-
-COBJS-$(CONFIG_FSL_DDR1)	+= main.o util.o ctrl_regs.o options.o \
+obj-$(CONFIG_FSL_DDR1)	+= main.o util.o ctrl_regs.o options.o \
 				   lc_common_dimm_params.o
 
-COBJS-$(CONFIG_FSL_DDR2)	+= main.o util.o ctrl_regs.o options.o \
+obj-$(CONFIG_FSL_DDR2)	+= main.o util.o ctrl_regs.o options.o \
 				   lc_common_dimm_params.o
 
-COBJS-$(CONFIG_FSL_DDR3)	+= main.o util.o ctrl_regs.o options.o \
+obj-$(CONFIG_FSL_DDR3)	+= main.o util.o ctrl_regs.o options.o \
 				   lc_common_dimm_params.o
 ifdef CONFIG_DDR_SPD
 SPD := y
@@ -25,21 +21,9 @@ ifdef CONFIG_SPD_EEPROM
 SPD := y
 endif
 ifdef SPD
-COBJS-$(CONFIG_FSL_DDR1)	+= ddr1_dimm_params.o
-COBJS-$(CONFIG_FSL_DDR2)	+= ddr2_dimm_params.o
-COBJS-$(CONFIG_FSL_DDR3)	+= ddr3_dimm_params.o
+obj-$(CONFIG_FSL_DDR1)	+= ddr1_dimm_params.o
+obj-$(CONFIG_FSL_DDR2)	+= ddr2_dimm_params.o
+obj-$(CONFIG_FSL_DDR3)	+= ddr3_dimm_params.o
 endif
 
-COBJS-$(CONFIG_FSL_DDR_INTERACTIVE) += interactive.o
-
-SRCS	:= $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-
-all:	$(obj).depend $(LIB)
-
-$(LIB):	$(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
+obj-$(CONFIG_FSL_DDR_INTERACTIVE) += interactive.o
arch/powerpc/cpu/ppc4xx/Makefile +34 -56

105 lines not on this page · raw message

arch/powerpc/lib/Makefile +22 -56

115 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#25 lore raw

PATCH v2 19/19 board: ti: convert makefiles to Kbuild style

In reply to Masahiro Yamada

---

Changes for v2
- No change

 board/ti/am335x/Makefile       | 29 ++---------------------------
 board/ti/am3517crane/Makefile  | 19 +------------------
 board/ti/am43xx/Makefile       | 29 ++---------------------------
 board/ti/beagle/Makefile       | 24 ++----------------------
 board/ti/dra7xx/Makefile       | 27 +--------------------------
 board/ti/evm/Makefile          | 19 +------------------
 board/ti/omap1510inn/Makefile  | 24 ++----------------------
 board/ti/omap5912osk/Makefile  | 24 ++----------------------
 board/ti/omap5_uevm/Makefile   | 27 +--------------------------
 board/ti/omap730p2/Makefile    | 24 ++----------------------
 board/ti/panda/Makefile        | 21 +--------------------
 board/ti/sdp3430/Makefile      | 21 +--------------------
 board/ti/sdp4430/Makefile      | 23 ++---------------------
 board/ti/ti814x/Makefile       | 29 ++---------------------------
 board/ti/ti816x/Makefile       | 27 +--------------------------
 board/ti/tnetv107xevm/Makefile | 25 +------------------------
 16 files changed, 24 insertions(+), 368 deletions(-)
board/ti/am335x/Makefile +2 -27
index 3dbeeda..c8b4f9a 100644
@@ -6,33 +6,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
-COBJS	:= mux.o
+obj-y	:= mux.o
 endif
 
-COBJS	+= board.o
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-clean:
-	rm -f $(SOBJS) $(OBJS)
-
-distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= board.o
board/ti/am3517crane/Makefile +1 -18
index d9ab72a..9da795d 100644
@@ -8,21 +8,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= am3517crane.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
+obj-y	:= am3517crane.o
board/ti/am43xx/Makefile +2 -27
index 4a1bb7c..cb5fe88 100644
@@ -6,33 +6,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
 ifdef CONFIG_SPL_BUILD
-COBJS	:= mux.o
+obj-y	:= mux.o
 endif
 
-COBJS	+= board.o
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-clean:
-	rm -f $(SOBJS) $(OBJS)
-
-distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= board.o
board/ti/beagle/Makefile +2 -22
index 3018f6c..9f55e8f 100644
@@ -5,25 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS-y	:= $(BOARD).o
-COBJS-$(CONFIG_STATUS_LED) += led.o
-
-COBJS	:= $(sort $(COBJS-y))
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= $(BOARD).o
+obj-$(CONFIG_STATUS_LED) += led.o
board/ti/dra7xx/Makefile +1 -26
index e558f4c..434e8d1 100644
@@ -5,29 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= evm.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-clean:
-	rm -f $(OBJS)
-
-distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= evm.o
board/ti/evm/Makefile +1 -18
index 0f8cf44..b88ab8f 100644
@@ -5,21 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= evm.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
+obj-y	:= evm.o
board/ti/omap1510inn/Makefile +2 -22
index ad5a7eb..8256e81 100644
@@ -5,25 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= omap1510innovator.o
-SOBJS	:= lowlevel_init.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= omap1510innovator.o
+obj-y	+= lowlevel_init.o
board/ti/omap5912osk/Makefile +2 -22
index b2727de..d7c0ebd 100644
@@ -5,25 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= omap5912osk.o
-SOBJS	:= lowlevel_init.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= omap5912osk.o
+obj-y	+= lowlevel_init.o
board/ti/omap5_uevm/Makefile +1 -26
index 2ab40e3..b88ab8f 100644
@@ -5,29 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= evm.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-clean:
-	rm -f $(OBJS)
-
-distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= evm.o
board/ti/omap730p2/Makefile +2 -22
index 37a4d34..8242f3d 100644
@@ -5,25 +5,5 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= omap730p2.o flash.o
-SOBJS	:= lowlevel_init.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= omap730p2.o flash.o
+obj-y	+= lowlevel_init.o
board/ti/panda/Makefile +1 -20
index 1e489d2..c89f80d 100644
@@ -5,23 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= panda.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= panda.o
board/ti/sdp3430/Makefile +1 -20
index e72485c..753f099 100644
@@ -5,23 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= sdp.o
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= sdp.o
board/ti/sdp4430/Makefile +2 -21
index c522a2b..79e67b6 100644
@@ -5,27 +5,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= sdp.o
+obj-y	:= sdp.o
 
 ifndef CONFIG_SPL_BUILD
-COBJS	+= cmd_bat.o
+obj-y	+= cmd_bat.o
 endif
-
-SRCS	:= $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
board/ti/ti814x/Makefile +2 -27
index 6059e20..93155de 100644
@@ -6,33 +6,8 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
 ifdef CONFIG_SPL_BUILD
-COBJS	:= mux.o
+obj-y	:= mux.o
 endif
 
-COBJS	+= evm.o
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-clean:
-	rm -f $(SOBJS) $(OBJS)
-
-distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	+= evm.o
board/ti/ti816x/Makefile +1 -26
index 17ce72a..f1cc3d5 100644
@@ -9,29 +9,4 @@
 # SPDX-License-Identifier:	GPL-2.0
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS	:= evm.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-
-$(LIB):	$(obj).depend $(OBJS)
-	$(call cmd_link_o_target, $(OBJS))
-
-clean:
-	rm -f $(OBJS)
-
-distclean:	clean
-	rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y	:= evm.o
board/ti/tnetv107xevm/Makefile +1 -24
index 5b82e48..0a6128f 100644
@@ -2,27 +2,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB	= $(obj)lib$(BOARD).o
-
-COBJS		+= sdb_board.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
-SOBJS	:= $(addprefix $(obj),$(SOBJS))
-
-.PHONY: all
-
-all: $(LIB)
-
-$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-#########################################################################
-# This is for $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
+obj-y		+= sdb_board.o
Signature · 1 line
1.8.1.2
#26 lore raw

v2 cover First step towards Kbuild: Use Kbuild style makefiles

In reply to Masahiro Yamada

FYI:

In order to avoid git-pull conflict,
this series uses
http://patchwork.ozlabs.org/patch/268098/
http://patchwork.ozlabs.org/patch/268097/
http://patchwork.ozlabs.org/patch/268099/
as prerequisites.

Those three were accepted by Albert and
now stay in u-boot-arm/master, but not exist in u-boot/master.

If you try applying these series,
u-boot-arm/master must be merged into u-boot/master beforehand.

Best Regards
Masahiro Yamada