Build tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Martin Dørum df2beb2650 Merge branch 'feature/new-parser' 3 years ago
cmd fix command-line kvargs 3 years ago
lib printing changes 3 years ago
test new parser tests 3 years ago
.gitignore refactor a bit 3 years ago
Makefile change how child processes work 3 years ago readme 3 years ago
build.bx change how child processes work 3 years ago

Boxberry: A build system which scales down

Boxberry is a build system which aims to be usable for tiny projects, all the way down to single source files.

Not all projects need a big Makefile or a huge CMakeLists.txt. However, almost all projects grow to the size where they need some library, or some compiler flag, maybe an optimization option. Boxberry aims to make the path from running cc file.c to running cc -lpthread file.c to cc file.c $(pkg-config --libs --cflags libfoo) -lpthread as easy as possible.

  • Source files are automatically discovered (by default).
  • Dependencies can be specified in the source file: //#bx pkgs := libfoo
  • Linker and compiler flags can be specified in the source file: //#bx ldlibs := -lpthread ldflags := -fsanitize=address cflags := -fsanitize=address
  • A source file is automatically recompiled if it has changed, or if any included header files have changed.
  • If your project grows, you can put global configs in a build.bx file. Each directory can have a build.bx file, and each directory inherits the configuration of its parent.
  • Files can be specified instead of discovered automatically by setting the files variable in a build.bx file.


This project can be built by running either make or box. The only dependency is pthreads.


  • Add --print-compile-commands
  • Consider changing the config file format name from BBB to BB
  • Support different build configurations (requires conditionals in the parser)
  • Re-work the command-line interface
  • Save build configuration in the output dir
  • Support one “main” build.bx file which specifies things like the target name
  • Support creating shared/static libraries too, not just binaries
  • Implement recursive mkdir in C++ instead of shelling out to mkdir
  • Support subprojects
  • Look into saving the result of $(CC) -MM to make recompiles faster when little has changed