forked from PoliEcho-holding-org/kern
49 lines
1020 B
Plaintext
49 lines
1020 B
Plaintext
#
|
|
# Makefile variables
|
|
#
|
|
|
|
# Tools
|
|
HOSTCC = cc
|
|
CC = i686-elf-gcc
|
|
LD = i686-elf-ld
|
|
AS = nasm
|
|
MAKE = make
|
|
|
|
# Flags
|
|
CFLAGS = -Wall -Wextra -Wno-pointer-sign -Wno-pointer-arith -Wno-unused-parameter\
|
|
-Os -std=c17 -nostdinc -g -Werror\
|
|
-ffreestanding -fno-stack-protector -fno-builtin -fno-pie -fcommon\
|
|
-m32 -march=i386
|
|
LDFLAGS = -z notext -nostdlib -melf_i386
|
|
ASFLAGS =
|
|
|
|
# Directories
|
|
BIN = ./bin
|
|
IMG = kern.img
|
|
|
|
# Kernel
|
|
KERNEL = $(BIN)/kernel.bin
|
|
KERNEL_DIR = ./kernel
|
|
KERNEL_SRC = $(KERNEL_DIR)/kernel.c
|
|
|
|
# Bootloader
|
|
BOOTSECT = $(BIN)/bootsect.bin
|
|
BOOTLOAD = $(BIN)/bootload.bin
|
|
BOOT_DIR = ./boot
|
|
BOOT_SRC_ASM = $(shell find $(BOOT_DIR) -type f -name "**.s")
|
|
BOOT_SRC_C = $(shell find $(BOOT_DIR) -type f -name "**.c")
|
|
|
|
# Libc
|
|
LIBC = $(BIN)/libc.o
|
|
LIBC_DIR = ./libc
|
|
LIBC_SRC = $(shell find $(LIBC_DIR) -type f -name "**.c")
|
|
|
|
# Userspace
|
|
FONT_DIR = ./usr/fonts
|
|
FONTS = testfont term16n
|
|
|
|
# Include directories
|
|
LIBC_INC = $(LIBC_DIR)/include
|
|
KERNEL_INC = $(KERNEL_DIR)/include
|
|
|