This commit is contained in:
2024-12-05 21:22:19 +01:00
parent cc23753573
commit b6c66136f7
14 changed files with 452 additions and 0 deletions

18
Makefile Normal file
View File

@@ -0,0 +1,18 @@
STDLIB_HEADERS := $(wildcard stdlib/include/*)
STDLIB_SOURCES := $(wildcard stdlib/src/*)
TARGETS := $(patsubst src/%.c,bin/%,$(wildcard src/*.c))
CFLAGS := -O2 -nostdlib -Istdlib/include -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-builtin -std=c99 -pedantic -Wall -Werror -fno-stack-protector -static -Wl,-n
.PHONY: all clean
all: $(TARGETS)
bin/%: src/%.c $(STDLIB_SOURCES) $(STDLIB_HEADERS)
@mkdir -p $(@D)
gcc $(CFLAGS) $< $(STDLIB_SOURCES) -o $@
strip -R .comment $@
clean:
rm -rf bin