delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/11/21:30:21

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Easy linking script question (I hope)
Date: Sat, 11 Jan 1997 19:39:53 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 43
Message-ID: <32D85D09.2757@cs.com>
References: <5b999h$20m AT tepe DOT tezcat DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp211.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark Penacho wrote:
> 
> what I am having trouble with, is coming up with a linker script file, that
> does the equivalent to
>  gcc -o myprog.exe part1.o part2.o part3.o part4.o......part30.o -lm
> but lets me specify all the part files in a linker file (the above command
> line is too long).

Hehe - you haven't looked deeply enough into DJGPP.  :)  It fully
supports command lines longer than 126 characters via a special
command-line passing format.  This only works between DJGPP v2.01
programs, however.  So, you have a couple of options:

 - Use GNU Make (v2gnu/mak375b.zip) to compile your program via a
makefile.  This is the option I recommend; I'll send you a sample
makefile if you like.

 - Use RHIDE (v2apps/rhide10b.zip) to build a project with all the
required files and let it do the work.  (See Robert Hoehne's home page
at <http://www.tu-chemnitz.de/~rho/rhide.html> for the latest updates.)

 - Write a mini-program to invoke gcc with the names of all the required
files.  Since this is roughly equivalent to a poor man's Mske, I don't
recommend it. but it will work.

DJGPP also supports a "link" file type of command-line argument.  If you
specify @<file> on the command line, it takes the contents of the
specified file and adds them to the command line.  So, if you put the
names of all your object files into a file called 'myprog.lnk', you can
compile them all with this command:

    gcc -o myprog.exe @myprog.lnk

The final option, of course, is to just use wildcards, i.e.:

    gcc -o myprog.exe *.o

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |        fighteer AT cs DOT com          |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better!  This time, you're going all the way down...|
---------------------------------------------------------------------

- Raw text -


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