Dependency
Process Execution
Minimake is a simplified but fully functional version of the iconic UNIX tool GNU Make.
The objective was to interpret a Makefile, construct a dependency graph, and execute the necessary commands to build a target.
Grade achieved: 90% (Excellent handling of recursion and parsing logic).
The heart of Minimake lies in its ability to determine what needs to be rebuilt and when. This involved:
stat) to compare modification times between targets and dependencies, ensuring optimal builds (only rebuilding outdated files).
| Feature | Implementation Detail |
|---|---|
| Variables | Support for variable expansion ($(VAR)) and environment variables lookup. |
| Rules & Recipes | Execution of shell commands using fork and exec, handling return codes to stop execution on error. |
| Advanced Rules | Support for Phony targets (.PHONY) and Pattern rules (e.g., %.o: %.c) using wildcard matching. |
| Logic | Handling "Up to date" and "Nothing to be done" states correctly to avoid redundant compilations. |
Scoring 90% on this project validated my understanding of graph theory applied to system programming. Minimake is now capable of building its own project, a "self-hosting" capability that demonstrates its robustness.