how to let GPP/GCC read command line switches from a file ?

Discussion in 'C++' started by Rolf Hemmerling, Nov 19, 2003.

  1. Hello !

    How to let GPP/GCC read command line switches from a file, **for Windows** ?

    I was told a Linux solution:
    "Your options in options.txt
    Then: gcc $(cat options.txt)
    or: gcc `cat options.txt`"

    and I was turned to the specs option
    http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Spec-Files.html

    C/C++ compilers with "MSDOS history background" like Microsoft VC++ 7 ,
    OpenWatcom and Borland C++ 5.5 have the "@filename" option to put
    command line options for the linker and compiler into a text file. This
    text file might be even compiled by a makefile at runtime, which are
    stored in the makefile itself.

    a) So is there any trick to do a file redirection like with the linux
    solution, with a DOS shell on W2k/WinXP ?

    b)
    As my GCC/GPP compiler "MingW" for Windows was just released withaout a
    specs file, is there any simple ready-made specs file which JUST offers
    the option to include the compiler/linker switches for the front end (
    so that I must not think about how to "distribute" the links to the tools) ?

    As I said, I need to let Makefile create temporary files
    1. with the options
    2. for the linker: a list of the object modules
    so thats why I need a "just-in-time" solution, as offered by DOS based
    compilers with the "@" option.

    So any help ?

    Sincerely
    Rolf
    --
    / / / Alone on the data highway...
    / / like on an allee in Hannover-Herrenhausen
    / / / The Hemmerling (R) WEB site - Rolf Hemmerling,Germany
    / / / http://www.hemmerling.com/
     
    Rolf Hemmerling, Nov 19, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rolf Hemmerling
    Replies:
    2
    Views:
    554
    Nils Petter Vaskinn
    Nov 18, 2003
  2. News
    Replies:
    17
    Views:
    444
    Larry Bates
    Apr 14, 2006
  3. News123
    Replies:
    6
    Views:
    1,242
    Michele Simionato
    Aug 3, 2010
  4. Roger

    Checking command line switches

    Roger, May 19, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    148
    Anno Siegel
    May 21, 2004
  5. kitty

    using command line switches

    kitty, Feb 13, 2006, in forum: Perl Misc
    Replies:
    5
    Views:
    133
    Tad McClellan
    Feb 14, 2006
Loading...

Share This Page