www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/21/12:04:58

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: make ALL?
To: itz AT crl DOT com
Date: Tue, 21 Jun 94 8:34:07 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Mailer: Elm [revision: 70.85]

> Thanks to all who have responded to my post. After a sound sleep I found
> an easy and clean solution to the original problem: 
> 
> ifdef ALL
> $(OBJS): FORCE
> 
> FORCE:
> 
> endif
> 
> However, the problem immediately reappeared in a more intractable guise. 
> How to pass _many, many_ objects to the linker? Use a here (@) file, you 
> say. OK, but how do the names get there? In the end, one program or 
> another will have to handle them all on its command line. So the use of 
> special go32/gnuish facilities noted by several people seems necessary.
> 
> BTW, I already tried to pass a super-long command-line to the djgpp echo 
> program from within my makefile. Seems to work all right, ...as long as 
> I don't try to redirect the output! As soon as I write
>
> myprog.lnk: $(OBJS)
> 	-rm $@
> 	echo $^ >>$@
> 

As long as there are no shell metacharacters in the line, then GNU
make can use the special go32 method of passing long command lines.
But once there are metacharacters (like the ">>"), then GNU make has
to send the line to the shell, which is COMMAND.COM, and which doesn't
know how to deal with long command lines.

Fortunately, the linker is a go32 program, and you don't need to
redirect the output.  You should be able to do:

myprog:	$(OBJS)
	gcc -o myprog $(OBJS) $(LIBS)

And this should work even when there are LOTS of object files.  No
need for a @ file.  No need for xargs.
--
				Eric Backus
				ericb AT lsid DOT hp DOT com
				(206) 335-2495

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019