The smallest build system
10 points by asb
10 points by asb
Zig, which is some nice prior art for writing the build files in the source language
This is great if you know the language. It's exponentially terrible if you're just starting out and the docs are not helpful.
But maybe build systems are (without any external limiting factors) just a thing where personal preference plays a big role. I've never been let down by cargo or make or qmake (in a sense that I couldn't find a solution on the web) but it has absolutely happened with other build systems (looking at you, cmake and ant and maven).
Ah, a reimplementation of make. For really simple C program of a single file (like for a class) you don't even need a makefile---just make prog will work as long prog.c exists. Even larger projects aren't that bad with make, here's a 150,000 line project (using GNUmake, which I find more useful than POSIX make):
%.a :
$(AR) $(ARFLAGS) $@ $?
libIMG/libIMG.a : $(patsubst %.c,%.o,$(wildcard libIMG/*.c))
libXPA/src/libxpa.a : $(patsubst %.c,%.o,$(wildcard libXPA/src/*.c))
libStyle/libStyle.a : $(patsubst %.c,%.o,$(wildcard libStyle/*.c))
libWWW/libWWW.a : $(patsubst %.c,%.o,$(wildcard libWWW/*.c))
viola/viola : $(patsubst %.c,%.o,$(wildcard viola/*.c)) \
libIMG/libIMG.a \
libXPA/src/libxpa.a \
libStyle/libStyle.a \
libWWW/libWWW.a \
parmcheck.o
Granted, generating dependencies is a bitch, but once done, you at least get parallel builds with make for free (make -j).
It's funny, but I first came across make as a teenager in high school writing assembly code for MS-DOS. Yes, I learned make on MS-DOS, not Unix. It was a godsend for doing multi-file development on a single floppy system.
That's not ViolaWWW, is it?
It is, but with fixes to compile cleanly under gcc -std=c99 -Wall -Wextra -pedantic and a bit of clean up of the code layout. It (barely) runs under x86-32 bit, but crashes immediately under x86-64 due to extensive assumptions about integer/pointer sizes made in the early 90s. Sigh.