getting the list of input files of a gcc command line

Jonathan Wakely jwakely.gcc@gmail.com
Wed Dec 5 20:44:00 GMT 2018


On Wed, 5 Dec 2018 at 20:43, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Wed, Dec 05, 2018 at 06:37:55PM +0000, Jonathan Wakely wrote:
> > On Wed, 5 Dec 2018 at 16:44, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
> > >
> > > I would like to write a gcc wrapper and get the list of input files
> > > of the gcc command line before executing gcc. As a heuristic, I could
> > > get all the arguments with some extension like .c and .h, but is
> > > there a more reliable way?
> >
> > Look for any argument that doesn't start with '-' or '@' ?
>
> Some options take a filename as a separate argument.  Like "-o that.o".

D'oh, of course.



More information about the Gcc-help mailing list