Building a module in a different folder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

 I had written a small HelloWorld module; I had prepared this simple
Makefile for it:

obj-m    := HelloWorld.o

KDIR    := /lib/modules/$(shell uname -r)/build

PWD    := $(shell pwd)

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules


I ran make, the ko file was created, and I could insmod the module.

I want to be able to run make and that the results (the *.o and
*.ko and all intermediate results) will be in a different folder,
named myFolder.
What should I do ?
I tried to run make make make O=myFolder (where  myFolder is a directory
I created under where I am ) but I got errors.
How should this be done?
Moreover: can this be done by setting some option in the Makefile itself ?

Regards,
Ian

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux