diff options
| -rwxr-xr-x[-rw-r--r--] | .gitignore | 1 | ||||
| -rw-r--r-- | CMakeLists.txt | 13 | ||||
| -rw-r--r-- | build.c | 16 | ||||
| -rw-r--r-- | src/main.c | 3 | ||||
| -rw-r--r-- | src/search.c | 4 |
5 files changed, 24 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore index 378eac2..7353e7e 100644..100755 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +*.o diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a74779b..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(Gacrux LANGUAGES C) - -set(SOURCES - src/main.c - src/bitboard.c - src/search/moves.c - src/search/pawn_moves.c - src/search/knight_moves.c - src/search/king_moves.c -) - -add_executable(gacrux ${SOURCES}) @@ -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; +} @@ -27,3 +27,6 @@ position.bitboards[BLACK_PAWN] = 71776119061217280ULL; } return 0; } + +#include "bitboard.c" +#include "search.c" diff --git a/src/search.c b/src/search.c new file mode 100644 index 0000000..9c7b6ff --- /dev/null +++ b/src/search.c @@ -0,0 +1,4 @@ +#include "search/moves.c" +#include "search/king_moves.c" +#include "search/knight_moves.c" +#include "search/pawn_moves.c" |
