From patchwork Mon Oct 21 02:53:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 285098 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 85DA12C00A7 for ; Mon, 21 Oct 2013 13:56:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA57D4A183; Mon, 21 Oct 2013 04:56:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r4-fw5ZgEPsO; Mon, 21 Oct 2013 04:56:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BBAFD4A191; Mon, 21 Oct 2013 04:54:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BD564A133 for ; Mon, 21 Oct 2013 04:54:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VukOQBptnznw for ; Mon, 21 Oct 2013 04:54:19 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 64ADC4A136 for ; Mon, 21 Oct 2013 04:53:56 +0200 (CEST) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id r9L2rr1p029692; Mon, 21 Oct 2013 11:53:53 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili12) with ESMTP id r9L2rro32440; Mon, 21 Oct 2013 11:53:53 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi11) id r9L2rrvb003332; Mon, 21 Oct 2013 11:53:53 +0900 Received: from poodle by lomi11.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r9L2rrSV003244; Mon, 21 Oct 2013 11:53:53 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 199622743A5E; Mon, 21 Oct 2013 11:53:53 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 21 Oct 2013 11:53:34 +0900 Message-Id: <1382324021-18932-12-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1382324021-18932-1-git-send-email-yamada.m@jp.panasonic.com> References: <1382324021-18932-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH 11/18] x86: convert makefiles to Kbuild style X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Masahiro Yamada Cc: Simon Glass --- arch/x86/config.mk | 2 +- arch/x86/cpu/Makefile | 28 ++--------------- arch/x86/cpu/coreboot/Makefile | 35 +++++---------------- arch/x86/lib/Makefile | 56 ++++++++++++---------------------- board/chromebook-x86/coreboot/Makefile | 21 +------------ 5 files changed, 31 insertions(+), 111 deletions(-) diff --git a/arch/x86/config.mk b/arch/x86/config.mk index b22959f..4a4ad80 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -31,7 +31,7 @@ LDFLAGS_FINAL += --gc-sections -pie LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 -NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) +export NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC)) export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC)) diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile index 41555ab..415bc24 100644 --- a/arch/x86/cpu/Makefile +++ b/arch/x86/cpu/Makefile @@ -8,28 +8,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -include $(TOPDIR)/config.mk - -LIB = $(obj)lib$(CPU).o - -START-y = start.o -START-$(CONFIG_X86_RESET_VECTOR) += resetvec.o start16.o -COBJS = interrupts.o cpu.o - -SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) -START := $(addprefix $(obj),$(START-y)) - -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 +extra-$(CONFIG_X86_RESET_VECTOR) += resetvec.o start16.o +obj-y = interrupts.o cpu.o diff --git a/arch/x86/cpu/coreboot/Makefile b/arch/x86/cpu/coreboot/Makefile index 18fa115..cd0bf4e 100644 --- a/arch/x86/cpu/coreboot/Makefile +++ b/arch/x86/cpu/coreboot/Makefile @@ -13,31 +13,10 @@ # SPDX-License-Identifier: GPL-2.0+ # -include $(TOPDIR)/config.mk - -LIB := $(obj)lib$(SOC).o - -SOBJS-$(CONFIG_SYS_COREBOOT) += car.o -COBJS-$(CONFIG_SYS_COREBOOT) += coreboot.o -COBJS-$(CONFIG_SYS_COREBOOT) += tables.o -COBJS-$(CONFIG_SYS_COREBOOT) += ipchecksum.o -COBJS-$(CONFIG_SYS_COREBOOT) += sdram.o -COBJS-$(CONFIG_SYS_COREBOOT) += timestamp.o -COBJS-$(CONFIG_PCI) += pci.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_SYS_COREBOOT) += car.o +obj-$(CONFIG_SYS_COREBOOT) += coreboot.o +obj-$(CONFIG_SYS_COREBOOT) += tables.o +obj-$(CONFIG_SYS_COREBOOT) += ipchecksum.o +obj-$(CONFIG_SYS_COREBOOT) += sdram.o +obj-$(CONFIG_SYS_COREBOOT) += timestamp.o +obj-$(CONFIG_PCI) += pci.o diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index f389767..638f790 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -5,41 +5,23 @@ # SPDX-License-Identifier: GPL-2.0+ # -include $(TOPDIR)/config.mk - -LIB = $(obj)lib$(ARCH).o - -COBJS-$(CONFIG_CMD_BOOTM) += bootm.o -COBJS-y += cmd_boot.o -COBJS-y += gcc.o -COBJS-y += init_helpers.o -COBJS-y += interrupts.o -COBJS-$(CONFIG_SYS_PCAT_INTERRUPTS) += pcat_interrupts.o -COBJS-$(CONFIG_SYS_PCAT_TIMER) += pcat_timer.o -COBJS-$(CONFIG_PCI) += pci_type1.o -COBJS-y += relocate.o -COBJS-y += physmem.o -COBJS-y += string.o -COBJS-$(CONFIG_SYS_X86_TSC_TIMER) += tsc_timer.o -COBJS-$(CONFIG_VIDEO_VGA) += video.o -COBJS-$(CONFIG_CMD_ZBOOT) += zimage.o - -SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) - -$(LIB): $(obj).depend $(OBJS) - $(call cmd_link_o_target, $(OBJS)) - -$(PREFIXED_LIBGCC): $(NORMAL_LIBGCC) +obj-$(CONFIG_CMD_BOOTM) += bootm.o +obj-y += cmd_boot.o +obj-y += gcc.o +obj-y += init_helpers.o +obj-y += interrupts.o +obj-$(CONFIG_SYS_PCAT_INTERRUPTS) += pcat_interrupts.o +obj-$(CONFIG_SYS_PCAT_TIMER) += pcat_timer.o +obj-$(CONFIG_PCI) += pci_type1.o +obj-y += relocate.o +obj-y += physmem.o +obj-y += string.o +obj-$(CONFIG_SYS_X86_TSC_TIMER) += tsc_timer.o +obj-$(CONFIG_VIDEO_VGA) += video.o +obj-$(CONFIG_CMD_ZBOOT) += zimage.o + +LIBGCC := $(notdir $(NORMAL_LIBGCC)) +extra-y := $(LIBGCC) + +$(obj)$(LIBGCC): $(NORMAL_LIBGCC) $(OBJCOPY) $< $@ --prefix-symbols=__normal_ - -$(LIB): $(PREFIXED_LIBGCC) - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -######################################################################### diff --git a/board/chromebook-x86/coreboot/Makefile b/board/chromebook-x86/coreboot/Makefile index e2222ab..4f2ac89 100644 --- a/board/chromebook-x86/coreboot/Makefile +++ b/board/chromebook-x86/coreboot/Makefile @@ -12,23 +12,4 @@ # SPDX-License-Identifier: GPL-2.0+ # -include $(TOPDIR)/config.mk - -LIB = $(obj)lib$(BOARD).o - -SOBJS-y += coreboot_start.o - -SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) - -$(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 += coreboot_start.o