Ensuring existance of directories before writing files into them

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ensuring existance of directories before writing files into them

SF Markus Elfring
Hello,

Files are stored within directories. So there is a general dependency
that the directory should exist (together with an identifier) before a file
can be changed.

Prerequisites for make rules can be specified in the way that their file names
reference a specific build directory. I have got a few approaches in mind
to convert such an implicit dependency to an explicit one for the make software.

* I could check if the source file folder is different from the selected
  build directory.

* If the desired build subdirectory did not exist, I could create it automatically.
  There is a choice if such a directory creation should be performed by a call
  of the make function “shell” or by a command in a recipe.
  Which design variant would you prefer for this use case?

Regards,
Markus

_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ensuring existance of directories before writing files into them

SF Markus Elfring
> Here's one way to solve the problem:
> http://www.chaos.org.uk/~eddy/craft/make.html#AutoDir

Thanks for your link for information around the topic “Autogenerating (needed) directories”.

Will it become better recognised as another design/construction pattern?

Regards,
Markus

_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Loading...