-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
48 lines (34 loc) · 1.18 KB
/
Makefile
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
47
######################################################################
# Makefile for Fleak OS ver: 0.0.4 #
# Copyright(c) 09/04/2021 #
# Fleak foundation #
######################################################################
# If you are running on Linux, must change the syntax of some #
# like: 'mkisofs', 'gcc', 'nasm', etc... #
# Also must change the '\' to '/' #
# This script is not compatible in Windows. #
######################################################################
MAKE = make
LD = ld
CC = gcc
NASM = nasm
CFLAGS = -m32 \
-ffreestanding \
-O2 \
-nostdlib \
-lgcc \
-fno-pic
LDFLAGS = -felf32
PHONY := build
build:
$(MAKE) -C init/
$(MAKE) -C boot/
$(CC) -m32 -T boot/link.ld -o fleakos.bin -ffreestanding -O2 -nostdlib boot/boot.o init/kernel.o -lgcc -fno-pic
grub-mkrescue -o fleakos.iso
qemu-system-i386 -cdrom fleakos.iso
clean:
@echo "---------------------"
@echo "Cleaning..."
rm -r init/kernel.o boot/boot.o
rm -r *.iso
rm -r *.bin