LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-14-2012, 10:40 AM   #1
deritha
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Rep: Reputation: Disabled
questions about Makefile command


I'm using one make file from somebody else.

MAINS = ana
PACKAGE = $(shell basename `pwd`)
INSTALL_LIBS = no
INSTALL_BINS = yes

include $(E_CONFIG_DIR)/Makefile.bin

1. What's the meaning of "shell basename `pwd`"?

2. Does "include $(E_CONFIG_DIR)/Makefile.bin" mean execute the commands in Makefile.bin? Can I move this line to the beginning of the Makefile file?
 
Old 06-14-2012, 11:45 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,849

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you need to read the man page of the gnu make, you will find the answers:
the MACRO = $(shell <command>) means the <command> will be executed and the output of that command will be taken as the value of the macro. see here
in general a makefile does not execute commands but constructs an environment and builds the defined target (and its dependencies). Therefore the include "command" is used to include another file and process it as a part of the current make system. You can move it if you want, but the construction of that make/build environment based on the order of lines, so probably it won't work anywhere.





__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
1 members found this post helpful.
Old 06-14-2012, 12:36 PM   #3
deritha
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks a lot for your detail explanation.

Yes. It's very helpful if I can view the man page of gnu make.

I'm trying to read http://www.gnu.org/software/make/manual/make.html now.



Quote:
Originally Posted by pan64 View Post
you need to read the man page of the gnu make, you will find the answers:
the MACRO = $(shell <command>) means the <command> will be executed and the output of that command will be taken as the value of the macro. see here
in general a makefile does not execute commands but constructs an environment and builds the defined target (and its dependencies). Therefore the include "command" is used to include another file and process it as a part of the current make system. You can move it if you want, but the construction of that make/build environment based on the order of lines, so probably it won't work anywhere.





__________________________________
Happy with solution ... mark as SOLVED
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
 
  


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
Questions about generating makefile ans configure script. cshong Programming 1 05-17-2011 11:16 PM
Some questions on an autogenerated Makefile binarybob0001 Programming 2 04-27-2008 12:02 AM
Makefile:How to use cat command Ashok_mittal Linux - Newbie 1 01-18-2008 07:38 AM
Makefile questions kornerr Programming 2 08-17-2005 01:30 AM
makefile gcc command cannot be found Mogul83 Programming 7 05-31-2005 03:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:59 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