0

I have discovered something odd with the mkdir command when it is being used in a Makefile and it behaving differently between OSX and Ubuntu 20.04.

Just wondering if this is expected behaviour, or have I discovered a bug?

The suspect command is:

mkdir -p -m 0755 ./output/themes/simple/{css,javascript,webfonts,image}

This command works perfectly at the bash/zsh command line, creating the directories:

output/themes/simple/css output/themes/simple/javascript etc.

On a OSX machine using the zsh shell. When running the above command in a Makefile it works as expected creating the separate subdirectories.

However, using the same Makefile on a Ubuntu 20.04 desktop (the file is on a server and both machines can see it) the command is creating the following:

output/themes/simple/{css,javascript,webfonts,images}

It is as if the command is seeing the last component of the directory path as a string and not enumerating it as it does on the command line.

Make on Linux is:

GNU Make 4.2.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Make on OSX is:

GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin11.3.0

I do not think it is difference between shells, mkdir is not a builtin on the bash Ubuntu provides.

Work around is to separate the mkdirs into separate commands, but I was quite surprised that the make/mkdir did not work correctly on the Linux box.

Any thoughts?

Cheers Jim

0 Answers0