export CGO_ENABLED := "1"

# Builds the C ABI dependency, then the Go package.
build:
    cd ../c && cargo build --release
    go build ./...

# Vets the package.
vet:
    go vet ./...

# Builds and runs the spinning cube, with the C dll beside the exe.
example: build
    mkdir -p target
    go build -o target/spinning_cube.exe ./examples/spinning_cube
    cp ../c/target/release/nightshade_c.dll target/
    ./target/spinning_cube.exe

# Regenerate the typed command layer from the command registry.
generate:
    python ../generate.py
    gofmt -w .
