To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1933
1932  |  1934
Subject: 
Re: Multiple source files
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 16 Jul 2001 05:42:06 GMT
Viewed: 
1654 times
  
Hi,

Assuming you have a.C and b.C, and you want to build b.lx, then the following
Makefile fragment will work, if you patch your Makefile.user as given below.

**** Begin Makefile Fragment ****

all: b.lx # Specify all targets to build

b.ds1 b.ds2: b.o a.o    # Specify all objects to combine together

**** End Makefile Fragment ****

**** Begin Makefile.user patch ****
Index: Makefile.user
===================================================================
RCS file: /cvsroot/legos/legOS/Makefile.user,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 Makefile.user
26,27c26,27
< %.dcoff: %.o $(DOBJECTS) $(DYNAMIC_LDS)
<       $(LD) $(DLDFLAGS) $*.o $(DOBJECTS) $(LIBS) -o $*.dcoff -Ttext $(BASE1)
--oformat coff-h8300
---
%.dcoff: %.o $(DOBJECTS) # $(DYNAMIC_LDS)
      $(LD) $(DLDFLAGS) $^ $(LIBS) -o $@ -Ttext $(BASE1) --oformat coff-h8300
31c31
<       $(NM) $*.dcoff | sort > $*.dmap
---
      $(NM) $< | sort > $@
35c35
<       $(OBJDUMP) $(ODFLAGS) $*.dcoff > $*.dis
---
      $(OBJDUMP) $(ODFLAGS) $< > $@
39c39
<       $(MERGEMAP) $*.dmap $*.dis > $*.dis2
---
      $(MERGEMAP) $^ > $@
42,43c42,43
< %.ds1: %.o $(DOBJECTS) $(DYNAMIC_LDS)
<       $(LD) $(DLDFLAGS) $*.o $(DOBJECTS) $(LIBS) -o $*.ds1 -Ttext $(BASE1)
---
%.ds1: %.o $(DOBJECTS) # $(DYNAMIC_LDS)
      $(LD) $(DLDFLAGS) $^ $(LIBS) -o $@ -Ttext $(BASE1)
46,47c46,47
< %.ds2: %.o $(DOBJECTS) $(DYNAMIC_LDS)
<       $(LD) $(DLDFLAGS) $*.o $(DOBJECTS) $(LIBS) -o $*.ds2 -Ttext $(BASE2)
---
%.ds2: %.o $(DOBJECTS) # $(DYNAMIC_LDS)
      $(LD) $(DLDFLAGS) $^ $(LIBS) -o $@ -Ttext $(BASE2)
50c50
<       $(MAKELX) $*.ds1 $*.ds2 $*.lx
---
      $(MAKELX) $^ $@
**** End Makefile.user patch ****

Let me know if this works for you.

Pat

In lugnet.robotics.rcx.legos, Michael James writes:
How can I reconfigure the makefiles to allow me to create a .lx file from
multiple .cpp files?  I am not familiar with the compiler and its tools.



Message has 1 Reply:
  Re: Multiple source files
 
(this comes up because I'm finally trying to incorporate these changes into the next release of legOS... -Stephen) (...) This part didn't work for me! The dependency only rule didn't work. I'm running on Debian (GNU make 3.79.1, as shown by 'make (...) (23 years ago, 28-Apr-02, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Multiple source files
 
How can I reconfigure the makefiles to allow me to create a .lx file from multiple .cpp files? I am not familiar with the compiler and its tools. (23 years ago, 13-Jul-01, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR