Re: help:Makefile template for device drivers with multiple directories

2006-06-09 Thread Hans Petter Selasky
On Friday 09 June 2006 04:16, [EMAIL PROTECTED] wrote:
 My problem seems to be very special. My driver module is a single one, but
 I want to build only one object for each directory (such as osd.o: osd/*.c;
 engine.o: engine/*.c; cam.o:cam/*.c). And my driver module (such as
 Shasta.ko) is constructed only by osd.o, engine.o and cam.o. I need to do
 this because we want each component (engine, cam, and osd) more
 independent. Otherwise, I have to consider the issues such as naming
 conflicts and so on. Is it possible to do so under FreeBSD?


You mean object naming conflicts or symbol naming conflicts?

If you have symbol naming conflicts, then you have to rename the 
functions/procedures. Else it won't be possible to link the module.

If you have object naming conflicts, then I think you either have to rename 
the file names, or make a customized Makefile. It is the same in the FreeBSD 
kernel. All object files have different names.

Maybe something similar to the following will do:

SRCS+= osd.o engine.o

osd.o:
 ${CC} -o osd.o ${.CURDIR}/osd/*.c

engine.o:
 ${CC} -o engine.o ${.CURDIR}/engine/*.c

--HPS
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


help:Makefile template for device drivers with multiple directories

2006-06-08 Thread hongz
Hi guys:

 

Need your helps again! The following is a Makefile template for a device
driver in FreeBSD. But when my driver source codes locate in multiple
directories (such as under osd/, engine/, and cam/), how to write the
Makefile? I have tried but still can not get through this, please give me a
help!

 

Thanks!

 

Hong

 

Note: Makefile template

.PATH:  .

KMOD= shasta

 

SRCS=  shasta.c

SRCS += device_if.h bus_if.h pci_if.h

SRCS += opt_scsi.h opt_cam.h

..

.include bsd.kmod.mk

 

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: help:Makefile template for device drivers with multiple directories

2006-06-08 Thread Artem Ignatiev


On 08.06.2006, at 14:13, [EMAIL PROTECTED]  
[EMAIL PROTECTED] wrote:


Need your helps again! The following is a Makefile template for a  
device

driver in FreeBSD. But when my driver source codes locate in multiple
directories (such as under osd/, engine/, and cam/), how to write the
Makefile? I have tried but still can not get through this, please  
give me a

help!


Are those sources of a single driver, or just subdrivers? FWIW, look  
at bsd.subdir.mk

Or you can try writing
SRCS+= osd/something.c engine/something_else.c cam/whatever_that_does.c
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: help:Makefile template for device drivers with multiple directories

2006-06-08 Thread Hans Petter Selasky
On Thursday 08 June 2006 12:13, [EMAIL PROTECTED] wrote:
 Hi guys:



 Need your helps again! The following is a Makefile template for a device
 driver in FreeBSD. But when my driver source codes locate in multiple
 directories (such as under osd/, engine/, and cam/), how to write the
 Makefile? I have tried but still can not get through this, please give me a
 help!


Does the following example help?

S=  ${.CURDIR}/../..

.PATH: $S/dev/usb $S/dev/usb2 $S/pci

KMOD=   usb
SRCS=   bus_if.h device_if.h usb_if.h usb_if.c \
vnode_if.h \
opt_usb.h \
hid.c hid.h usbhid.h \
usb_quirks.c ../usb/usb_quirks.h \
usb_ethersubr.c usbdevs.h \
_uhub.c \
_usb.c ../usb2/usb.h \
_usb_requests.c \
_usb_subr.c ../usb2/usb_subr.h \
_usb_transfer.c \
../usb2/usb_port.h

SRCS+=  _uhci_pci.c _uhci.c ../usb2/uhci.h
SRCS+=  _ohci_pci.c _ohci.c ../usb2/ohci.h
SRCS+=  _ehci_pci.c _ehci.c ../usb2/ehci.h
SRCS+=  opt_bus.h pci_if.h

.include bsd.kmod.mk

--HPS
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]