diff --git a/minimake/src/minimake.c b/minimake/src/minimake.c index c28aed3..468ce23 100644 --- a/minimake/src/minimake.c +++ b/minimake/src/minimake.c @@ -488,6 +488,8 @@ static int run_rule(struct rule *rule) dependencies->data); } } + + dependencies = dependencies->next; } while (commands != NULL) @@ -550,9 +552,15 @@ int make(char *path, struct list *rules, char *exec_name, int flags) make_parse(path); + // Print if (flags & FLAGS_PRINT) + { dump_database(); + free_all(); + return 0; + } + // Run int status = make_run(rules); free_all(); return status; @@ -590,7 +598,7 @@ void dump_database(void) // Print char *key = elt->data; - printf("%s = %s\n", key, val); + printf("'%s' = '%s'\n", key, val); elt = elt->next; } @@ -605,7 +613,7 @@ void dump_database(void) drop(GENERIC_ERR, "Could not get rule '%s' in database", elt->data); // Print name - printf("(%s) :", rule->name); + printf("(%s):", rule->name); // Print dependencies struct list *dep = rule->dependencies;