Re: Linking MANY object files together, many times

From: Leon. (noemail_at_noemail.noemail.com)
Date: 01/06/04


Date: Tue, 6 Jan 2004 10:37:10 +1100


"Chris Mantoulidis" <cmad_x@yahoo.com> wrote in message
news:a8587dd9.0401050951.374af5f@posting.google.com...
> I know there's a really easy way to do this but I can't figure out how
> to do it, since my linux experience is limited.
>
> Let's say that for example I have many object files that I link with
> my programs really frequently (almost every time).
>
> What can I do to prevent me from doing all this?
>
> Here's what I've thought of but I don't know how to implement it
>
> put the names of the object files in some variable (e.g. MYOBJECTS)
> and then do
>
> g++ -o abc abc.o MYOBJECTS
>
> How can I make that work? How can I make that MYOBJECTS variable not
> be deleted every time I reboot?

By using "make" and files call "makefile" (or Makefile) that control make.
You should use make, as it detects the case that a source file has a more
recent modification date/time than the .o file ...Currently if you edit the
source code but forget to modify the .o file, then you might take a while to
notice that you have neglected to produce the .o file from the source
file...

>
> TIA,
> cmad



Relevant Pages

  • Re: Using pre-compiled program parts with FTN95
    ... we are using Silverfrost's FTN95 compiler version ... If their routines will be called from a part of your code that they don't have source code for, you need to let them know what the names and arguments of the routines they will supply are, since they won't be able to get into your code to change the calls. ... It sounds like a slightly unusual way round to do it (normally in this sort of case they write the program, and you supply object code or libraries for their code to call) but it's not a problem. ... The linker doesn't know that they don't have the source code for the object files they give it. ...
    (comp.lang.fortran)
  • Re: Object files
    ... Some compilers can create executables directly from ... One rationale about using object files is to reduce ... are faster to process than translating source code. ...
    (comp.lang.c)
  • Re: help needed!!
    ... tessy wrote: ... the user could not open object files, ... No source code is present and so no source code changes can be made. ...
    (comp.lang.fortran)
  • Re: help needed!!
    ... tessy wrote: ... the user could not open object files, ... modules are usually binary and are similar to object files in this regard. ... The source code is not present in the module. ...
    (comp.lang.fortran)
  • Re: help needed!!
    ... modules are usually binary and are similar to object files in this regard. ... The source code is not present in the module. ... If you only distribute object code libraries, modules. ... Gary Scott ...
    (comp.lang.fortran)