Skip to content

Latest commit

 

History

92 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bld

Single-header build system for C. Write build.c, include bld.h, implement configure().

#define BLD_IMPLEMENTATION
#define BLD_STRIP_PREFIX
#include "bld.h"

BLD_RECOMPILE_CMD("cc -std=c11 -w build.c -lpthread")

void configure(Bld* b) {
    set_compiler_c(b, .standard = BLD_C_11);

    Target* exe = add_exe(b, .name = "myapp",
        .sources = BLD_PATHS("main.c"));
}
cc -std=c11 -w build.c -o b -lpthread
./b build

Content hashing, header dep tracking (-MMD), parallel compilation, auto-recompilation of build.c.

See docs/api.md for the full API reference.

Showcase

Real-world build scripts for curl and libuv.

To build them locally:

cd showcase/01_curl
./fetch-source.sh                         # downloads source tarball
cc -std=c11 -w build.c -o b -lpthread    # bootstrap
./b build                                 # build curl
./build/bin/curl --version                # verify

Same steps for showcase/02_libuv.

About

C STB-style build system for fun and... fun

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages