Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751847Ab1CJFZl (ORCPT ); Thu, 10 Mar 2011 00:25:41 -0500 Received: from smtp-out.google.com ([74.125.121.67]:52463 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106Ab1CJFZk (ORCPT ); Thu, 10 Mar 2011 00:25:40 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=EYQYslx0781KBI+2ftqtxS1ZUdfVOGsy54zy3ctBO9nyDrEJgNG/LEZPYyKcjCIq/F fX7zOgSHrTWLPKebZPcw== MIME-Version: 1.0 In-Reply-To: <1299727594.15854.310.camel@gandalf.stny.rr.com> References: <1299715137-22768-1-git-send-email-dhsharp@google.com> <1299715137-22768-3-git-send-email-dhsharp@google.com> <4D7828F9.7000906@linux.intel.com> <1299720997.15854.276.camel@gandalf.stny.rr.com> <4D783038.8080103@linux.intel.com> <1299725486.15854.281.camel@gandalf.stny.rr.com> <1299727594.15854.310.camel@gandalf.stny.rr.com> From: David Sharp Date: Wed, 9 Mar 2011 21:25:17 -0800 Message-ID: Subject: Re: [PATCH trace-cmd 3/3] Revert "trace-cmd: Use conditional assignment of CC and AR" To: Steven Rostedt Cc: Darren Hart , linux-kernel@vger.kernel.org, mrubin@google.com Content-Type: text/plain; charset=UTF-8 X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1147 Lines: 42 On Wed, Mar 9, 2011 at 7:26 PM, Steven Rostedt wrote: > On Wed, 2011-03-09 at 21:51 -0500, Steven Rostedt wrote: > >> I'll play with some other make tricks and see if I can come up with a >> better solution. > > OK, it didn't take me long to come up with "Makefiles suck" ;) Yes, except for very basic things. > > But I did come up with a solution: > > ifneq ("$(origin CC)", "environment") > CC = gcc > endif > > CC := $(CROSS_COMPILE)$(CC) > > This wont let make CC=xx work unless I also add a: > > ifneq ("$(origin CC)", "command line") > > around the above if, but do we care? > > -- Steve This seems to do it all: define allow-override $(if $(or $(findstring environment,$(origin $(1))), $(findstring command line,$(origin $(1)))),,\ $(eval $(1) = $(2))) endef $(call allow-override,CC,$(CROSS_COMPILE)gcc) $(call allow-override,AR,$(CROSS_COMPILE)ar) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/