LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-28-2007, 07:19 AM   #1
sun_sun
LQ Newbie
 
Registered: Nov 2007
Posts: 21

Rep: Reputation: 15
define multiple variable through loop in makefiles


hi,

i want to define multiple varibles in a Makefile in a loop..something like :
i have :

FILES = a.pl b.pl

i want to define a varible having the value as mentioned :
test_a = a
test_b = b

i want to do this assignment in Makefile through a loop.

i tried :
$(foreach f, $(FILES), test_$(basename $(f))= $(basename $(f)))

but this doesn't work..when i see the value of test_a ---it shows null..

can anybody help me in doing this ?

thanks in advance,
sun_sun
 
Old 11-28-2007, 08:16 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
you can't do it.
 
  


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 define a variable In a while loop? fatsheep Programming 16 07-30-2014 01:12 PM
Define global variable maxmil Linux - Newbie 4 03-07-2006 10:36 AM
What is CFLAGS variable used in Makefiles for? Nerox Programming 3 12-28-2004 05:03 PM
how am i define an environment variable? yenonn Slackware 2 12-19-2003 07:44 AM
how to define a global variable Anniebaby Programming 1 11-09-2003 10:43 PM

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

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