开发者

Problem creating source dependency with file paths including whitespace using find and gcc

开发者 https://www.devze.com 2023-02-03 19:59 出处:网络
I\'m building an embedded software using gnu-make. Sources including their paths are collected using find. The build process fails since some paths/filenames contain whitespace.

I'm building an embedded software using gnu-make. Sources including their paths are collected using find. The build process fails since some paths/filenames contain whitespace.

Such list look like: source=\ ../../开发者_高级运维Source/demo space/hello.c \ ../../Source/demo space/modul1.c

Is there any clue, enabling make to handle such paths? -replacing spaces with some kind of wildcard?


Make can not abide spaces in pathnames. There is no direct way around this. On Windows you might be able to use short names (c:/PROGRA~1 rather than c:/Progam Files, etc.). Otherwise judicious use of symbolic links might help out (this technique does work in Cygwin).

I've seen users (mainly windows users) tear their hair out at this "restriction." If you work on the command-line though, you will quickly find pathnames-with-whitespace more than slightly annoying. [FWIW μSoft seem to have removed the whitespace from all system paths in Windows Vista.]

0

精彩评论

暂无评论...
验证码 换一张
取 消