Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails if $(CURDIR) contains spaces #5

Open
ilg-ul opened this issue Jul 2, 2011 · 8 comments
Open

Build fails if $(CURDIR) contains spaces #5

ilg-ul opened this issue Jul 2, 2011 · 8 comments

Comments

@ilg-ul
Copy link

ilg-ul commented Jul 2, 2011

I moved the entire build environment to a new folder named "No Backup" (ignored by Time Machine) and then I tried again to run the build.

It failed, and it left another folder called "No", so I guess the SUPP_PREFIX needs some quotes to protect the space.

Liviu

@jsnyder
Copy link
Owner

jsnyder commented Jul 4, 2011

Hmm.. my first attempt at fixing this in baf8064 does not seem to have fixed the problem. It appears that automake at least doesn't escape some things when it runs commands later on. i.e.:

make install-data-hook
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/config.guess
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/config.guess: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/config.sub
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/config.sub: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/install-sh
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/install-sh: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/mdate-sh
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/mdate-sh: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/missing
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/missing: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/mkinstalldirs
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/mkinstalldirs: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/elisp-comp
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/elisp-comp: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/ylwrap
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/ylwrap: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/acinstall
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/acinstall: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/depcomp
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/depcomp: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/compile
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/compile: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/py-compile
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/py-compile: No such file or directory
chmod +x /Users/jsnyder/Sources/avr32 toolchain/supp/share/automake-1.11/symlink-tree
chmod: /Users/jsnyder/Sources/avr32: No such file or directory
chmod: toolchain/supp/share/automake-1.11/symlink-tree: No such file or directory

(renamed the directory to "avr32 toolchain").

I think based on trying double quoting etc, I might just need to escape the spaces myself. It seems like there's a bug in automake's build system that causes it not to escape properly.

@kblomqvist
Copy link
Contributor

Spaces in directory paths can be escaped. In Makefile this is a bit magic. First you have to get space into a string

space:=
space+=

Now this can be used in $(subst)

$(subst $(space),\$(space),$(SUPP_PREFIX))

Edit: Seems like this will work too

$(subst $(space),\ ,$(SUPP_PREFIX))

@ilg-ul
Copy link
Author

ilg-ul commented Sep 13, 2019

you completely lost me... :-(

@Skyskipper11
Copy link

@ilg-ul
sorry my bad. I was using CURDIR in Makefile and the same issue appeared, i am using
top :=(CURDIR)
null :=
space :=$(null) $(null)
$(subst $(space),\$(space),$(top)) to remove the spaces, but it doesn't work.
I think it is due to CURDIR which doesn't stores the last space in the path.

@ilg-ul
Copy link
Author

ilg-ul commented Sep 13, 2019

the initial issue is more than 8 years old, I completely forgot what this is all about (no longer using AVRs), but I hope the author still remembers details and hopefully can assist you.

@Skyskipper11
Copy link

@ilg-ul thanks :)

@JustRedTTG
Copy link

You can try the following as I did. Replace spaces with backslash spaces

space := $(subst ,, )
CURDIR := $(subst $(space),\$(space),$(CURDIR))

@JustRedTTG
Copy link

Or add a warning to not have spaces:

ifneq (1,$(words $(CURDIR)))
$(error Containing path cannot contain whitespace: '$(CURDIR)')
endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants