Reputation: 477210
I'm wondering if it is possible to specify a "Lazy Makefile
" in Linux that would furthermore even be "transparent".
Scenario:
The makefile
specifies how several objects should be build:
foo : bar baz
command baz -o foo < bar
image.jpg :
wget http://somesite.com/image.jpg
Without the files actually being present in the directory, the filesystem "shows" them as if they are "made". Programs can "read" these files and when they do, the mechanism starts building them...
In other words, if one runs
display image.jpg
The environment first checks if the image.jpg
already exists, if not it is fetched from the webserver and then represented to the user. The user has the impression the files were already there: they show up in the file system, they have properties, can be fed to a command (with <
). But they are generated if needed and are always "up-to-date".
Upvotes: 1
Views: 99
Reputation: 249434
You could implement this using FUSE (Filesystem in User Space): http://fuse.sourceforge.net/
The idea is simple enough: a sort of "overlay" filesystem where whenever a file is requested, the build system is asked to build it first.
Upvotes: 3