summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2026-07-05 23:55:45 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2026-07-05 23:55:45 +0530
commit1876294f217d7faa2a07dbaaaab82d142ce42803 (patch)
treed67ba4b240f25042063c06ce99370e3be34457ff /build.c
parentf17df9538b1c3f58f12b738083b747ac332b8d71 (diff)
all in on uci
the old server.c & log.c is gonna be removed soon
Diffstat (limited to 'build.c')
-rw-r--r--build.c50
1 files changed, 5 insertions, 45 deletions
diff --git a/build.c b/build.c
index 8af54da..663d47c 100644
--- a/build.c
+++ b/build.c
@@ -31,8 +31,6 @@ void print_cmd(char** args) {
int clean_mode(int run_mode);
int test_mode(int run_mode);
-int server_mode(int run_mode);
-int engine_mode(int run_mode);
int uci_mode(int run_mode);
// https://github.com/tsoding/nob.h/blob/0a08926d8094fc4ae678155c5d73ae21d1f96f3f/nob.h#L2413
@@ -54,11 +52,7 @@ int needs_rebuild(char* bin_file, char* source_file) {
}
#define ENGINE_O "output/engine.o"
-#define SERVER_O "output/server.o"
#define UCI_O "output/uci.o"
-#define LOG_O "output/log.o"
-
-#define LOGGER_C "src/logger/logger.c"
int main(int argc, char** argv) {
if (needs_rebuild(argv[0], __FILE__)) {
@@ -82,16 +76,7 @@ int main(int argc, char** argv) {
if (strcmp(argv[1], "clean") == 0) {
return clean_mode(run_mode);
}
- if (strcmp(argv[1], "uci") == 0) {
- return uci_mode(run_mode);
- }
- RUN_CMD({CC, "src/log.c", "-o", LOG_O, NULL});
- if (strcmp(argv[1], "engine") == 0) {
- return engine_mode(run_mode);
- }
- if (strcmp(argv[1], "server") == 0) {
- return server_mode(run_mode);
- }
+ return uci_mode(run_mode);
}
int clean_mode(int _) {
@@ -108,36 +93,10 @@ int test_mode(int run_mode) {
execvp(args[0], args);
}
- RUN_CMD({CC, "generate/find_tests.c", LOGGER_C, "-o", "output/find_tests.o", NULL});
+ RUN_CMD({CC, "generate/find_tests.c", "-o", "output/find_tests.o", NULL});
RUN_CMD({"./output/find_tests.o", NULL});
printf("\n");
- RUN_CMD({CC, "tests/main.c", LOGGER_C, "-o", "output/test.o", NULL});
- return status != 0;
-}
-
-int server_mode(int run_mode) {
- if (run_mode) {
- RUN_CMD({"rm", "/dev/mqueue/logs", NULL});
- RUN_CMD({"rm", "/dev/mqueue/server_to_engine", "/dev/mqueue/engine_to_server", NULL});
- char* args[] = {LOG_O, SERVER_O, ENGINE_O, NULL};
- print_cmd(args);
- execvp(args[0], args);
- }
-
- RUN_CMD({CC, "src/server.c", LOGGER_C, "-lcrypto", "-o", SERVER_O, NULL});
- RUN_CMD({CC, "src/engine.c", LOGGER_C, "-o", ENGINE_O, NULL});
- return status != 0;
-}
-
-int engine_mode(int run_mode) {
- if (run_mode) {
- RUN_CMD({"rm", "/dev/mqueue/logs", NULL});
- char* args[] = {LOG_O, ENGINE_O, NULL};
- print_cmd(args);
- execvp(args[0], args);
- }
-
- RUN_CMD({CC, "src/engine.c", LOGGER_C, "-o", ENGINE_O, NULL});
+ RUN_CMD({CC, "tests/main.c", "-o", "output/test.o", NULL});
return status != 0;
}
@@ -148,6 +107,7 @@ int uci_mode(int run_mode) {
execvp(args[0], args);
}
- RUN_CMD({CC, "src/uci.c", "-o", UCI_O, NULL});
+ RUN_CMD({CC, "src/engine.c", "-o", ENGINE_O, NULL});
+ RUN_CMD({CC, "src/uci.c", "-o", UCI_O, ENGINE_O, NULL});
return status != 0;
}