All of lore.kernel.org
 help / color / mirror / Atom feed
* Per option CFLAGS?
@ 2007-09-14 23:07 ` Rene Herman
  0 siblings, 0 replies; 13+ messages in thread
From: Rene Herman @ 2007-09-14 23:07 UTC (permalink / raw)
  To: Kai Germaschewski, Sam Ravnborg; +Cc: ALSA devel, Linux Kernel

Hi Kai, Sam.

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.

Rene.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-09-15 15:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-14 23:07 Per option CFLAGS? Rene Herman
2007-09-14 23:07 ` Rene Herman
2007-09-14 23:13 ` H. Peter Anvin
2007-09-14 23:30   ` Rene Herman
2007-09-14 23:30     ` Rene Herman
2007-09-15  8:47     ` Adrian Bunk
2007-09-15 15:17       ` Rene Herman
2007-09-15 15:17         ` Rene Herman
2007-09-15 15:52         ` Adrian Bunk
2007-09-15 15:52           ` Adrian Bunk
2007-09-15 15:53         ` Denys Vlasenko
2007-09-15 15:59           ` Rene Herman
2007-09-15 15:59             ` Rene Herman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.