public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [HOWTO] set extra_cflags to indicate compilation against -mm kernels
@ 2005-07-30 21:29 Michael Krufky
  2005-07-31  8:44 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Krufky @ 2005-07-30 21:29 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton

With the addition of topdir-mm.patch into the -mm tree (since 
2.6.13-rc3-mm2), it is now possible for Makefile to detect whether a cvs 
subtree is being built against -mm or not...  -mm kernels now have a .mm 
file in the top level directory.

inside Makefile:

mm-kernel := $(TOPDIR)/.mm
ifneq ($(mm-kernel),)
MM_KERNEL_CFLAGS	:= -DMM_KERNEL=$(shell cat $(mm-kernel) 2> /dev/null)
ifneq ($(MM_KERNEL_CFLAGS),-DMM_KERNEL=)
EXTRA_CFLAGS		+= $(MM_KERNEL_CFLAGS)
endif
endif


inside C files:
#ifdef MM_KERNEL
/* code needed by -mm kernel only */
#else
/* original code for compilation against -linus */
#endif


This should probably be documented somewhere, but I don't know where it 
goes.......

-- 
Michael Krufky


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

end of thread, other threads:[~2005-07-31 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-30 21:29 [HOWTO] set extra_cflags to indicate compilation against -mm kernels Michael Krufky
2005-07-31  8:44 ` Sam Ravnborg
2005-07-31 14:05   ` Michael Krufky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox