added incs to build rules

This commit is contained in:
Noah Swerhun 2023-12-13 10:30:58 -06:00
parent cd2c92d415
commit 63f12eac4d

View file

@ -109,7 +109,7 @@ impl BuildRule {
let obj_path = PathBuf::from("$(OBJDIR)").join(obj_name);
let obj_path = obj_path.to_str().unwrap();
let compile_command = format!("$(CC) $(CFLAGS) -o {} -c {}", obj_path, path);
let compile_command = format!("$(CC) $(CFLAGS) $(INCS) -o {} -c {}", obj_path, path);
BuildRule { target: String::from(obj_path), prerequisites, recipe_commands: vec![compile_command] }
}
@ -287,7 +287,7 @@ impl RuleList {
fn add_target_rule(&mut self) {
let mut objects = self.get_obj_targets();
let target_comm = String::from(
format!("$(CC) $(LDFLAGS) -o $(BUILDDIR)/$(TARGET) {} $(LDLIBS)", objects.join(" "))
format!("$(CC) $(LDFLAGS) $(INCS) -o $(BUILDDIR)/$(TARGET) {} $(LDLIBS)", objects.join(" "))
);
objects.push(String::from("| $(OBJDIR) $(BUILDDIR)"));