day 4
This commit is contained in:
23
Makefile
23
Makefile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user