LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2012, 05:11 AM   #1
k_element
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Question how to include a file after updating in makefile


makefile:
all: a.d a #a.d knows how to make a

.PHONY:a.d
a.d:
./build a.d #build is a programme to make a.d

-include a.d

a.d will be included before a.d is updated, what should I do if a want to update a.d first.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-17-2012, 07:04 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
that will hardly work, because include is evaluated before processing any target.
you would need two makefiles: the first will build a.d and start the second, and the second will include the generated file.
 
2 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to include my helloworld.c into makefile? dennisdd Linux - Newbie 7 10-19-2011 04:39 AM
[SOLVED] How to add include path to kernel module Makefile oblix Linux - Software 2 09-17-2009 08:35 PM
[SOLVED] How to add include path to kernel module Makefile oblix Linux - Kernel 2 09-16-2009 10:09 AM
Makefile include statement problem wampire Programming 1 05-21-2008 11:32 PM
Unable to include headers in Makefile Raphexion Programming 2 11-05-2005 09:00 AM


All times are GMT -5. The time now is 08:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration