• This repository has been archived on 08/Jan/2024
  • Stars
    star
    528
  • Rank 83,941 (Top 2 %)
  • Language
    C
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Header only library for writing build recipes in C.

nobuild

Header only library for writing build recipes in C.

Main idea

The idea is that you should not need anything but a C compiler to build a C project. No make, no cmake, no shell, no cmd, no PowerShell etc. Only C compiler. So with the C compiler you bootstrap your build system and then you use the build system to build everything else.

Try it out right here:

$ cc ./nobuild.c -o nobuild
$ ./nobuild

Explore nobuild.c file and the examples folder to learn more.

This is an Experimental Project

I'm not sure if this is even a good idea myself. This is why I'm implementing it. This is a research project. I'm not making any claims about suitability of this approach to any project.

Right now I'm actively using nobuild only in bm. It works quite well for me there.

It's likely Not Suitable for Your Project

If you are using cmake with tons of modules to manage and find tons of dependencies you probably don't want to use this tool. nobuild is more like writting shell scripts but in C.

Advantages of nobuild

  • Extremely portable builds across variety of systems including (but not limited to) Linux, MacOS, Windows, FreeBSD, etc. This is achieved by reducing the amount of dependencies to just a C compiler, which exists pretty much for any platform these days.
  • You end up using the same language for developing and building your project. Which may enable some interesting code reusage strategies. The build system can use the code of the project itself directly and the project can use the code of the build system also directly.
  • You get to use C more.
  • ...

Disadvantages of nobuild

  • You need to be comfortable with C and implementing things yourself. As mentioned above this is like writing shell scripts but in C.
  • It probably does not make any sense outside of C/C++ projects.
  • You get to use C more.
  • ...

Why is it called "nobuild" when it's clearly a build tool?

You know all these BS movements that supposedly remove the root cause of your problems? Things like NoSQL, No-code, Serverless, etc. This is the same logic. I had too many problems with the process of building C projects. So there is nobuild anymore.

How to use the library in your own project

Keep in mind that nobuild.h is an stb-style header-only library. That means that just including it does not include the implementations of the functions. You have to #define NOBUILD_IMPLEMENTATION before the include. See our nobuild.c for an example.

  1. Copy nobuild.h to your project
  2. Create nobuild.c in your project with the build recipe. See our nobuild.c for an example.
  3. Bootstrap the nobuild executable:
    • $ cc nobuild.c -o nobuild on POSIX systems
    • $ cl.exe nobuild.c on Windows with MSVC
  4. Run the build: $ ./nobuild

If you enable the Go Rebuild Urself™ Technology the nobuild executable will try to rebootstrap itself every time you modify its source code.

More Repositories

1

olive.c

Simple 2D Graphics Library for C
C
1,747
star
2

musializer

Music Visualizer
C
857
star
3

porth

It's like Forth but in Python
630
star
4

pinpog

Ping-Pong-like game in Assembly that works without OS
Assembly
568
star
5

ded

Dramatic EDitor
C
565
star
6

todo.asm

Todo Web Application in flat assembler
Assembly
444
star
7

boomer

Zoomer application for Linux
Nim
441
star
8

snitch

Language agnostic tool that collects TODOs in the source code and reports them as Issues
Go
416
star
9

good_training_language

Хороший Учебный Язык
Rust
381
star
10

nn.h

Simple stb-style header-only library for Neural Networks
C
332
star
11

eepers

Simple Turn-based Game
Ada
319
star
12

c.php

C to Python compiler in PHP
PHP
289
star
13

nothing

A simple platformer about nothing
C
273
star
14

Noq

Simple expression transformer that is not Coq.
Rust
253
star
15

seroost

Local Search Engine
Rust
228
star
16

arena

Arena Allocator implementation in pure C as an stb-style single-file library.
C
201
star
17

raycasting

My take on Raycasting inspired by Lode's Computer Graphics Tutorial
TypeScript
173
star
18

grecha.js

Simple Front-End JavaScript Framework
JavaScript
171
star
19

4at

Simple Multi-User Chat
Rust
162
star
20

bm

Simple compiler ecosystem
C
161
star
21

tula

Turing Language
Rust
159
star
22

emoteJAM

Simple website that generates animated BTTV emotes from static images.
JavaScript
152
star
23

JelloVM

JVM in Python that can only run "Hello, World"
Python
148
star
24

zozlib.js

Unofficial Implementation of Subset of Raylib API in JavaScript
C
146
star
25

sowon

Starting Soon Timer for Tsoding Streams
C
144
star
26

memalloc

Artifacts of that Memory Management Tsoding Session
C
143
star
27

snake-c-wasm

Snake written in Pure C and compilable to WebAssembly
C
141
star
28

haskell-json

Source Code for JSON Parser Video
Haskell
136
star
29

bfjit

JIT Compiler for Brainfuck
C
134
star
30

haskell-music

Source Code from "Making Music with Haskell" video
Haskell
130
star
31

wassm

Web framework for x86_64 nasm
Assembly
126
star
32

HyperNerd

Total Surveillance Automatic Ban Machine for Twitch and Discord
Haskell
124
star
33

sv

Simple String_View implementation for C programming language.
C
120
star
34

aoc-2020

Advent of Code 2020 in 25 Different Languages
Julia
109
star
35

todo-rs

Simple Interactive Terminal Todo App in Rust
Rust
105
star
36

la

Linear Algebra in C
C
97
star
37

ml-notes

Notes from Machine Learning in C session
C
89
star
38

fasm-raylib-simd

A simple demo of using SIMD instructions and Raylib in fasm
C
88
star
39

jaibreak

JavaScript
86
star
40

cm

Emacs' compilation-mode-like TUI application
Rust
86
star
41

perceptron

Simple Perceptron Implementation inspired by Veritasium Video
C
85
star
42

HTMLang

HTML as a Programming Language. Finally all of your dreams came true.
JavaScript
84
star
43

img2term

Print an image in the terminal using the term 256 colors
C
84
star
44

dimooper

Digital Music Looper
Rust
82
star
45

opengl-template

Just a simple OpenGL template that I use on my streams.
C
82
star
46

profun

Procedural vs Functional
C
79
star
47

binviz

Binary Visualization based on Christopher Domas talk: https://www.youtube.com/watch?v=4bM3Gut1hIk
C
76
star
48

articles

Here I keep some thoughts that I always wanted to write down somewhere, but never knew where.
TeX
74
star
49

noed

Not ed(1) text editor
C
68
star
50

SmoothLife

SmoothLife Implementation in C
C
68
star
51

bada

Simple Programming Language that compiles to BEAM bytecode
Rust
67
star
52

faq

FAQ
66
star
53

kdtree-in-python

Source Code for K-d tree in Python series
Python
66
star
54

jai-wasm

Jai WebAssembly Proof-of-Concept
JavaScript
64
star
55

rendering-video-in-c-with-ffmpeg

Rendering Video in C with FFMpeg
C
63
star
56

multiplayer-game-prototype

Proof-of-concept of a Simple Multiplayer Game
TypeScript
61
star
57

tic-tac-toe-fortran-raylib

Tic-Tac-Toe in Fortran with Raylib
Fortran
57
star
58

flag.h

Command-line flag parsing in C
C
56
star
59

jim

Immediate Mode JSON Serialization Library in C
C
54
star
60

seam-carving

Seam Carving implementation
C++
54
star
61

minicel

Simple Excel engine without any UI
C
53
star
62

piff

Simple File Diff Tool in Python
Python
53
star
63

glob.h

Simple Header-Only Implementation of Glob Matching
C
51
star
64

mine

Minesweeper in Terminal
Pascal
51
star
65

bi-format

Structured Human-Readable Binary Format
50
star
66

ebisp

Embedded Lisp
C
49
star
67

zigout

An attempt to implement breakout in Zig
Zig
49
star
68

something-rewrite

Rewrite of Something from scratch
C
48
star
69

autocell

Cellular Automata Experiment
TypeScript
46
star
70

wang-tiles

Wang Tiles Grid generator
C
46
star
71

rere.py

Universal Behavior Testing Tool in Python.
Python
45
star
72

conway

Conway's Game of Life implementation in C formatted as Glider
C
45
star
73

something

Finally something
C
44
star
74

imhui

Immediate Human User Interface
C
42
star
75

vodus

Twitch VOD chat renderer
C
41
star
76

markut

Autocut the Twitch VODs based on a Marker file
Go
40
star
77

subframes

Simple Experiment with Subframe rendering
C
40
star
78

elf.js

An on going project to learn ELF format.
TypeScript
39
star
79

rcui

Simple TUI framework in Rust
Rust
37
star
80

voidf

V̳͙̥̹̟͗̀̎̓͌͐́O̘̞͇̞̣͇͕͂͠I͙̋͐̍͂̀D̶͕̩̦̲͙F̟̖̮ͩ̏ͥ̂ͨ͠ ͍̰̫̯͙̯ͨ̉ͤ̈̿ͭI̤͍̲̯ͤ̎̀͝S̴̻͇̳̗̩ͧ̆ ̭̘̦ͭ͒Ĉ̸̰̼̤̖̲O̹̭̞̺̻͚̣̒M̪͓̗̤͋͢Ĩ͔̗̣̻̄̏̏̏̚N̳̦̂ͯ̅͂̓̈́G͈̣
C
36
star
81

stb_image_js

stb_image.h wrapper for a Web Browser
C
36
star
82

data-mining-in-c

Notes and Source Code from the Data Mining in C series.
C
36
star
83

rust-browser-game

Bloat-Free Browser Game in Rust (rustc-only challenge)
Rust
35
star
84

simple-ocaml-raylib-template

Intentionally Simple Raylib OCaml Template
OCaml
35
star
85

voronoi-opengl

Voronoi with OpenGL using Depth Buffer
C
34
star
86

parcoom

Parser Combinators of Monad
OCaml
31
star
87

wacket

Racket to WebAssembly "compiler".
Racket
30
star
88

deque.py

Deque-based Programming Language
Python
30
star
89

zzzwe

zzzwe
JavaScript
29
star
90

command-pattern

Command Pattern (an Imperative one)
Rust
29
star
91

schedule

Schedule for Tsoding Streams
TypeScript
28
star
92

dedup

Duplicate Files Searcher
C++
28
star
93

turd

Turing Machine in D
D
28
star
94

skedudle

Simple Event Schedule Web Application in C
C
27
star
95

bezier

Just a fun little project to learn how to render Bézier Curves.
C
27
star
96

wisp

Wisp is a set of simple scripts for setting up small QEMU-based Virtual Machines
Shell
27
star
97

ht

This is the notes from a Hash Table in C stream.
C
26
star
98

turj

Turing Machine in Jai
C
26
star
99

atomato

A collection of different Cellular Automata implementations for recreational purposes
C
25
star
100

rope-jai

Rope simulation in Jai
24
star