From patchwork Mon Sep 30 11:09:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 279112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id C8F112C00BA for ; Mon, 30 Sep 2013 21:09:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E5BFA8C77B; Mon, 30 Sep 2013 11:09:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xo4goj0lgy0j; Mon, 30 Sep 2013 11:09:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id DA32D8C193; Mon, 30 Sep 2013 11:09:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8DF0D1C22F3 for ; Mon, 30 Sep 2013 11:09:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 884DE8BEA1 for ; Mon, 30 Sep 2013 11:09:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WX-msaKi0UAT for ; Mon, 30 Sep 2013 11:09:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ee0-f46.google.com (mail-ee0-f46.google.com [74.125.83.46]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4C5158ADDB for ; Mon, 30 Sep 2013 11:09:52 +0000 (UTC) Received: by mail-ee0-f46.google.com with SMTP id c13so2593650eek.33 for ; Mon, 30 Sep 2013 04:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:content-transfer-encoding:subject :message-id:in-reply-to:references:user-agent:date:from:to:cc; bh=3baXgDZXUIvwtXBKMprE3pHzzwbgzIo1RZ1/g2Jy3po=; b=cLXsiei97R+GjU2JxjPP/oMa4YoarnVfZDbo3p7T9A2cp8DFi58CTZjRGIxE71hRss YNrpbGol7oTdQ+emKBiYTlYtCtBJHMz+xJNUISfsRr2xgdrMiVAKteKP5hTzduBFVsro dcAilabK+FAaK/iBw455bUSEbaBEn+/JW1y/JBMd5w+o/AcvQcDEM3Y+c7ZpkdKjxRcl 1uaxevJEJitDRFJS2SKoa1LXMR4sz/6k/lEFGwSLjXLfA2f0cfGSL6piHmHk2I8SvfZD C+OphSfRbg43Rj/XKVWZ2SjJ/2hQTZYenmBViSIL6kO/1mLlOBWxxFoGtBgQSQPhk6W3 o1Qg== X-Received: by 10.14.194.131 with SMTP id m3mr12929208een.45.1380539390799; Mon, 30 Sep 2013 04:09:50 -0700 (PDT) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPSA id a1sm49966223eem.1.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Sep 2013 04:09:50 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: 2c5cb4c167d3cb700c22c7b60f512d56ae3b1e84 Message-Id: <2c5cb4c167d3cb700c22.1380539366@argentina> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.2.2 Date: Mon, 30 Sep 2013 13:09:26 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Cc: thomas.petazzoni@free-electrons.com Subject: [Buildroot] [PATCH 1 of 2] make clean: improve when no .config present X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The 'make clean' recipe is using variables that are not defined without .config file, causing only a partial cleanup when the .config file is accidentally deleted. This patch moves those variables that do not depend on values from .config outside the BR2_HAVE_DOT_CONFIG check, so that 'make clean' is much more similar with and without .config. The HOST_DIR (and the derived STAGING_DIR) are determined from BR2_HOST_DIR in .config, so the host directory can still not be cleaned correctly without making assumptions, if no .config is present. Signed-off-by: Thomas De Schampheleire --- Note: we could improve the HOST_DIR cleanup by removing 'output/host' unconditionally, but it's an assumption. Let me know your thoughts on this, it could be fixed in another patch. Makefile | 23 ++++++++++------------- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -193,7 +193,17 @@ BASE_DIR := $(shell mkdir -p $(O) && cd $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) BUILD_DIR:=$(BASE_DIR)/build +STAMP_DIR:=$(BASE_DIR)/stamps +BINARIES_DIR:=$(BASE_DIR)/images +TARGET_DIR:=$(BASE_DIR)/target +LEGAL_INFO_DIR=$(BASE_DIR)/legal-info +REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources +LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses +LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv +LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt +LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings +LEGAL_REPORT=$(LEGAL_INFO_DIR)/README ifeq ($(BR2_HAVE_DOT_CONFIG),y) @@ -262,21 +272,8 @@ HOST_DIR:=$(call qstrip,$(BR2_HOST_DIR)) # locales to generate GENERATE_LOCALE=$(call qstrip,$(BR2_GENERATE_LOCALE)) -# stamp (dependency) files go here -STAMP_DIR:=$(BASE_DIR)/stamps - -BINARIES_DIR:=$(BASE_DIR)/images -TARGET_DIR:=$(BASE_DIR)/target TARGET_SKELETON=$(TOPDIR)/system/skeleton -LEGAL_INFO_DIR=$(BASE_DIR)/legal-info -REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources -LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses -LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv -LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt -LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings -LEGAL_REPORT=$(LEGAL_INFO_DIR)/README - # Location of a file giving a big fat warning that output/target # should not be used as the root filesystem. TARGET_DIR_WARNING_FILE=$(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM