GDT finally works
This commit is contained in:
@ -1,53 +1,36 @@
|
||||
.PHONY: all clean
|
||||
|
||||
CC := x86_64-elf-gcc
|
||||
LD := x86_64-elf-ld
|
||||
ARCH ?= x86_64
|
||||
|
||||
override CFLAGS = -Wall \
|
||||
-Wextra \
|
||||
-ffreestanding \
|
||||
-fno-stack-protector \
|
||||
-fno-stack-check \
|
||||
-fno-lto \
|
||||
-fno-PIC \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-m64 \
|
||||
-march=x86-64 \
|
||||
-mabi=sysv \
|
||||
-mno-80387 \
|
||||
-mno-mmx \
|
||||
-mno-sse \
|
||||
-mno-sse2 \
|
||||
-mno-red-zone \
|
||||
-mcmodel=kernel \
|
||||
-I. \
|
||||
CFLAGS := -ffreestanding -Wall -Wextra -g -fcommon
|
||||
|
||||
CFLAGS += -I. \
|
||||
-I../limine \
|
||||
-DPRINTF_INCLUDE_CONFIG_H=1
|
||||
|
||||
override LDFLAGS = \
|
||||
-m elf_x86_64 \
|
||||
-nostdlib \
|
||||
-static \
|
||||
-z max-page-size=0x1000 \
|
||||
--gc-sections \
|
||||
-T link.ld
|
||||
LDFLAGS := -nostdlib -static -T arch/$(ARCH)/link.ld
|
||||
|
||||
override NASMFLAGS = \
|
||||
-felf64 \
|
||||
-Wall \
|
||||
-F dwarf -g
|
||||
include arch/$(ARCH)/$(ARCH).mk
|
||||
include extconf/extra.mk
|
||||
|
||||
override SRCFILES := $(shell find -L . -type f 2>/dev/null | LC_ALL=C sort)
|
||||
override CFILES := $(filter %.c,$(SRCFILES))
|
||||
override ASFILES := $(filter %.asm,$(SRCFILES))
|
||||
override OBJ := $(patsubst %.c,%.o,$(CFILES)) $(patsubst %.asm,%.o,$(ASFILES))
|
||||
SRCFILES := $(wildcard *.c) \
|
||||
$(wildcard printf/*.c) \
|
||||
$(wildcard bitmap/*.c) \
|
||||
$(wildcard pmm/*.c) \
|
||||
$(wildcard bootinfo/*.c) \
|
||||
$(wildcard hal/*.c) \
|
||||
$(wildcard hal/$(ARCH)/*.c) \
|
||||
$(wildcard hal/$(ARCH)/*.S) \
|
||||
$(wildcard *.S)
|
||||
CFILES := $(filter %.c,$(SRCFILES))
|
||||
ASFILES := $(filter %.S,$(SRCFILES))
|
||||
OBJ := $(patsubst %.c,%.o,$(CFILES)) $(patsubst %.S,%.o,$(ASFILES))
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.o: %.asm
|
||||
nasm $(NASMFLAGS) $< -o $@
|
||||
%.o: %.S
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
all: mop2
|
||||
|
||||
|
Reference in New Issue
Block a user