diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -1,13 +1,13 @@ PATH := $(shell pwd)/toolchain/bin/:$(PATH) -AS = i686-elf-as -CC = i686-elf-gcc +AS = x86_64-elf-as +CC = x86_64-elf-gcc CHECK = sparse CFLAGS += -g -std=gnu99 -ffreestanding -O2 -Wall -Wextra -Wold-style-definition -Werror=implicit-function-declaration -ftrack-macro-expansion=0 CFLAGS += -mgeneral-regs-only CFLAGS += -Isrc/ SPARSEFLAGS = -Wno-non-pointer-null -LFLAGS = -ffreestanding -O2 -nostdlib -lgcc +LFLAGS = -ffreestanding -O2 -nostdlib -lgcc -Wl,-zmax-page-size=4096 -Wl,--no-warn-mismatch QFLAGS = -no-reboot ifndef QEMU_DISPLAY QFLAGS += -display none @@ -23,12 +23,12 @@ endef all: out/boot.iso check boot: all out/hdd - qemu-system-i386 -drive file=out/boot.iso,format=raw,media=disk $(QFLAGS) -serial stdio + qemu-system-x86_64 -drive file=out/boot.iso,format=raw,media=disk $(QFLAGS) -serial stdio test: all @# pipes for the serial @mkfifo out/qemu.in out/qemu.out 2> /dev/null || true - qemu-system-i386 -drive file=out/boot.iso,format=raw,media=disk $(QFLAGS) -serial pipe:out/qemu & + qemu-system-x86_64 -drive file=out/boot.iso,format=raw,media=disk $(QFLAGS) -serial pipe:out/qemu & @# for some reason the first sent character doesn't go through to the shell @# the empty echo takes care of that, so the next echos will work just fine @echo > out/qemu.in @@ -38,7 +38,7 @@ test: all @cat out/qemu.out debug: all - qemu-system-i386 -cdrom out/boot.iso $(QFLAGS) -serial stdio -s -S & + qemu-system-x86_64 -cdrom out/boot.iso $(QFLAGS) -serial stdio -s -S & @sleep 1 gdb @@ -87,5 +87,13 @@ out/obj/%.c.o: src/%.c @mkdir -p $(@D) @$(CC) $(CFLAGS) -c $^ -o $@ +out/obj/kernel/arch/amd64/32/%.c.o: src/kernel/arch/amd64/32/%.c + @mkdir -p $(@D) + @$(CC) $(CFLAGS) -m32 -c $^ -o $@ + +out/obj/kernel/arch/amd64/32/%.s.o: src/kernel/arch/amd64/32/%.s + @mkdir -p $(@D) + @$(CC) -m32 -c $^ -o $@ + src/user/lib/syscall.c: src/user/lib/syscall.c.awk src/shared/syscalls.h awk -f $^ > $@ |