summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2026-07-06 23:39:55 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2026-07-06 23:39:55 +0530
commit3c540db464f4034d0a393b076c79a26851f68f47 (patch)
treee9e94fb838b05818948f4f4596f0db6acba4402c /build.c
parent1876294f217d7faa2a07dbaaaab82d142ce42803 (diff)
removed unnescessary stuff + ipc with shared memory + somehow the build is faster?
Diffstat (limited to 'build.c')
-rw-r--r--build.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/build.c b/build.c
index 663d47c..5d64333 100644
--- a/build.c
+++ b/build.c
@@ -7,6 +7,10 @@
#include <string.h>
#define CC "gcc", "-O3"
+#define ENGINE_O "output/engine.o"
+#define UCI_O "output/uci.o"
+#define MAIN_O "output/main.o"
+#define IPC_O "output/ipc.o"
int status;
@@ -51,9 +55,6 @@ int needs_rebuild(char* bin_file, char* source_file) {
return input_path_time > output_path_time;
}
-#define ENGINE_O "output/engine.o"
-#define UCI_O "output/uci.o"
-
int main(int argc, char** argv) {
if (needs_rebuild(argv[0], __FILE__)) {
RUN_CMD({CC, __FILE__, "-o", argv[0], NULL});
@@ -102,12 +103,14 @@ int test_mode(int run_mode) {
int uci_mode(int run_mode) {
if (run_mode) {
- char* args[] = {UCI_O, NULL};
+ char* args[] = {MAIN_O, NULL};
print_cmd(args);
execvp(args[0], args);
}
- RUN_CMD({CC, "src/engine.c", "-o", ENGINE_O, NULL});
- RUN_CMD({CC, "src/uci.c", "-o", UCI_O, ENGINE_O, NULL});
+ RUN_CMD({CC, "-c", "src/ipc.c", "-o", IPC_O, NULL});
+ RUN_CMD({CC, "-c", "src/engine.c", "-o", ENGINE_O, NULL});
+ RUN_CMD({CC, "-c", "src/uci.c", "-o", UCI_O, NULL});
+ RUN_CMD({CC, UCI_O, ENGINE_O, IPC_O, "-o", MAIN_O, NULL});
return status != 0;
}