www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/04/01/11:23:58

Date: Wed, 1 Apr 92 09:10:49 CST
From: mgx!thite AT uu DOT psi DOT com (Tom Hite)
To: djgpp AT sun DOT soe DOT clarkson DOT edu, soyata AT phi DOT ece DOT jhu DOT edu
Subject: Re: Many many object files
Status: O

>Hi,
>Has anyone tried to link many many many.... object files? Since the DOS
>is limited by the 128-character command lines, I was not able to link
>more than SOME number (say 16) of object codes. Do I have to rename object
>file names every time as 1.o 2.o .... etc. Even this wouldn't help if
>I tried to link 300 object files!!!!! Is there an "indirect" link command
>just like Borland's "@". ????

All you have to do is something like:

#-------------------------------------------------------------------------

C_FILES=this.c is.c some.c c.c files.c
O_FILES=$(C_FILES:.c=.o)  # if your make can't do this, do it literally
LIBS=-lpc -lm

program:
        echo $(O_FILES) >link.rsp
        echo $(LIBS)    >>link.rsp
        gcc -o $* $(LDFLAGS) @link.rsp

#--------------------------------------------------------------------------

I have done GOBS of .o files this way.  And, you don't need any fancy
make features, just simple DOS commands.  As I figure it, gcc doesn't care
how many files you put on a line in the response file.  Not so far as I
can tell anyway.  If it does, just break your C_ and O_ macros up.

Tom Hite
thite AT micrografx DOT com

- Raw text -


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