Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old November 9th, 2007, 11:14 PM
Matt1776's Avatar
Matt1776 Matt1776 is online now
Recovering Intellectual
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2006
Location: Orange County, CA
Posts: 872 Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level)Matt1776 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 19 h 45 m 51 sec
Reputation Power: 329
Send a message via ICQ to Matt1776 Send a message via AIM to Matt1776 Send a message via MSN to Matt1776 Send a message via Yahoo to Matt1776 Send a message via Skype to Matt1776
Other Language - GNU Make

If someone is familiar with GNU Make I could use some advice. Trying to develop our build process to include a great deal more automation is proving to be a challenge, but one area where we could use more of our potential is in the area of our Makefiles.

Unbeknownst to me, GNU Make gives you the ability to access string manipulation functions as part of their standard library. Trying to make them work however isnt so easy. In the following code, I call the $(basename 'filename') function, which takes a filename and returns, in place (much like variable substitution) the result of the filename without any extensions. That would be everything up to the last period in the filename.

This function works fine if its provided a string in this form: "string". However, in my example, where I am using an iterator as the filename, I get no luck. Whats returned from the function is the full filename itself, not the basename. Could anyone shed some light on this or perhaps a workaround?

The code:
Code:
BIN=$(HOME)/bin

clean clobber all:
        for i in *.c; do       \
          gcc $$i ;            \
          mv a.out $(BIN)/$(basename $$i) ; \
        done
__________________
Bugs that go away by themselves come back by themselves
Never take life seriously, Nobody gets out alive anyway.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Other Language - GNU Make


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway