makefile - Is there an elegant way to control permissions for directories created by "install -D"? -


i using [/usr/bin/]install in makefile copy binaries $home directory. umask set 700.

the problem using install -d -m 700 install binaries , parent directory created permissions of 755 , not 700:

$ umask 077 $ ls $ touch hello $ ls -l total 0 -rw------- 1 emuso emuso 0 apr  5 13:15 hello $ install -d -m 700 hello $pwd/this/is/hello $ ls -ld drwxr-xr-x 3 emuso emuso 4096 apr  5 13:17 $ ls -lr  this: total 4 drwxr-xr-x 2 emuso emuso 4096 apr  5 13:17  this/is: total 0 -rwx------ 1 emuso emuso 0 apr  5 13:17 hello 

i want directories this , is permissions 700 instead of 755.

solutions come mind are:

  1. using install -d -m 700 create directory structure hand.
  2. using chmod fix permissions manually.

the major drawback first solution have directory structure, have travel , create hand.

so question is: there elegant way control permissions directories created "install -d"?

what want achieve not seem possible single invocation install only, might have resort combination of mkdir , install. depending on exact situation, might able take advantage of canned recipe, using this:

define einstall test -d "$(dir $@)" || mkdir -p "$(dir $@)" install -m 700 $< $@ endef  some/new/test/hello: hello     $(einstall) 

if plan play around canned recipes make v3.81 or older, please make sure read answer why gnu make canned recipe doesn't work?


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -