This project uses Bazel as its build system. Bazel provides fast, reproducible builds with excellent caching and incremental compilation.
Install Bazel (or Bazelisk, which automatically uses the correct Bazel version):
macOS:
brew install bazeliskLinux:
npm install -g @bazel/bazeliskOr download from bazel.build/install
Build the UwUC compiler in release mode (optimized):
bazel build //:uwuccThe compiled binary will be available at bazel-bin/uwucc.
Build with debug symbols and address sanitizer:
bazel build --config=debug //:uwuccRun the compiler directly through Bazel:
bazel run //:uwucc -- input.uwu -o outputOr use the built binary:
./bazel-bin/uwucc input.uwu -o outputThe build system automatically creates targets for all .uwu files in the example/ directory.
For a file example/ez.uwu:
bazel build //:example_ezThe compiled binary will be at bazel-bin/ez.
bazel run //:example_ezSee all example targets and other build targets:
bazel query //...Optimized with -O2 and -march=native:
bazel build //:uwucc
# or explicitly:
bazel build --config=release //:uwuccWith debug symbols, no optimization, and AddressSanitizer:
bazel build --config=debug //:uwuccThe build system automatically detects your platform and architecture:
- Platforms: macOS, Linux
- Architectures: x86_64, ARM64 (aarch64)
Platform-specific flags are applied automatically:
- macOS:
-DUWUCC_PLATFORM_MACOS - Linux:
-DUWUCC_PLATFORM_LINUX,-no-pielinker flag - ARM64:
-DUWUCC_ARCH_ARM64 - x86_64:
-DUWUCC_ARCH_X86_64
Remove all build outputs:
bazel cleanDeep clean (removes all cached data):
bazel clean --expungeView build configuration and paths:
bazel info- Incremental builds: Only rebuilds what changed
- Better caching: Shares build cache across projects
- Reproducible: Same inputs always produce same outputs
- Parallel by default: Uses all CPU cores efficiently
- Cross-platform: Consistent behavior on all platforms
- MODULE.bazel - Declares dependencies (platforms, bazel_skylib)
- BUILD.bazel - Defines build targets and rules
- .bazelrc - Build configuration options and flags
"No such target": Make sure you're in the project root directory.
"Platform not found": Update the platforms version in MODULE.bazel.
Slow first build: Bazel downloads dependencies and builds everything on first run. Subsequent builds are much faster.