Gang,

> HI
>    compile u'r code in the following way,
> 
>    $(CC) ${INCLUDE} ${CFLAGS} -c -o tempc_temp.o tempc.c
>      $(LD) -r -static tempc_temp.o -o tempc.o -L/usr/lib 
> -L/usr/lib -lc
> 
> and one  more suuggestion, what ever u are telling is not a 
> make file for
> u'r programme
> in "rtl.mk"   u will be having few  flag variables useful 
> while  compiling,
>   have a habit of  writing u'r own make file for u'r programmes ,
>   use  variables defined in this sys geneaterd  "rtl.mk" in 
> u'r make file.

        It is not really obvious to me what Chandu is trying to say above,
so I will outline what *I* do to make an rtl module from multiple source
files.  By way of example, I'll include a small Makefile which I will
liberally comment for your viewing pleasure.

----- Begin Makefile -----

#
# This is a list of object files to be used to generate the module.
#
OBJECTS = main.o front_panel.o net_process.o

#
# Specify the libraries required.  I almost always need libm.  The libgcc is
to provide the 64 bit 
# integer routines like idiv3.  Note this mechanism finds it automatically
assuming gcc is on your 
# path.  If gcc is not on your path, you will have bigger problems than not
finding idiv3...
#
LIBPATHS= -L/usr/lib
LIBGCC := $(shell $(CC) -print-libgcc-file-name)
LIBS = -lm

#
# The main target - lists everything to be built - one module in this case.
#
# In my case, I also have it synch the filesystem and remove the old module
so that I am ready to 
# insert the new module.  The sync;sync;sync is to make rebooting easier
when my module crashes the 
# system.
#
all: testprog.o
        sync; sync; sync
        -rmmod testprog

#
# The following line actually builds the output module.  The -r on the ld
command line says to build
# an output .o file without resolving all of the symbols.  Any unresolved
symbols will be flagged at 
# module load time.
#
testprog.o:             $(OBJECTS)
        $(LD) -r  -o acu.o $(OBJECTS) $(LIBPATHS) -static $(LIBS) $(LIBGCC)

#
# The following are the dependencies for the individual object files.  The
flags defined in the 
# rtl.mak file will take care of compiling these properly.
#
main.o:         main.c main.h

front_panel.o:  front_panel.c front_panel.h net_process.h main.h

net_process.o:  net_process.c net_process.h main.h

#
# Finally, I include the rtl.mk file to get all the build rules used by
RTLinux into my Makefile.  This
# is by far the easiest way to make sure that you have all the correct
definitions on your various
# command lines.
#

include /usr/include/rtlinux/rtl.mk

----- End Included Makefile -----

        I hope this has been helpful for the original requestor.  Perhaps
this type of information should be added to a FAQ?

Regards,

Steve Cohen

-- [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/

Reply via email to