Hi Dick,

On Thu, Jun 29, 2000 at 02:32:49PM -0700, Richard Myers wrote:
> Hi,
> 
> Sorry if this is a stupid question.  I'm trying to build an RTL 2.3
> module made up of several .c files.  All of the init, clean up, fifo
> handling and main task code are in one .c file.  The other .c files
> contain generic functions.  I can't seem to get them to compile and link
> correctly.  Are there any example Makefiles out there which show how to
> compile several .c files into one RTL .o module?  Every example I've
> found has just one RT .c file.
> 

Your question occurs periodically in this list, should be put to a
FAQ file. Your friend is called partial linking (ld -r). My example
follows.

ld -r ./obj/dspgm.mo ./obj/radic.mo ./obj/bankar.mo ./obj/insfil.mo 
      ./obj/ruovl.mo ./obj/kinem.mo ./obj/konst.mo ./obj/prmul.mo 
      ./obj/invul.mo ./obj/algeb.mo ./obj/affix.mo ./obj/chybnik.mo 
      ./obj/vykfo.mo ./obj/syntax.mo ./obj/sensor.mo ./obj/host.mo 
      ./obj/declare.mo ./obj/move.mo ./obj/inter.mo ./obj/synch.mo 
      ./obj/begend.mo ./obj/savloa.mo ./obj/ttdrv.mo ./obj/display.mo 
      ./obj/tabul.mo -L/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 
      -L/usr/lib -L../../libobjs -lmodn -lm -lgcc -M 
      -o robol.m > ./maps/robol.m.map

where 

robol.m is   the loadable RT module (product of the linking)
./obj/*.mo   objects obtained by separete compilation of *c files (gcc -c)
-L*          library path
-l*          name of the library to be linked with
./maps/robol.m.map - map file 

Regards,

pa

-- 
..........................................................................
Pavel Andris                               | tel: +421 7 5941 2167
Institute of Control Theory and Robotics   | fax: +421 7 5477 6045
Slovak Academy of Sciences                 | 
Dubravska cesta 9                          | e-mail: [EMAIL PROTECTED]
SK - 842 37 Bratislava                     |
Slovakia                                   |
.........................................................................
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to