LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 04: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, 06:04 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
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



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 03:39 AM
[SOLVED] How to add include path to kernel module Makefile oblix Linux - Software 2 09-17-2009 07:35 PM
[SOLVED] How to add include path to kernel module Makefile oblix Linux - Kernel 2 09-16-2009 09:09 AM
Makefile include statement problem wampire Programming 1 05-21-2008 10:32 PM
Unable to include headers in Makefile Raphexion Programming 2 11-05-2005 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 AM.

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