LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2008, 01:45 AM   #1
bertubezz
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Creat output directories with gcc


Does gcc has an option to create the directory path of the output object file?

For example:

gcc -o linux/debug/hello.o hello.c

if linux/debug path does not exist it will produce an error:

/usr/bin/ld: cannot open output file linux/debug/hello.o: No such file or directory
collect2: ld returned 1 exit status


so you have to first create linux/debug and then run the command.

Is there a way to tell the gcc compiler to create the directories automatically.

thanks,
Albert
 
Old 11-07-2008, 01:52 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
That is what makefiles are for.
 
  


Reply

Tags
gcc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I save gcc output in a file ? techsavvy Linux - General 3 06-24-2008 07:38 AM
which directories do I untar during GCC pass2? microsoft/linux Linux From Scratch 6 09-09-2005 08:35 AM
updating gcc - am I specifying correct directories mullera Linux - Software 0 01-13-2005 09:07 AM
How to reconfigure GCC search directories jsmerritt Linux - Software 0 08-20-2004 10:59 AM
output in graphic mode with gcc Rex_chaos Linux - General 6 05-12-2002 03:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration