furix
cute os
Makefile
539 bytes raw
1ARCH ?= x86_64
2
3CFLAGS := \
4 -std=c99 -Wall -Werror -Wextra -pedantic-errors -MMD -MP -g \
5 -ffreestanding -fno-builtin -nostdlib -nostdinc -Iinclude
6
7LDFLAGS := \
8 -ffreestanding -nostdlib
9
10KERNEL_SRC := \
11 kernel/kernel.c
12
13BUILD := build/obj
14BUILD_BOOT := build/boot/$(ARCH)
15
16KERNEL_ELF := $(BUILD_BOOT)/kernel.elf
17
18.PHONY: all
19all: $(KERNEL_ELF)
20
21.PHONY: clean
22clean:
23 rm -rf build/
24
25.PHONY: compile_flags.txt
26compile_flags.txt:
27 @echo $(CFLAGS) | tr ' ' '\n' | tee $@
28
29include arch/$(ARCH)/Makefile
30include boot/$(ARCH)/Makefile