Subject:
|
Re: Multiple source files
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Sun, 28 Apr 2002 03:30:39 GMT
|
Viewed:
|
2261 times
|
| |
| |
(this comes up because I'm finally trying to incorporate these
changes into the next release of legOS... -Stephen)
In lugnet.robotics.rcx.legos, Pat Welch writes:
> 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
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 -v')
> **** 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
<snip>
> > %.ds1: %.o $(DOBJECTS) # $(DYNAMIC_LDS)
> > $(LD) $(DLDFLAGS) $^ $(LIBS) -o $@ -Ttext $(BASE1)
The $^ does not work as it expands to 'helloworld.o ../boot/legOS.lds'
not just 'helloworld.o' as expected (or our list of .o's in the
multiple sources context.)
The corrected syntax for make is $(filter %.o, $^) which expands
to only the .o's as we really need.
> > %.ds2: %.o $(DOBJECTS) # $(DYNAMIC_LDS)
> > $(LD) $(DLDFLAGS) $^ $(LIBS) -o $@ -Ttext $(BASE2)
Ditto for this use of $^, too.
So here I am with a correction which should fix all of our
problems. However, the above problem (depends only didn't work)
prevented this solution from coming into play.
So... anybody have any idea why the 'b.ds1 b.ds2: b.o a.o' line
didn't cause '%.ds1: %.o' and '%.ds2: %.o' rules in Makefile.user
to be invoked?
All help appreciated... I'm stumped.
Regards,
Stephen member of legOS team
--
|
|
Message is in Reply To:
| | Re: Multiple source files
|
| 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: (...) (23 years ago, 16-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
|
|
|
|