-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcommon.mk
46 lines (31 loc) · 1.24 KB
/
common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
########## KERNEL CONFIGURATION ##########
# Architecture to build for: x86
ARCH := x86
# About the kernel
KERNEL_AUTHOR := TheWorm
KERNEL_NAME := microkernel
KERNEL_VERSION := 0.0.0-1
KERNEL_DESCRIPTION := Simple microkernel for personal research
# Just some useful defines...
KERNEL := $(KERNEL_NAME)-$(KERNEL_VERSION)
RAMDISK := initrd-$(KERNEL_VERSION)
########## TOOLS CONFIGURATION ##########
# Common configuration for GCC
CC := gcc
SRCFILES := $(shell find -L . -maxdepth 1 -type f -name "*.c")
OBJFILES := $(patsubst %.c,%.o,$(SRCFILES))
WARNINGS := -Wall -Wextra -ansi -pedantic -Wno-unused-parameter -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wstrict-prototypes -Werror
CFLAGS := -static -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -ffreestanding -fstrength-reduce -finline-functions -std=c99 $(WARNINGS)
# Assembler
ASM := nasm
ASMFLAGS := -felf
# Archive/library manager
AR := ar
ARFLAGS := rvs
# Linker
LD := ld
# Virtual machine - emulator: qemu, bochs
VM := qemu
########## ARCH-SPECIFIC CONFIGURATION ##########
# Add specific cflags, etc.
include $(ROOTDIR)/$(ARCH).mk