Commit e19db555b4ac79dafa04cc5ff98bdbff01e19388
Committed by
Tom Rini
1 parent
eb8a4fe0dc
Exists in
v2017.01-smarct4x
and in
37 other branches
Kbuild: introduce Makefile in arch/$ARCH/
Introduce a Makefile under arch/$ARCH/ and include it in the top Makefile (similar to Linux kernel). This allows further refactoringi like moving architecture-specific code out of global makefiles, deprecating config variables (CPU, CPUDIR, SOC) or deprecating arch/$ARCH/config.mk. In contrary to Linux kernel, U-Boot defines the ARCH variable by Kconfig, thus the arch Makefile can only included conditionally after the top config.mk. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Showing 17 changed files with 150 additions and 39 deletions Side-by-side Diff
- Makefile
- arch/arc/Makefile
- arch/arm/Makefile
- arch/avr32/Makefile
- arch/blackfin/Makefile
- arch/m68k/Makefile
- arch/microblaze/Makefile
- arch/mips/Makefile
- arch/nds32/Makefile
- arch/nios2/Makefile
- arch/openrisc/Makefile
- arch/powerpc/Makefile
- arch/sandbox/Makefile
- arch/sh/Makefile
- arch/sparc/Makefile
- arch/x86/Makefile
- scripts/Makefile.spl
Makefile
... | ... | @@ -503,6 +503,7 @@ |
503 | 503 | -path ./include/config/auto.conf -newer $(KCONFIG_CONFIG))) |
504 | 504 | ifneq ($(autoconf_is_current),) |
505 | 505 | include $(srctree)/config.mk |
506 | +include $(srctree)/arch/$(ARCH)/Makefile | |
506 | 507 | endif |
507 | 508 | |
508 | 509 | # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use |
509 | 510 | |
510 | 511 | |
... | ... | @@ -601,17 +602,11 @@ |
601 | 602 | ######################################################################### |
602 | 603 | # U-Boot objects....order is important (i.e. start must be first) |
603 | 604 | |
604 | -head-y := $(CPUDIR)/start.o | |
605 | -head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o | |
606 | -head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o | |
607 | - | |
608 | 605 | HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) |
609 | 606 | |
610 | 607 | libs-y += lib/ |
611 | 608 | libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ |
612 | -libs-y += $(CPUDIR)/ | |
613 | 609 | libs-$(CONFIG_OF_EMBED) += dts/ |
614 | -libs-y += arch/$(ARCH)/lib/ | |
615 | 610 | libs-y += fs/ |
616 | 611 | libs-y += net/ |
617 | 612 | libs-y += disk/ |
... | ... | @@ -650,17 +645,6 @@ |
650 | 645 | libs-$(CONFIG_HAS_POST) += post/ |
651 | 646 | libs-y += test/ |
652 | 647 | libs-y += test/dm/ |
653 | - | |
654 | -ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) | |
655 | -libs-y += arch/$(ARCH)/imx-common/ | |
656 | -endif | |
657 | - | |
658 | -ifneq (,$(filter $(SOC), armada-xp kirkwood)) | |
659 | -libs-y += arch/$(ARCH)/mvebu-common/ | |
660 | -endif | |
661 | - | |
662 | -libs-$(CONFIG_ARM) += arch/arm/cpu/ | |
663 | -libs-$(CONFIG_PPC) += arch/powerpc/cpu/ | |
664 | 648 | |
665 | 649 | libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/) |
666 | 650 |
arch/arc/Makefile
arch/arm/Makefile
1 | +# | |
2 | +# SPDX-License-Identifier: GPL-2.0+ | |
3 | +# | |
4 | + | |
5 | +head-y := arch/arm/cpu/$(CPU)/start.o | |
6 | + | |
7 | +ifeq ($(CONFIG_SPL_BUILD),y) | |
8 | +ifneq ($(CONFIG_SPL_START_S_PATH),) | |
9 | +head-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o | |
10 | +endif | |
11 | +endif | |
12 | + | |
13 | +libs-y += arch/arm/cpu/$(CPU)/ | |
14 | +libs-y += arch/arm/cpu/ | |
15 | +libs-y += arch/arm/lib/ | |
16 | + | |
17 | +ifeq ($(CONFIG_SPL_BUILD),y) | |
18 | +ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) | |
19 | +libs-y += arch/arm/imx-common/ | |
20 | +endif | |
21 | +else | |
22 | +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610)) | |
23 | +libs-y += arch/arm/imx-common/ | |
24 | +endif | |
25 | +endif | |
26 | + | |
27 | +ifneq (,$(filter $(SOC), armada-xp kirkwood)) | |
28 | +libs-y += arch/arm/mvebu-common/ | |
29 | +endif |
arch/avr32/Makefile
arch/blackfin/Makefile
arch/m68k/Makefile
arch/microblaze/Makefile
arch/mips/Makefile
arch/nds32/Makefile
arch/nios2/Makefile
arch/openrisc/Makefile
arch/powerpc/Makefile
1 | +# | |
2 | +# SPDX-License-Identifier: GPL-2.0+ | |
3 | +# | |
4 | + | |
5 | +head-y := arch/powerpc/cpu/$(CPU)/start.o | |
6 | +head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o | |
7 | +head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o | |
8 | + | |
9 | +libs-y += arch/powerpc/cpu/$(CPU)/ | |
10 | +libs-y += arch/powerpc/cpu/ | |
11 | +libs-y += arch/powerpc/lib/ |
arch/sandbox/Makefile
arch/sh/Makefile
arch/sparc/Makefile
arch/x86/Makefile
scripts/Makefile.spl
... | ... | @@ -34,6 +34,7 @@ |
34 | 34 | endif |
35 | 35 | |
36 | 36 | include $(srctree)/config.mk |
37 | +include $(srctree)/arch/$(ARCH)/Makefile | |
37 | 38 | |
38 | 39 | # Enable garbage collection of un-used sections for SPL |
39 | 40 | KBUILD_CFLAGS += -ffunction-sections -fdata-sections |
... | ... | @@ -45,21 +46,6 @@ |
45 | 46 | |
46 | 47 | HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) |
47 | 48 | |
48 | -ifdef CONFIG_SPL_START_S_PATH | |
49 | -START_PATH := $(CONFIG_SPL_START_S_PATH:"%"=%) | |
50 | -else | |
51 | -START_PATH := $(CPUDIR) | |
52 | -endif | |
53 | - | |
54 | -head-y := $(START_PATH)/start.o | |
55 | -head-$(CONFIG_X86) += $(START_PATH)/start16.o $(START_PATH)/resetvec.o | |
56 | -head-$(CONFIG_4xx) += $(START_PATH)/resetvec.o | |
57 | -head-$(CONFIG_MPC85xx) += $(START_PATH)/resetvec.o | |
58 | - | |
59 | -libs-y += arch/$(ARCH)/lib/ | |
60 | - | |
61 | -libs-y += $(CPUDIR)/ | |
62 | - | |
63 | 49 | libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/) |
64 | 50 | libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ |
65 | 51 | |
... | ... | @@ -93,13 +79,6 @@ |
93 | 79 | libs-$(CONFIG_SPL_USB_HOST_SUPPORT) += drivers/usb/host/ |
94 | 80 | libs-$(CONFIG_OMAP_USB_PHY) += drivers/usb/phy/ |
95 | 81 | libs-$(CONFIG_SPL_SATA_SUPPORT) += drivers/block/ |
96 | - | |
97 | -ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) | |
98 | -libs-y += arch/$(ARCH)/imx-common/ | |
99 | -endif | |
100 | - | |
101 | -libs-$(CONFIG_ARM) += arch/arm/cpu/ | |
102 | -libs-$(CONFIG_PPC) += arch/powerpc/cpu/ | |
103 | 82 | |
104 | 83 | head-y := $(addprefix $(obj)/,$(head-y)) |
105 | 84 | libs-y := $(addprefix $(obj)/,$(libs-y)) |