Created
November 18, 2022 21:49
-
-
Save petabyt/174e5432dd0ef7f4cd122857a68170fb to your computer and use it in GitHub Desktop.
next generation build system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <build.h> | |
int my_clean() { | |
return build_shell(build_rm, "-rf", "*.o"); | |
} | |
int my_out(char *in, char *out) { | |
return build_shell(build_cc, in, "-o", out); | |
} | |
int build() { | |
build_add_phony("clean", my_clean); | |
Target t = build_target("example.o"); | |
t.add_dep("main.o"); | |
Rule r = build_rule("*.o", "*.c", my_out); | |
build_set_default("example.o"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment