LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-18-2008, 04:02 PM   #1
sancho1980
Member
 
Registered: May 2006
Location: Leipzig, Germany
Distribution: Kanotix 64
Posts: 45

Rep: Reputation: 15
makefile subdirectory target


hi

i have the following problem

my working dir is /dir for example

i have a makefile in this directory, called "target" for example:

target: dep1 dep2

the problem is as follows:

there is a subdirectory in /dir called /dir/subdir (for example)

my target "target" in /dir depends on subtarget "subtarget" in /dir/subdir to be "made"

however, this "intuitive" approach does NOT work:

target: /dir/subdir/subtarget
command
command

can some one please help me?

thanks

martin
 
Old 08-18-2008, 05:25 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
does the thing in /dir/subdir have a makefile?

if so, without getting too fancy, this should work:

Code:
target: /dir/subdir/subtarget source_file
	g++ source_file -o $@

/dir/subdir/subtarget:
	make -C /dir/subdir
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using user input to create target using Makefile makaveli_0000 Linux - General 0 07-02-2007 03:01 PM
duplicated definition for a target in Makefile George2 Programming 2 05-07-2006 04:01 AM
strange target name containing % in Makefile George2 Programming 2 04-25-2006 06:28 AM
Trying to install kwvdial ,no target specified an no makefile found mtnhigh Linux - Software 0 09-27-2004 01:38 PM
No rule to make target `/mkspecs/default/qmake.conf', needed by `Makefile'. Stop Julianus Linux - General 0 12-21-2003 07:17 AM


All times are GMT -5. The time now is 10:11 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration