Commit 71f84ef0730e992f50bd82d17a003daafd149cad
Committed by
Tom Rini
1 parent
fa8f95084d
Exists in
master
and in
50 other branches
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: Masahiro Yamada <yamada.m@jp.panasonic.com>
Showing 3 changed files with 14 additions and 33 deletions Side-by-side Diff
Makefile
... | ... | @@ -416,6 +416,8 @@ |
416 | 416 | endif |
417 | 417 | endif |
418 | 418 | |
419 | +build := -f $(TOPDIR)/scripts/Makefile.build -C | |
420 | + | |
419 | 421 | all: $(ALL-y) $(SUBDIR_EXAMPLES) |
420 | 422 | |
421 | 423 | $(obj)u-boot.dtb: checkdtc $(obj)u-boot |
... | ... | @@ -463,7 +465,7 @@ |
463 | 465 | -d $< $@ |
464 | 466 | |
465 | 467 | $(obj)u-boot.imx: $(obj)u-boot.bin depend |
466 | - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx | |
468 | + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx | |
467 | 469 | |
468 | 470 | $(obj)u-boot.kwb: $(obj)u-boot.bin |
469 | 471 | $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ |
470 | 472 | |
... | ... | @@ -501,11 +503,11 @@ |
501 | 503 | $(call SPL_PAD_APPEND,$<,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO)) |
502 | 504 | |
503 | 505 | $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin |
504 | - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \ | |
506 | + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \ | |
505 | 507 | $(OBJTREE)/u-boot-with-spl.imx |
506 | 508 | |
507 | 509 | $(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin |
508 | - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \ | |
510 | + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \ | |
509 | 511 | $(OBJTREE)/u-boot-with-nand-spl.imx |
510 | 512 | |
511 | 513 | $(obj)u-boot.ubl: $(obj)u-boot-with-spl.bin |
arch/arm/imx-common/Makefile
... | ... | @@ -7,32 +7,19 @@ |
7 | 7 | # SPDX-License-Identifier: GPL-2.0+ |
8 | 8 | # |
9 | 9 | |
10 | -include $(TOPDIR)/config.mk | |
11 | - | |
12 | -LIB = $(obj)libimx-common.o | |
13 | - | |
14 | 10 | ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610)) |
15 | -COBJS-y = iomux-v3.o | |
11 | +obj-y = iomux-v3.o | |
16 | 12 | endif |
17 | 13 | ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) |
18 | -COBJS-y += timer.o cpu.o speed.o | |
19 | -COBJS-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o | |
14 | +obj-y += timer.o cpu.o speed.o | |
15 | +obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o | |
20 | 16 | endif |
21 | 17 | ifeq ($(SOC),$(filter $(SOC),mx6 mxs)) |
22 | -COBJS-y += misc.o | |
18 | +obj-y += misc.o | |
23 | 19 | endif |
24 | -COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o | |
25 | -COBJS-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o | |
26 | -COBJS := $(sort $(COBJS-y)) | |
20 | +obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o | |
21 | +obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o | |
27 | 22 | |
28 | -SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) | |
29 | -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) | |
30 | - | |
31 | -all: $(obj).depend $(LIB) | |
32 | - | |
33 | -$(LIB): $(OBJS) | |
34 | - $(call cmd_link_o_target, $(OBJS)) | |
35 | - | |
36 | 23 | $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp : $(SRCTREE)/% |
37 | 24 | mkdir -p $(dir $@) |
38 | 25 | $(CC) -E -x c $< $(CPPFLAGS) -o $@ |
... | ... | @@ -67,14 +54,4 @@ |
67 | 54 | $(OBJTREE)/u-boot.uim |
68 | 55 | cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim > $@ |
69 | 56 | rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim |
70 | - | |
71 | - | |
72 | -######################################################################### | |
73 | - | |
74 | -# defines $(obj).depend target | |
75 | -include $(SRCTREE)/rules.mk | |
76 | - | |
77 | -sinclude $(obj).depend | |
78 | - | |
79 | -######################################################################### |
spl/Makefile
... | ... | @@ -154,6 +154,8 @@ |
154 | 154 | $(error could not find linker script) |
155 | 155 | endif |
156 | 156 | |
157 | +build := -f $(TOPDIR)/scripts/Makefile.build -C | |
158 | + | |
157 | 159 | # Special flags for CPP when processing the linker script. |
158 | 160 | # Pass the version down so we can handle backwards compatibility |
159 | 161 | # on the fly. |
... | ... | @@ -173,7 +175,7 @@ |
173 | 175 | -a $(CONFIG_SPL_TEXT_BASE) -d $< $@ |
174 | 176 | |
175 | 177 | $(OBJTREE)/SPL : $(obj)u-boot-spl.bin depend |
176 | - $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $@ | |
178 | + $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $@ | |
177 | 179 | |
178 | 180 | ALL-y += $(obj)$(SPL_BIN).bin |
179 | 181 |