[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: Non-member submission from [Tony Denault <denault@hawaii.edu>] (fwd)



>From owner-rtl Fri May  4 00:10:25 2001
Received: from m1.hawaii.edu (pmdf@m1.hawaii.edu [128.171.94.13])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f446AOJ20642
	for <rtl@fsmlabs.com>; Fri, 4 May 2001 00:10:25 -0600
Received: from CONVERSION-DAEMON.m1.hawaii.edu by m1.hawaii.edu
 (PMDF V6.0-24 #38433) id <0GCS00501RMLLG@m1.hawaii.edu>; Thu,
 03 May 2001 20:06:21 -1000 (HST)
Received: from uhunix1.its.hawaii.edu (uhunix1.its.hawaii.edu [128.171.44.6])
 by m1.hawaii.edu (PMDF V6.0-24 #38433)
 with ESMTP id <0GCS004F2RML89@m1.hawaii.edu>; Thu,
 03 May 2001 20:06:21 -1000 (HST)
Received: from localhost (denault@localhost)	by uhunix1.its.hawaii.edu
 (8.8.8+Sun/8.8.8) with ESMTP id UAA15121	for <rtl@fsmlabs.com>; Thu,
 03 May 2001 20:06:20 -1000 (HST)
Date: Thu, 03 May 2001 20:06:20 -1000 (HST)
From: Tony Denault <denault@hawaii.edu>
Subject: Make file.
In-reply-to: <D21594F4685AD411A57A00A0C90AEAB72FD64F@SRV032>
X-X-Sender: <denault@uhunix1>
To: rtl@fsmlabs.com
Message-id: <Pine.GSO.4.33.0105031954240.11231-100000@uhunix1>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII
X-Authentication-warning: uhunix1.its.hawaii.edu: denault owned process doing
 -bs


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: denault@irtf.ifa.hawaii.edu |
| NASA IRTF, Institute of Astronomy   |                 Phone: (808) 974-4206 |
| 1175 Manono St., Bldg 393           |                   Fax: (808) 974-4207 |
| Hilo, Hawaii 96720                  |                                       |
\-----------------------------------------------------------------------------/