os_xtask_utils/
make.rs

1use super::{ext, CommandExt};
2use std::process::Command;
3
4ext!(def; Make);
5
6impl Make {
7    #[inline]
8    pub fn new() -> Self {
9        Self(Command::new("make"))
10    }
11
12    #[inline]
13    pub fn install() -> Self {
14        let mut make = Self::new();
15        make.arg("install");
16        make
17    }
18
19    #[inline]
20    pub fn j(&mut self, j: usize) -> &mut Self {
21        match j {
22            usize::MAX => self.arg("-j"),
23            j => self.arg(format!("-j{j}")),
24        }
25    }
26}
27
28impl Default for Make {
29    #[inline]
30    fn default() -> Self {
31        Self::new()
32    }
33}