Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2nd March 2010, 02:10 AM
daviddoria Offline
Registered User
 
Join Date: Oct 2007
Posts: 884
linuxsafari
Making a make variable persist to subdirectory make files

If I have this structure
Code:
DirectoryA/DirectoryB
and both DirectoryA and DirectoryB have a Makefile. The DirectoryA Makefile 'depend' target simply calls the makedepend command from DirectoryB.
Code:
makedepend -o$(OBJ) -- $(INCFLAGS) $(MAKEDEPEND_INCFLAGS) $(DEFINEFLAGS) -- $(ALL_FILES)
If I set MAKEDEPEND_INCFLAGS in the DirectoryB Makefile, everything works. However, if I set MAKEDEPEND_INCFLAGS in the DirectoryA Makefile (the idea being that then I don't also have to put it in DirectoryC, D, etc (which all behave just like DirectoryB)), it doesn't work, it's as if the variable is not set.

(by "set", i mean put
Code:
MAKEDEPEND_INCFLAGS = -I/usr/include/ -I/usr/include/linux -I/usr/include/c++/4.4.1 -I/usr/include/c++/4.4.1/i586-redhat-linux/ -I/usr/include/c++/4.4.1/backward -I/usr/include/c++/3.4.6/backward/
)

Is there a way to make the value of the variable persist even when it goes into the next level Makefile?

Thanks,
Dave

---------- Post added at 09:10 PM CST ---------- Previous post was at 08:44 PM CST ----------

I found out that you can "export" the variable (just like you would from .bashrc) and then the next level of make will find it.
Reply With Quote
Reply

Tags
files, make, making, persist, subdirectory, variable

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making interface persist across reboot paulj_j Servers & Networking 7 22nd April 2009 03:02 PM
gnu make to replace variable values inside source code gold Using Fedora 1 7th January 2008 02:17 AM
make: *** No rule to make target `Rules.make'. Stop. idk666 Using Fedora 21 6th March 2007 11:08 PM
How to make a enviromental variable in FC3? davismiles Using Fedora 2 9th June 2005 08:04 PM


Current GMT-time: 19:25 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat