2

I have a makefile which installs a lot of files in my target build directory. Some of these are executable, some are not.

I tested the install command with flags -D -m 644 for non-executable files earlier with Linux, but now it broke. I have discovered that -D flag is not available with OSX/BSD, and have removed it. The thing is, I need to make sure that the component directories in the paths of files I am installing are created as necessary. I thought the -d flag will help and tried things along the lines of:

install .DS_Store ./tmp/build/some_dir/

...but it complains that some_dir is "no such file or directory", i.e. it does not exist (which is true). I then tried the same as above but with the -d flag, and got another error:

install: .DS_Store exists but is not a directory

I just want a more or less stable and generic way to copy files to destination. Maybe I should resort to cp? I know the minor but important differences between the two, though.

1 Answer 1

2

install -d interprets all of its arguments as directories that (might) need to be created. Thus, I think you need to do it as two commands:

install -d ./tmp/build/some_dir/
install .DS_Store ./tmp/build/some_dir/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .