typedef struct dep_node {
    struct rule_node *rule;
    struct dep_node *next_dep;
} Dependency;

void create_dep(char *line, Rule *rule) {
    Dependency *front = NULL;
    Dependency *curr_dep;
    Dependency *last_dep;

    strtok(line, " \n");  // returns the target name
    strtok(NULL, " \n");  // returns the colon

    char *curr_tok = strtok(NULL, " \n");  // returns the first dependency name OR NULL if none

    if (curr_tok != NULL) {
        front->rule = initialize_rule(curr_tok);
        last_dep = front;
        front->next_dep = NULL;
    }

    curr_tok = strtok(NULL, " \n");

    while (curr_tok != NULL) {  // loop through all the dependencies.

        curr_dep = malloc(sizeof(Dependency));

        // initialize the new dependency values
        curr_dep->next_dep = NULL;
        curr_dep->rule = initialize_rule(curr_tok);

        // set the last dependencies next_dep to be the newly created one and move last dependency over
        last_dep->next_dep = curr_dep;
        last_dep = curr_dep;

        // move to next token
        curr_tok = strtok(NULL, " \n");
    }

    rule->dependencies = front;
}