Advertisement

03.06.2008 at 09:59AM PST, ID: 23220430
[x]
Attachment Details

Makefile using cd to change to a directory under the current

Asked by cenetadmin in Linux Programming

Tags: c+, Linux

I have a make file with a rule that takes all of the .o files and makes an executable.

The object files are stored in a directory under the directory where the make file is stored ie linuxdebug.

I am attempting to use cd ./linuxdebug in my rule.  Then I call g++ x.o manprg,  the compiler can not find x.o file.

if i do g++ ./linuxdebug/x.o manprg is works.  Is there a way to do this without specifying the direectory in the g++ command line?

Is there another approach to do this except using g++ ./linuxdebug/x.o to compile the object files into my executable?Start Free Trial
[+][-]03.06.2008 at 10:10AM PST, ID: 21063067

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Programming
Tags: c+, Linux
Sign Up Now!
Solution Provided By: ravenpl
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628