How radsammyt/maker works
Project Type and Purpose
• Maker is a command-line build system (CLI tool) for compiling single-source files into binaries.
• It’s implemented in Rust (primary code under src/) and includes a legacy C++ version in legacy_cpp/ for backward‐compatibility or reference.
File Structure
• Top-level:
• Cargo.toml / Cargo.lock → Rust dependency/build configuration
• README.md → user docs & behavior
• legacy_cpp/ → legacy C++ implementation with its own build script (premake5.lua)
• src/ → Rust source:
• main.rs → CLI entrypoint
• maker.rs → core logic (config parsing, file discovery, command formatting, process execution)
• The legacy_cpp module: separate subproject using Premake5 to build main.cpp and a parsing library (parsing.hpp).
Extract Key Architecture Notes from the README
• Maker reads one or more source files, finds/merges configuration from a local or global “maker” config file, then compiles each file according to specified compiler commands/formats.
• Supports multiple “config” blocks per language, inline comment flags, and defaults for each file.
Main Components
a. CLI Interface (Rust binary)
b. Configuration Manager
c. File Scanner / Source File Enumerator
d. Command Formatter & Macro Processor
e. Process Executor (spawns gcc, tcc, cc, etc.)
f. Output Manager (writes compiled binaries to bin/)
g. External Tools (system compilers)
h. Legacy C++ Subproject (optional reference component)
Interactions and Data Flow
• User invokes maker CLI → main.rs
• CLI → Configuration Manager: locate & parse maker files (local or ~/maker)
• Configuration Manager → File Scanner: discover source files from CLI args
• File Scanner → Command Formatter: apply extension-based and comment-based flags
• Command Formatter → Process Executor: spawn external compiler processes with final command strings
• Process Executor → File System: write compiled binaries into bin/
Highlighted Architectural Patterns & Principles
• Separation of Concerns: distinct modules for config parsing, scanning, formatting, execution
• Plugin-style configuration: extensible “extension” blocks in a config file
• External process orchestration: isolating compiler invocations from core logic
• Dual implementation: Rust core + legacy C++ reference
Relevant Technologies & Frameworks
• Rust (Cargo for build, crates for argument parsing & file I/O)
• C++ and Premake5 for the legacy subproject
• System compilers: gcc, tcc, cc
• Filesystem for config discovery and binary output
Checklist
[ ] Annotations for config lookup order and comment-flag processing