-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnob.c
More file actions
32 lines (22 loc) · 646 Bytes
/
Copy pathnob.c
File metadata and controls
32 lines (22 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// cc -o nob nob.c && ./nob
#include <stdio.h>
#define NOB_IMPLEMENTATION
#include "vendor/nob.h"
#define BUILD_FOLDER "build/"
int main(int argc, char **argv) {
NOB_GO_REBUILD_URSELF(argc, argv);
if (!nob_mkdir_if_not_exists(BUILD_FOLDER))
return 1;
Nob_Cmd cmd = {0};
nob_cc(&cmd);
nob_cc_flags(&cmd);
nob_cc_output(&cmd, BUILD_FOLDER "example");
nob_cc_inputs(&cmd, "example.c");
if (!nob_cmd_run(&cmd))
return 1;
nob_cmd_append(&cmd, "./build/example");
nob__cmd_append(&cmd, argc - 1, (const char **)(argv + 1));
if (!nob_cmd_run(&cmd))
return 1;
return 0;
}