4 ms·
One thing that one usually does with make is that one also figures out on what header file helloworld.c depends during the make run. Is the above code fragment
by cjfd 6y ago
One thing that one usually does with make is that one also figures out on what header file helloworld.c depends during the make run. Is the above code fragment hand coded or generated? I also am wondering if this also works if one only wants to build part of the project. make can take a list of files to rebuild as arguments. This also provides the ability to only create some set on intermediate files.
- jnxx 6y agoYou could read here: https://redo.readthedocs.io/en/latest/#whats-so-special-about-redo https://redo.readthedocs.io/en/latest/#whats-so-special-abou... (I think this explanation is much better than what I can do) And yes, it can build specific intermediate files or targets.
- jnxx 6y ago> Is the above code fragment hand coded or generated? It is a handwritten example, there is no code generation involved. However, standard rules can be defined by patterns for specific file extensions. Basically how redo works is that it runs the builds scripts to generate a target for the first time (these are shell scripts ending with *.do), and along the way it records every dependency for each target in an sqlite database, using a very small number of shell commands to define them in a declarative way. To re-built, it then uses this database of dependencies. Because it knows all the dependencies, and because the build product is always $3 and then mv'd to the target, it can build everything in parallel by default.