Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 11-28-2007, 08:19 AM   #1
LQ Newbie
Registered: Nov 2007
Posts: 21

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


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


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,
Old 11-28-2007, 09:16 AM   #2
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

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


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

All times are GMT -5. The time now is 04:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration