Re: RTLinux Makefile for multiple sources

Allan Barredo <[email protected]> Sat, 29 Jan 2005 14:23:17 +0800
Newsgroups gmane.linux.real-time.rtlinux.general
Message-ID <[email protected]>
Thanks a lot!

On Thu, 27 Jan 2005 09:35:25 +0100, software support <[email protected]> wrote:
> 
> our makefiles are:
> 
> export-objs             := target-name.o
> 
> SRC = main.c file1.c file2.c
> OBJS = main.o file1.o file2.o
> TARGET = target-name.o
> 
> all: .depend $(TARGET)
> 
> $(TARGET):      $(OBJS)
>         $(LD) -r -o $@ $^
> 
> include /usr/rtlinux/rtl.mk
> 
> CFLAGS += -I../includes
> clean:
>         rm -f *.o *~
> 
> depend .depend dep:
>         $(CC) $(CFLAGS) -M $(SRC) > .depend
> 
> ifeq (.depend,$(wildcard .depend))
> include .depend
> endif
> 
> include $(RTL_DIR)/Rules.make
> 
> 
> On Wednesday 26 January 2005 11:06, Allan Barredo wrote:
> > Hi,
> >
> > Does someone have a simple makefile for compiling and linking an
> > RTLinux application involving multiple source files? I have been
> > trying in vain to create a simple application (file1.c) that calls
> > some functions in another file (file2.c).
> >
> > My makefile looks like:
> >
> > #start of makefile
> > include /usr/src/rtlinux/rtl.mk
> >
> > LDFLAGS += -lm
> > TARGET := main.o
> >
> > LIBRARY_OBJS := file1.o file2.o
> >
> > LDFLAGS_$(TARGET) := $(LIBRARY_OBJS)
> >
> > $(TARGET): $(LIBRARY_OBJS)
> >
> > all: $(TARGET)
> >
> > %.o: %.o
> >
> > clean:
> >
> > include /usr/src/rtlinux/Rules.make
> > #end of makefile
> >
> > The system complains about unresolved symbols (functions in file2.c)
> > whenever I try to load main.o
> >
> > Please help. Thank you very much.
> > _______________________________________________
> > Rtl mailing list
> > [email protected]
> > http://www2.fsmlabs.com/mailman/listinfo/rtl
> 
> --
> ====================================================
>   inmess GmbH
>   Frankfurter Str. 74
>   D - 64521 Gross-Gerau
>   Phone: +49 6152 97790
>   Fax  : +49 6152 977920
>   mail : [email protected]
>   web:   www.inmess.de
> ====================================================
> _______________________________________________
> Rtl mailing list
> [email protected]
> http://www2.fsmlabs.com/mailman/listinfo/rtl
> 


-- 
Allan E Barredo
MiCOM Technologies
UP Ayala Techno Park
UP Diliman QC
_______________________________________________
Rtl mailing list
[email protected]
http://www2.fsmlabs.com/mailman/listinfo/rtl