create header file dependencies in make file

Posted on 1998-11-10
Last Modified: 2010-04-15
How can I create header file dependencies in make file so that it will be portable in all platforms.
Question by:mahh
  • 3
  • 3
LVL 86

Accepted Solution

jkr earned 50 total points
ID: 1254151
For BSD makefiles, it's usually done like this:

# include a dependency file if one exists
ifeq (.depend,$(wildcard .depend))
include .depend

You'll of course have to use 'make depend' to get it working...

Author Comment

ID: 1254152
Please explain in detail about how to do that in unix platforms. It will be helpful if you can explain in AIX version.
LVL 86

Expert Comment

ID: 1254153
Well, i don't know AIX, but the above works on Linux, HP-UX, SCO _and_ NT...
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.


Author Comment

ID: 1254154
Your reply is actually good but I did not really understand the steps you have mentioned. Can you explain by giving examples. Also tell me whether any websites I can look to get a clear understanding.
Thanks for your valuable help.
LVL 86

Expert Comment

ID: 1254155
Well, the 'include .depend' directive simply instructs 'make' to evaluate a file called '.depend', that was previously created by running 'make depend' on the current target... I'll see if i can point you to some web sites.

Author Comment

ID: 1254156
Please help me to point to web sites and I still did not understand the answer you provided. I had given the points for not dissapointing you.


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Binary Bomb: Phase 4 func4 3 326
Why this code doesn't work? 8 99
Which checksum is this? 7 142
What is atomic operation? 6 58
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now