This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: output to a directory which doesn't exit yet
- From: Ian Lance Taylor <iant at google dot com>
- To: xuantl <xuantl at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 25 Jul 2006 23:22:32 -0700
- Subject: Re: output to a directory which doesn't exit yet
- References: <ea4v8d$d9$1@sea.gmane.org>
xuantl <xuantl@gmail.com> writes:
> "gcc -c -o ./objs/foo.o foo.c"
> The above command will put foo.o to the directory ./objs. But if
> ./objs doesn't exist, gcc will prompt error. How to make gcc to create
> the output directory automatically ?
There is no way to make gcc create the directory.
Sorry.
Of course it will work to do
mkdir -p ./objs; gcc -c -o ./objs/foo.o foo.c
Ian