Skip to content
Snippets Groups Projects
Commit 71f84ef0 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Tom Rini
Browse files

ARM: imx-common: convert makefiles to Kbuild style


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

Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
parent fa8f9508
No related branches found
No related tags found
No related merge requests found
...@@ -416,6 +416,8 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin ...@@ -416,6 +416,8 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin
endif endif
endif endif
build := -f $(TOPDIR)/scripts/Makefile.build -C
all: $(ALL-y) $(SUBDIR_EXAMPLES) all: $(ALL-y) $(SUBDIR_EXAMPLES)
$(obj)u-boot.dtb: checkdtc $(obj)u-boot $(obj)u-boot.dtb: checkdtc $(obj)u-boot
...@@ -463,7 +465,7 @@ $(obj)u-boot.img: $(obj)u-boot.bin ...@@ -463,7 +465,7 @@ $(obj)u-boot.img: $(obj)u-boot.bin
-d $< $@ -d $< $@
$(obj)u-boot.imx: $(obj)u-boot.bin depend $(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)u-boot.kwb: $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
...@@ -501,11 +503,11 @@ $(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin ...@@ -501,11 +503,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)) $(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 $(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 $(OBJTREE)/u-boot-with-spl.imx
$(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(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 $(OBJTREE)/u-boot-with-nand-spl.imx
$(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin $(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin
......
...@@ -7,31 +7,18 @@ ...@@ -7,31 +7,18 @@
# SPDX-License-Identifier: GPL-2.0+ # SPDX-License-Identifier: GPL-2.0+
# #
include $(TOPDIR)/config.mk
LIB = $(obj)libimx-common.o
ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610)) ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610))
COBJS-y = iomux-v3.o obj-y = iomux-v3.o
endif endif
ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
COBJS-y += timer.o cpu.o speed.o obj-y += timer.o cpu.o speed.o
COBJS-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
endif endif
ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
COBJS-y += misc.o obj-y += misc.o
endif endif
COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
COBJS-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o obj-$(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))
$(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/% $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/%
mkdir -p $(dir $@) mkdir -p $(dir $@)
...@@ -67,13 +54,3 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin ...@@ -67,13 +54,3 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
$(OBJTREE)/u-boot.uim $(OBJTREE)/u-boot.uim
cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(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 rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################
...@@ -154,6 +154,8 @@ ifeq ($(wildcard $(LDSCRIPT)),) ...@@ -154,6 +154,8 @@ ifeq ($(wildcard $(LDSCRIPT)),)
$(error could not find linker script) $(error could not find linker script)
endif endif
build := -f $(TOPDIR)/scripts/Makefile.build -C
# Special flags for CPP when processing the linker script. # Special flags for CPP when processing the linker script.
# Pass the version down so we can handle backwards compatibility # Pass the version down so we can handle backwards compatibility
# on the fly. # on the fly.
...@@ -173,7 +175,7 @@ $(OBJTREE)/MLO.byteswap: $(obj)u-boot-spl.bin ...@@ -173,7 +175,7 @@ $(OBJTREE)/MLO.byteswap: $(obj)u-boot-spl.bin
-a $(CONFIG_SPL_TEXT_BASE) -d $< $@ -a $(CONFIG_SPL_TEXT_BASE) -d $< $@
$(OBJTREE)/SPL : $(obj)u-boot-spl.bin depend $(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 ALL-y += $(obj)$(SPL_BIN).bin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment