Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jun 2006 10:11:21 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        hongz@promisechina.com
Cc:        freebsd-hackers@freebsd.org, 'Artem Ignatiev' <zazubrik@mail.ru>
Subject:   Re: help:Makefile template for device drivers with multiple directories
Message-ID:  <200606091011.23951.hselasky@c2i.net>
In-Reply-To: <1149819363$61755$89298172@hongz@promisechina.com>
References:  <1149819363$61755$89298172@hongz@promisechina.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 09 June 2006 04:16, hongz@promisechina.com 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606091011.23951.hselasky>