if im writing a make system, can i:

-code a while loop to iterate through the dependencies and recursively call the program on them
-after the while loop is finished, check if target exists. if not, execute the rule's' actions
-if it does exist, create a struct using stat to hold the modification time of the target rule. loop through its dependencies and check for their modification times. if the modification time of the dependencies are more recent than the target, execute the action