LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-21-2010, 10:04 AM   #1
AshishJogeshwar
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Rep: Reputation: 0
Using a variable in makefile which takes values from an external file.


Hello

I am currently having a Makefile which takes a list of packages and stores it in a variable
Code:
packages=\
package1 \
package2 \
package3 \
I want to populate this variable by reading from an external file, say in this case package.log which has a list of variables and looks like this.
Code:
package1
package2
package3
Is it possible to have such an arrangement?
If yes, please refer any document or link for this.

Regards,
Ashish
 
Old 06-21-2010, 02:54 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
8.11 The shell Function:
Quote:
Code:
    contents := $(shell cat foo)
sets contents to the contents of the file foo, with a space (rather than a newline) separating each line.
 
  


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
Not able to invoke variable values vjayraghavan Programming 1 05-05-2010 02:22 AM
Imp for me: How to pass a variable from .tcl file to Makefile sun_sun Programming 6 11-27-2007 05:26 AM
Values like VARIABLE[i] ? BlueSpirit Programming 5 04-27-2007 01:35 PM
How to share variable values between shell and awk? realos Programming 1 12-16-2006 10:15 PM
bash - comparing a variable to several values davee Programming 3 05-05-2003 07:26 AM

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

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
Open Source Consulting | Domain Registration