[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make CVS HEAD version build out of the box

From: grischka
Subject: Re: Make CVS HEAD version build out of the box
Date: Mon, 1 Oct 2007 20:37:56 +0200

> Well, obviously casting a const char* to a char* so you can modify it is
> not valid code.  There's a reason these values are const, and that
> reason is that they should not be modified.

Well, that is maybe arguable whether or not a cast is valid code in C.

However I wonder what problem the original hack is trying to solve 
at all. Or, what now is a practical case where a gmake with that 
hack works better than one without?

For example, the linux version of gmake considers 'dir' and 
'dir/' as well as './dir/' all the same, and removes any 
'decoration' automatically:

$ cat makefile
./dir/ : ; echo $@

$ gmake
echo dir

Now this basically makes sense, only it does not work with the 
windows version. For example:

$ type makefile
all : dir/
dir/ : ; mkdir $@

$ gmake
mkdir dir
$ gmake
mkdir dir/
Invalid option - /

I.e. there is some strange thing going on in that whether or not 
the slash is removed seems to depend on whether 'dir' exists. 
Whereas in the make logic gmake always thinks it does not exist.

With backslashes I have no idea in the first place how one is 
supposed to enter trailing backslashes at all. Basically you 
can have two backslashes or no backslash, just not a single 
backslash. This is independent of whether on linux or windows:

$ cat makefile
all : dir\\
dir\\ : ; mkdir $@

$ gmake
gmake: *** No rule to make target `dir\\', needed by `all'.  Stop.

The only way I found was using some macro function. Now in the 
best case I'd expect to see the backslash removed accordingly to 
what happens with forward slashes on linux. But, well, it doesn't 
really get that far:

DIR = $(addsuffix \,dir)
all : $(DIR)
$(DIR) : ; mkdir $@

$ gmake
gmake: *** No rule to make target `dir\', needed by `all'.  Stop.

Aside from all that, it turns out that with the native mkdir on 
windows none of 'mkdir dir\\', 'mkdir dir\' or 'mkdir dir/' would 
practically work. 

So, there is still the question: when is the backslash trick in 
find_directory supposed to help, actually?

-- grischka

reply via email to

[Prev in Thread] Current Thread [Next in Thread]