This commit is contained in:
2025-12-04 00:45:42 -06:00
parent 4ca5884255
commit 28d44f2bbf
13 changed files with 851 additions and 31 deletions

View File

@@ -2,14 +2,27 @@ FILES = $(wildcard ./*)
SRCS = $(filter %.c,$(FILES))
BINS = $(SRCS:%.c=%.elf)
CFLAGS = -Wall -Werror -pedantic -Wno-unused -D_GNU_SOURCE -std=gnu2y\
-O3 -g -Ttext=C475000 -static -nostartfiles -fno-stack-protector\
-march=x86-64 -msse2 -msse3 -mssse3 -mpclmul -mpopcnt -madx -mbmi2 -mrdrnd -mrdseed
MUSLFILES = $(wildcard ./musl/*)
MUSLSRCS = $(filter %.s,$(MUSLFILES))
MUSLOBJS = $(MUSLSRCS:%.s=%.o)
CFLAGS = -Wall -Werror -pedantic -Wno-unused -std=gnu2y\
-O3 -c -g -fno-stack-protector -fno-pie\
-fno-semantic-interposition -fno-trapping-math\
-march=x86-64 -mprefer-vector-width=128 -mpopcnt -malign-data=compat -malign-stringops
LFLAGS = -Ttext=C475000 -static -nostdlib -no-pie
all: $(BINS)
%.elf: %.c
%.elf: %.o start.o | %.c lib.h $(MUSLOBJS)
ld -o $@ $(LFLAGS) start.o $< $(MUSLOBJS)
start.o: start.s
nasm -f elf64 -o $@ $<
%.o: %.c
gcc-tree -o $@ $(CFLAGS) $<
clean:
rm ./*.elf
rm -f *.elf *.o