how to make this run in parallel
void evaluate_parallel(Rule *r, Rule *rule) {
    int num_child = 0;

    if (r != NULL) {
        Dependency *dep = r->dependencies;

        if (dep == NULL) {
            execute_action(r->actions);
        }

        while (dep != NULL) {
            int n = fork();

            if (n == 0) {
                evaluate_parallel(dep->rule, rule);
                exit(0);
            } else {
                num_child += 1;

                struct stat t;

                if (stat(r->target, &t) != 0) {
                    execute_action(r->actions);
                } else {
                    int res = 2;
                    res = compare_time(r->target, dep->rule->target);
                    if (res == 0) {
                        execute_action(r->actions);
                    }
                }
            }
            dep = dep->next_dep;
        }
    }

    for (int i = 0; i < num_child; i++) {
        int status;
        wait(&status);
        if (!(WIFEXITED(status))) {
            perror("wait");
            exit(1);
        }
    }
}