All of lore.kernel.org
 help / color / mirror / Atom feed
* out-of-tree configuration
@ 2014-06-18 13:03 John Bougs
  2014-06-18 13:46 ` Anders Darander
  0 siblings, 1 reply; 6+ messages in thread
From: John Bougs @ 2014-06-18 13:03 UTC (permalink / raw)
  To: kernelnewbies

I am working with a kernel module that has a few kconfig options associated
with it. The makefile for the module as it is does not support out-of-tree
builds. I am trying to change the the makefile to do out-of-tree builds.
Most of this is pretty straight forward, however I can't seem to find any
recomendations on to do local configurations for just the out of tree build.

right now I use the code below, but I don't realy think it is a good
solution because of the possible confilict between the local .config file
and the kernel .config file. Any suggestions on how I should handle this? 



ifneq ($(KERNELRELEASE),)
# kbuild part of makefile

# Optionally, include config file to allow out of tree kernel modules build
-include $(src)/.config

# Core module
obj-$(CONFIG_XXX)             += xxx.o
xxx-y                         += xxx-core.o xxx-sysfs.o 

# drivers
obj-$(CONFIG_XXX_1)    += xxx1.o
obj-$(CONFIG_XXX_2)    += xxx2.o


else
# normal makefile
KDIR ?= /lib/modules/`uname -r`/build

default: .config
	$(MAKE) -C $(KDIR) M=$$PWD modules

.config:
	@echo need local .config
	exit 1

modules_install: 
	$(MAKE) -C $(KDIR) M=$$PWD modules_install
	

clean:
	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions \
	       modules.order Module.symvers

endif

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

end of thread, other threads:[~2014-06-18 15:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 13:03 out-of-tree configuration John Bougs
2014-06-18 13:46 ` Anders Darander
2014-06-18 14:02   ` john bougs
2014-06-18 14:14     ` Valdis.Kletnieks at vt.edu
2014-06-18 14:30     ` Anders Darander
2014-06-18 15:13       ` john bougs

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.