Alternative to Make?

Does there exist an alternative to GNU Make that can handle spaces in target names and file names?

In this day and age, it doesn't seem like there's any excuse for what is a rather important tool to lack support for symbols as commonplace as blank spaces.
Thanks for the prompt reply. I came across that earlier when I was looking for a solution; unfortunately, the general conclusion seems to be that there's no perfect solution as far as using GNU Make is concerned. The tricks he presented should function as a workaround while my makefiles are still basic, but I'll likely run into trouble when they become more complex. As such, I was hoping I could start familiarizing myself with a better tool now while I'm still learning.

I did see the suggestion to use bmake in the comments below it, but wasn't able to find a great deal about it. As a beginner, I'm hesitant to try utilities that aren't widely vetted and/or discussed since I don't yet feel I have the experience to evaluate them on my own.
Last edited on
The un-solution is to simply not use spaces in file names.

That is at least easier than learning new syntaxes for new utilities, which have only to do with bookkeeping, and nothing to do with your actual code.
I don't know anything about Make, but can't use put them in double or single quotes? or use the escape character on it e.g usr/home/bad\ human\ memory\ of\ linux\ file\ system/.conkyrc

bad\ human\ memory\ of\ linux\ file\ system is the name of a single directory
I can't for the life of me see why anyone would want to put spaces in their source code file names?

As CatFish2 says:

The un-solution is to simply not use spaces in file names.


This is about on par with the use of un-initialised variables, I think.

One more thing - are you using Linux / Unix ?(I have a vague idea that GNU make is also available for windows or MAC). A Linux / Unix person would never put spaces in ANY file name because they know what a complete pain it is (but not impossible) to deal with such things.
Zephilinox: For the reasons enumerated in the link catfish2 provided, escape characters are only a partial solution and don't work in all cases.

TheIdeasMan: While I've heard some argue the case that "it's not always possible to rename the files involved", I consider the use of spaces in file and directory names to be a matter of personal preference. In most cases, it would be simpler to just take out the spaces, but it shouldn't be necessary. Not only is it becoming more common to include spaces in these names, but there's no logical reason why the problem need exist at all; plenty of other tools have implemented ways to handle spaces, after all.
ah sorry, should have read it.
In this day and age, it doesn't seem like there's any excuse for what is a rather important tool to lack support for symbols as commonplace as blank spaces.


We bring it on ourselves. For so long in computing, a space indicated "end of this token, beginning of next token"1 and then we go and do something stupid like make it ambiguous so that sometimes it doesn't mean end of token, it means "same token, I just want to put a gap in the middle of the symbols."

You're right. Blank spaces are commonplace, but they're ambiguous and the machine isn't psychic.


1. As an aside, the space between words was introduced to Latin around 1500 years ago and is by no means universal in modern languages.
At risk the risk of sounding like a petulant smart-ass, I am hoping no one wants to put spaces in their variable names. :D :D

Apart from the oblique comedy, I am hoping some one might see this as being a similar argument.

@Moschops:

the machine isn't psychic
. Well that nails it in my opinion.

Excellent footnote. I love this sort of stuff.
hehehehe, fun fact indeed. While I knew that spaces weren't universal, I wasn't aware that they were introduced so recently, at least in Latin. Makes me wonder how they used to denote the separation between words before then, if they did at all.

Back on topic, though, I am aware that the machine isn't psychic and I'm not asking it to be; nor am I asking for an algorithm that analyzes the context in which the space was used and attempts to predict its intended role. I'd merely like something on par with what every other tool has- a way to explicitly mark how it should be interpreted. As has been brought up above, the standard method is to use escape characters or grouping with quotation marks; both methods work in a limited range of cases. They should work in all cases.

To that end, does anyone have any experience with bmake? It can allegedly handle spaces, but I'm also interested in knowing how it stacks up against GNU Make more generally.
Perhaps we could use one non-printing character to mean token-break, and a different non-printing character to mean same-token-I-just-want-a-visible-gap. There are a bunch of non-printing characters hanging around in the 1-byte character set; I'm sure there would be no unexpected consequences :P
Just kind of a speculative comment as I didn't really have much experience with GNU makefiles.

Maybe you can try using CMake to generate a GNU Make makefile. CMake is made to be cross platform, cross compiler, cross IDE etc., so I'm pretty sure that the "files with spaces" problem is worked around for GNU Make (I'm not sure - you will have to check it yourself). Plus, you will get all the cross* benefits should you ever want to compile your code in, say, visual studio :)
Last edited on
Zephilinox: For the reasons enumerated in the link catfish2 provided, escape characters are only a partial solution and don't work in all cases.


...clearly, using spaces in your filenames already doesn't work in all cases. I think you should reconsider that decision.
moorecm: The difference is that the use of spaces is a personal preference, which features should allow, as opposed to features that only incompletely allow the usage of said preference.

KRAkatau: Thanks for pointing out cmake to me. It led me on the search path to a great overview of build utilities.

http://www.scons.org/wiki/SconsVsOtherBuildTools

While it focuses on scons, it also works as a generalized list of build utilities, their features, and their pros and cons. While it doesn't explicitly address my problem, it doesn't sound like a lot of people share it or my interest in spaces. Regardless, hopefully someone will gain some use from the overview.
Topic archived. No new replies allowed.