delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/11/18/08:57:10

From: mcastle AT cs DOT umr DOT edu
Subject: Re: Too many files on gcc command line at link phase
To: pcrowley AT qdeck DOT com (Peter Crowley)
Date: Wed, 18 Nov 92 7:23:00 CST
Cc: raney AT metacard DOT com, djgpp AT sun DOT soe DOT clarkson DOT edu

> 
> >  This is probably a simple question (we're DOS impaired), but how
> >does one go about putting a large number of files (about 500
> >characters) on the gcc command line for the link phase?
> >  We're using the gnuish make (thanks for the suggestions!) but
> >something stops working (error 2) if there are more than about 100
> >characters on the gcc command line.  Running the link as a batch file
> >doesn't work either so it seems to be a DOS limitation.
> >  In the olden days (early 80s) link specifications were usually put
> >into a separate file.  Is this still necessary?  How is it done?
> >  Thanks in advance for any advice,
> 
> With ndmake I use the following:
>  >xv.lnk $(OBJS) $(LIBS)
>  $(CC) @xv.lnk -o xv
> 
> I have'nt seen this supported anywhere else, but I would be interested in
> anything similar for gnuishmake

GNU-ish make supports long commands lines via environment variables provided
1) the called program knows how to handle such things (go32 does) and
2) GNU-ish make (actually, the spawning library of gnuish make) knows that
   the called program knows how to do that.


You can do either one of the following:

in your autoexec.bat put in:
set longargs=make:gcc:ar:ld

or in every makefile you use put:
LONGARGS=	make:gcc:ar:ld

you may want to add other progs, but I'm not sure.



Of course, 500+ names is an AWFUL lot, and I'm not sure you won't run out
of environment space.  From reading the original posters message, I'm not 
sure he knows that go32 programs knows how to handle response files.  If 
make does choke on environment space, you make have to create you own 
response file that just lists all the files you want to link in then edit
the makefile to read something like:

gcc -o myfile @my.rsp -lm -letc 

instead of

gcc -o myfile $(MYOBJS) -lm -letc


regards,
mrc

- Raw text -


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