From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rene Herman Subject: Re: Per option CFLAGS? Date: Sat, 15 Sep 2007 01:30:21 +0200 Message-ID: <46EB198D.2040208@gmail.com> References: <46EB141A.7090200@gmail.com> <46EB1599.4020806@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from smtpq1.groni1.gr.home.nl (smtpq1.groni1.gr.home.nl [213.51.130.200]) by alsa0.perex.cz (Postfix) with ESMTP id 63136245DF for ; Sat, 15 Sep 2007 01:30:54 +0200 (CEST) In-Reply-To: <46EB1599.4020806@zytor.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: "H. Peter Anvin" Cc: Kai Germaschewski , ALSA devel , Sam Ravnborg , Linux Kernel List-Id: alsa-devel@alsa-project.org On 09/15/2007 01:13 AM, H. Peter Anvin wrote: > Rene Herman wrote: >> I have a single file foo.c that I want to generate two (ALSA) modules >> from, snd-foo2000.ko and snd-foo2001.ko, by compiling with either >> FOO2000 or FOO2001 defined. >> >> I can do this, and ALSA does this a few times, by providing dummy >> foo2000.c and foo2001.c files, like: >> >> === foo2000.c >> #define FOO2000 >> #include "foo.c" >> === >> >> and a regular Makefile >> >> === >> foo2000-objs := foo2000.o >> foo2001-objs := foo2001.o >> >> obj-$(CONFIG_SND_FOO2000) += snd-foo2000.o >> obj-$(CONFIG_SND_F002001) += snd-foo2001.o >> === >> >> That #include is a little lame though. Is there a nicer way? I noticed >> the per-file CFLAGS, but given that it's one source file for both, that >> doesn't fit. >> > > The stub source file is usually considered a good way to do this. Mmm. If I'll have to live with it, I can, but thought I'd ask if there was some nice build trickery available instead. Rene.