BUILD_TOOLCHAIN_DIR := C:/Android/Sdk/ndk/21.4.7075529
BUILD_NDK_DIR := $(BUILD_TOOLCHAIN_DIR)/toolchains/llvm/prebuilt/windows-x86_64/bin
BUILD_C_COMPILER := $(BUILD_NDK_DIR)/clang.exe
BUILD_CXX_COMPILER := $(BUILD_NDK_DIR)/clang++.exe


all: generate

generate:
	cmake -GNinja -S. -Bcmake-build-debug -DCMAKE_TOOLCHAIN_FILE="C:\Android\Sdk\ndk\21.4.7075529\build\cmake\android.toolchain.cmake" -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-16 -DANDROID_NDK=$(BUILD_TOOLCHAIN_DIR) -DCMAKE_C_COMPLIER=$(BUILD_C_COMPILER) -DCMAKE_CXX_COMPLIER=$(BUILD_CXX_COMPILER) -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
	cp ./cmake-build-debug/compile_commands.json .


build: generate
	ninja -C cmake-build-debug

deps:
	ninja -C cmake-build-debug -t deps > deps.txt
