Makefile for a kernel module

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

 



Hi

I'm an experienced programmer in userspace, but am relatively new to kernel
programming.  I'm attempting to write a module, and can't find any good
documentation about what should go in the makefile.  In particular, what
flags are required for the compiler?  I've included my first attempt at a
makefile below:

CC = gcc
TARGET = acsint
DEFS = -DLINUX -DMODULE -D__KERNEL__
INC = -I/usr/src/linux/include
-I/usr/lib/gcc-lib/i386-redhat-linux/3.2/include -nostdinc
CFLAGS = -c -O2 -pipe -Wall ${DEFS} ${INC}

${TARGET}.o: ${TARGET}.c

clean:
	rm -f ${TARGET}.o

Any help appreciated

Saqib



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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