    // Read line from fp.
    fgets(line, MAXLINE, fp);

    // Skip comment and empty lines.
    while (is_comment_or_empty(line) == 1) {
        // Return NULL pointer if end of file is reached.
        if (fgets(line, MAXLINE, fp) == NULL) {
            return NULL;
        }
    }

    // Read in the rule's target name.
    int len_target = 0;
    while (line[len_target] != ' ') {
        buffer[len_target] = line[len_target];
        len_target += 1;
    }
    buffer[len_target] = '\0';

    // Determine whether a rule with target name already exists in the list.
    Rule *rule = find_rule(first_rule, buffer);
    if (rule == NULL) {
        rule = malloc(sizeof(Rule));
        rule->dependencies = NULL;
        rule->actions = NULL;
        rule->next_rule = NULL;
    }

    // Set rule's target attribute to the read target.
    rule->target = malloc(sizeof(char) * (strlen(buffer) + 1));
    strcpy(rule->target, buffer);
Define the target attribute of a rule object to be the first word in a line.