LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



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

Rep: Reputation: 0
Makefiles


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'

install:
@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 \
mknod $(DEVICE)$(MINOR_NUM) c $(MAJOR_NUM) $(MINOR_NUM); \
chmod 664 $(DEVICE)$(MINOR_NUM); \
fi; \
MINOR_NUM=$( ($MINOR_NUM+16) ); \
@echo $(MINOR_NUM); \
done

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, 06:16 AM   #2
vladmihaisima
Member
 
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, 06:26 AM   #3
jtshaw
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 04:26 AM
Those makefiles... boku Programming 10 03-01-2005 09:19 AM
Makefiles and Me dpottinger Linux - Newbie 5 07-25-2004 12:14 AM
MAKEFILEs shinpadsmt Linux - Newbie 3 02-21-2004 03:52 AM
Why makefiles parthi4u Programming 4 03-08-2003 04:14 PM


All times are GMT -5. The time now is 09:01 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration