By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hello !

This question is about how to configure the most popular C++ compiler.
If you think that I am wrong here, please tell me what newsgroup WITH
relevant, existing AUDIENCE to ask again ( and not just 20 messages in a
months).

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

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.

I
read
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/index.html
but I have no clue how to do it with GCC/CPP, on Linux AND **mostly**
Windows98/ Windows 2000 !

Problem: With MSDOS & Windows, the command line is quiet limited to 128
or 256 characters, and especially a makefile does not look pretty
anymore if the lines are too long ( even many editors limit the line
lengths to 256 characters.

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/

Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> How to let GPP/GCC read command line switches from a file ?

Your options in options.txt

Then:

gcc $(cat options.txt)

or

gcc `cat options.txt`

This feature is provided by the shell which runs gcc.

Jul 22 '05 #2

P: n/a
On Tue, 18 Nov 2003 14:53:08 +0100, Rolf Hemmerling wrote:
Hello !

This question is about how to configure the most popular C++ compiler.
If you think that I am wrong here, please tell me what newsgroup WITH
relevant, existing AUDIENCE to ask again ( and not just 20 messages in a
months).
gnu.g++.help If your newsserver carries it.
I
read
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/index.html but I have no
clue how to do it with GCC/CPP, on Linux AND **mostly** Windows98/
Windows 2000 !
http://gcc.gnu.org/onlinedocs/gcc-3....pec-Files.html

You have to read more than the index.

$ info gcc
Select Invoking gcc
Select Spec files

Problem: With MSDOS & Windows, the command line is quiet limited to 128
or 256 characters,
Get a real OS, or at least a real shell.
and especially a makefile does not look pretty anymore if the lines are
too long ( even many editors limit the line lengths to 256 characters.


Get a real editor, or learn to split lines in makefiles (\), or use
$VARIABLES in them.

--
NPV

"the large print giveth, and the small print taketh away"
Tom Waits - Step right up

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.