I've installed rtlinux 3.0 on a 2.2.18 (slackware) kernel. I was able to
write and run a program that create periodic thread and write to a rtl
fifo. My next step was to break up the source into muliple files:
  lp_mod.c - module load/cleanup
  lp_main.c - start of new thread
  myrt_io.c - some support function.

The created the following makefile:

RTINCLUDE = -I/usr/src/rtlinux/linux/include -I/usr/src/rtlinux-3.0/include
            -I/usr/src/rtlinux-3.0/include/compat -I/usr/src/rtlinux-3.0/include/posix
INCLUDE =  $(RTINCLUDE) -I../include
CFLAGS  = -D__KERNEL__ -Wall -Wstrict-prototypes -fno-strict-aliasing -D__SMP__
   -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2
    -malign-functions=2 -DCPU=686 -g -D__RTL__ -D_LOOSE_KERNEL_NAMES
    -O2 $(INCLUDE)
CC = gcc

all: lp.o

lp.o: lp_mod.o lp_main.o mrt_io.o
   ld -r -o lp.o lp_mod.o lp_main.o mrt_io.o

lp_mod.o: lp_mod.c
   $(CC) $(CFLAGS) -DMODULE -c lp_mod.c

lp_main.o: lp_main.c
   $(CC) $(CFLAGS) -c lp_main.c

mrt_io.o: mrt_io.c
   $(CC) $(CFLAGS) -c mrt_io.c

clean:
   rm -f *.o


The problem? I can't create a good loadable module? Either I am
missing module information, can find stuff like stdio, can't compile due
to multiple define in system header...very frustrating. I'm not a makefile
expert, but have been doing C / Linux program for a number of years.

Any advice on make, order of #includes<>, etc, is appreciated..

Tony

/-----------------------------------------------------------------------------\
| Tony Denault                        | Internet: [EMAIL PROTECTED] |
| NASA IRTF, Institute of Astronomy   |                 Phone: (808) 974-4206 |
| 1175 Manono St., Bldg 393           |                   Fax: (808) 974-4207 |
| Hilo, Hawaii 96720                  |                                       |
\-----------------------------------------------------------------------------/



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