Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Closed Thread
  Search this Thread
Old 05-02-2005, 03:48 AM   #1
LQ Newbie
Registered: Mar 2005
Location: Pune India
Distribution: FC3, RH9
Posts: 12

Rep: Reputation: 0

Hi all I am trying to write a Makefile to compile my driver code and install the devices also my scriot is as follows.....
'contents of Makefile'

@echo "********* Installing the $(TARGET) Module *********"
for MINOR_NUM in 0 16 32 48 64 80 ; do \
if [ -e $(DEVICE)$(MINOR_NUM) ]; then \
echo "Device $(DEVICE)$(MINOR_NUM) already exists"; \
else \
chmod 664 $(DEVICE)$(MINOR_NUM); \
fi; \
MINOR_NUM=$( ($MINOR_NUM+16) ); \
@echo $(MINOR_NUM); \

But in this script value of MINOR_NUM always remains 0 and I want it to cahnge each time it gose to the starting of the loop....
Is it the correct way to do this If not then how I can do that..??
plz help me out
Old 05-02-2005, 05:16 AM   #2
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
The problem is that make also uses variables so $(MINOR_NUM) is interpreted by "make" . (try do define before the target "MINOR_NUM=test" and see the effect).

The solution is to write $$ instead of $ everywhere you don't want make to interpret the thing as a make variable.

Hope it helps.
Old 05-02-2005, 05:26 AM   #3
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
This thread is more applicable in the other place you put it, so I am closing this one down. Please to not double post in the future.

Continue following this topic here.

Closed Thread

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
makefiles wmoti Programming 5 09-21-2005 03:26 AM
Those makefiles... boku Programming 10 03-01-2005 08:19 AM
Makefiles and Me dpottinger Linux - Newbie 5 07-24-2004 11:14 PM
MAKEFILEs shinpadsmt Linux - Newbie 3 02-21-2004 02:52 AM
Why makefiles parthi4u Programming 4 03-08-2003 03:14 PM

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