diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-05-22 17:45:49 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-05-22 17:45:49 +0530 |
| commit | 2da12c5862b8250d7c0e609609cb58f97012d619 (patch) | |
| tree | e496d77537a58377315f0e26d849955fc2157253 /build.c | |
| parent | 22c0d29724c2b054d8b9f9ed2373103d412f02b3 (diff) | |
a simpler build setup
Diffstat (limited to 'build.c')
| -rw-r--r-- | build.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -0,0 +1,16 @@ +#include <sys/wait.h> +#include <unistd.h> + +int main() { + if (fork() == 0) { + char* args[] = {"gcc", "src/main.c", "-o", "main.o", NULL}; + execvp(args[0], args); + return 0; + } else { + wait(NULL); + } + + char* args[] = {"./main.o", NULL}; + execvp(args[0], args); + return 0; +} |
