From patchwork Fri Dec 12 15:21:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 420515 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 062371400E9 for ; Sat, 13 Dec 2014 02:26:22 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3772928C205; Fri, 12 Dec 2014 16:23:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E93F228C1C8 for ; Fri, 12 Dec 2014 16:23:19 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -4.2 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by arrakis.dune.hu (Postfix) with ESMTP for ; Fri, 12 Dec 2014 16:23:18 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 106) id 2B2357FC; Fri, 12 Dec 2014 16:25:04 +0100 (CET) Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id CD453717; Fri, 12 Dec 2014 16:25:03 +0100 (CET) From: Maxime Ripard To: Florian Fainelli , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Luka Perkov , Imre Kaloz Date: Fri, 12 Dec 2014 16:21:03 +0100 Message-Id: <1418397665-28828-4-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.2.0 In-Reply-To: <1418397665-28828-1-git-send-email-maxime.ripard@free-electrons.com> References: <1418397665-28828-1-git-send-email-maxime.ripard@free-electrons.com> Cc: Thomas Petazzoni , openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH RFC 3/5] target: Add board notion support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Even though we always build all the board images for a given target, some options widely differ from one board to another when it comes to hardware configuration. Such an option for example is the NAND setup, which depends on the NAND chip itself, that obviously varies from one board to another. This kind of options used to be declared either globally for one platform, which would enforce a fragile default, or through alternate profiles, that would result in an unusable image that would still be compiled if we chose the wrong one. Introduce a new notion of boards, that would be defined in the $(PLATFORM_DIR)/boards directory, to set up this kind of board specific options, that we always want to be in-use, no matter what profile is used. Signed-off-by: Maxime Ripard --- include/target.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/target.mk b/include/target.mk index db501e06c760..b6d1c9fde9bf 100644 --- a/include/target.mk +++ b/include/target.mk @@ -87,6 +87,12 @@ define Profile endef endif +ifndef Board +define Board + TARGET_BOARDS += $(1) +endef +endif + ifneq ($(PLATFORM_DIR),$(PLATFORM_SUBDIR)) define IncludeProfiles -include $(sort $(wildcard $(PLATFORM_DIR)/profiles/*.mk)) @@ -98,11 +104,17 @@ else endef endif +define IncludeBoards + -include $(sort $(wildcard $(PLATFORM_DIR)/boards/*.mk)) +endef + ifeq ($(TARGET_BUILD),1) $(eval $(call IncludeProfiles)) + $(eval $(call IncludeBoards)) else ifeq ($(DUMP),) $(eval $(call IncludeProfiles)) + $(eval $(call IncludeBoards)) endif endif