I have a directory structure with projects, and I need to make sure that when I copy new files, the directory structure has the correct permissions (basically, as if created with umask 022) and ownership:
root:users
755 for directories
644 for files
how can i automate this with a Makefile, so that when I run make
, the wrong permissions and ownership of files will be changed.
What target should i use inside my Makefile?
Or, will I need to change the permissions blindly on the whole directory structure, each time I run make? Can make have a target based on file ownership and permissions?