LinuxQuestions.org
Review your favorite Linux distribution.
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 08-28-2007, 08:22 AM   #1
teuf
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Rep: Reputation: 0
Question makefiles with spaces in path


need help about building make file that has spaces in path name

like Documents and setings, my folder........

problem arise in comands like

make -c ../linux ................M='current position'
and it makes makefile error536 no such file or directory cause it splits path in two parts
before space in name and after the space.
something like
entering directory 'c:/documents' no such.....
entering directory 'setings/something/somenthig...' no such .........

problem is that -c calls $$(pwd) somewhere and than aply it to M to find ../linux
so how to make that path looks okay
i can put " " on other $$(pwd) in other make files and that works okay but what to do whith this make -C????
any ideas how to solve this?
please don't answer like don't put spaces in names of folders. it supposed to work in situations like that!
 
Old 08-28-2007, 11:34 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Don't put spaces...

Just kidding.

You may need to do something like quote and escape.

e.g. "\""space file"\""

The first set of quotes is to quote the backslash - the backslace is to escape the quote - you repeate it for each quote you need for 'space file'. I once had to do something bizarre like that to get an rsync I was doing to work. You may not need all of above - the double quote may work where you r single quote didn't.

This happens because some things treat the " as a literal whereas others treat is a quoting and same for backslash. On running it strips out everything so you get a literal "space file" passed in rather than space and file.
 
Old 08-28-2007, 11:44 AM   #3
teuf
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Original Poster
Rep: Reputation: 0
problem is also that most of commands in makefile are like

install_lib= some options "$(pwd)/build";

is there a way to change a ' ' to '\ ' after pwd

i found something for strings like:

${$(DIR)// /\ } it should replace ' ' with '\ ' but for some reason
it replaces entire adress with " " and thats not what i want

thanks
 
Old 08-29-2007, 04:06 AM   #4
teuf
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Original Poster
Rep: Reputation: 0
thanks all on your help but i have decided not to go on with this
cause it is normal thing on linux not to make spaces in paths, folder names,
i will maybe later try make that this aplication works and on paths with spaces but not now at the momment cause of deadline for project.


thank again to all of you on your help
 
Old 08-29-2007, 04:45 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,312

Rep: Reputation: 175Reputation: 175
I have tried extensively in the past.
I tried all sorts of quoting and escaping.

I'm not sure if make can really handle it at all, I gave up too.
 
Old 08-29-2007, 09:29 AM   #6
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Sort of glad to hear it. Two things that rather annoy me about Oracle:
1) They actually create directories named "core".
2) They make many files with spaces in the name.

Number 1 caused issues because many people used to run cron jobs to automatically delete core files (memory dumps of failed programs).

Number 2 makes us have to do special quoting and escaping in scripts that really ought not to be necessary like the rsync example I mentioned above.

Funny - I was downloading pictures from my sister's Sony digital camera to my Windoze laptop and she asked why I named the directory with underscores between the words. I explained that God didn't intend for files to have spaces in their names.
 
Old 08-29-2007, 01:41 PM   #7
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I think I misunderstand what the problem is. Do you mean make -C capital? As in make -C C:/"Documents and Settings"/yourname? That works fine for me. Are you talking about calling make -C for subdirs with spaces in their names? Can you post a short makefile and the command line you use to call it? I'm glad you decided on the non-space method, but I'm still curious about the problem.
ta0kira
 
Old 08-30-2007, 04:04 AM   #8
teuf
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Original Poster
Rep: Reputation: 0
@ta0kira: yes

but it is like this

Code:
$(MAKE) -C ../../linux-2.6.10 M='$$(pwd)' V=1
but nevermind it's not important any more
 
  


Reply


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
tsmbfs simple path name with spaces spooge Linux - Networking 4 08-31-2006 01:32 AM
Problem - Samba path in fstab has spaces for my WindowsXP machine ylikone Linux - Networking 2 08-01-2006 10:02 AM
how to expand wildcards in a path with spaces? sts Linux - General 1 11-12-2005 02:50 PM
using rsync - one of the folders in path has spaces??? jgruss Linux - Networking 10 07-07-2004 08:27 PM


All times are GMT -5. The time now is 10:31 PM.

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