Hi Vijay,
> I still am not sure how to name my module anything other than module.o
> I would rather have my module named glcd.o but that is one of the
> files I already have (glcd.c)...
>
> I am not sure how to provide a custom module name if one has multiple
> files to compile one module.
Below is a 2.6 driver Makefile example. The drivers built are;
plx.ko - built from plx_device.o and plx_driver.o
cobra.ko - plx_device.o cobra_driver.o
plx_serial.ko - plx_device.o ring_buffer.o plx_serial_driver.o
see how the plx-objs list corresponds to the driver name,
and how multiple files can be listed.
If you have both kernel code, and user-space applications
code, then I would recommend keeping them in separate
folders with separate Makefiles. That way if you want to
have identical filenames, or object names for the kernel
code and the user-space code, you won't get any weird
conflicts.
Cheers,
Dave
# COBRA Driver Makefile
#
# Device driver makefile
#
# For details on kernel modules Makefiles, see
#
# p24 "Linux Device Drivers", 3rd Ed, Rubini et al
# $KERNEL_SOURCE/Documentation/kbuild/makefiles.txt, modules.txt
#
# The COBRA_INCLUDE parameter is used to pass the include
# directory down to the kernel makefiles, as per the LDD3
# examples Makefile, eg. ldd3/examples/scull/Makefile
#
ifneq ($(KERNELRELEASE),)
obj-m := \
plx.o\
cobra.o\
plx_serial.o
plx-objs := plx_device.o plx_driver.o
cobra-objs := plx_device.o cobra_driver.o
plx_serial-objs := plx_device.o ring_buffer.o plx_serial_driver.o
# EXTRA_CFLAGS += -DDEBUG
EXTRA_CFLAGS += -I$(COBRA_INCLUDE)
else
KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default: modules
# Kernel modules
modules:
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) COBRA_INCLUDE=$(PWD)/../include
modules
endif
clean:
rm -rf .tmp*.o *.o *.ko *.mod.* .*.cmd .tmp_versions
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|