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

R

Rolf Hemmerling

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
 
?

=?ISO-8859-1?Q?Rapha=EBl_Poss?=

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.
 
N

Nils Petter Vaskinn

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.3.2/gcc/Spec-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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top