-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (31 loc) · 1.08 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 ChaOS OS
#
# This work is licensed under the Creative Commons Attribution-NonCommercial-
# ShareAlike 3.0 Unported License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to:
# Creative Commons
# 444 Castro Street, Suite 900
# Mountain View, California, 94041, USA.
#
# Author(s): Drew Cross <[email protected]>
SOURCES = Multiboot.o ChaOSKernel.o screen.o common.o ChaOSKernelasm.o
CFLAGS = -Wall -Wextra -nostdlib -nostdinc -fno-stack-protector -nostartfiles -nodefaultlibs
LDFLAGS = -m elf_i386 -T linker.ld
ASFLAGS = -elf
all : $(SOURCES) link
Multiboot.o : Multiboot.s
nasm -f elf -o Multiboot.o Multiboot.s
ChaOSKernel.o : ChaOSKernel.c ChaOSKernel.s
gcc -m32 -o ChaOSKernel.o -c ChaOSKernel.c $(CFLAGS)
ChaOSKernelasm.o : ChaOSKernel.s
nasm -f elf -o ChaOSKernelasm.o ChaOSKernel.s
screen.o : screen.c
gcc -m32 -o screen.o -c screen.c $(CFLAGS)
common.o : common.c
gcc -m32 -o common.o -c common.c $(CFLAGS)
#.s.o:
# nasm $(ASFLAGS) $<
link:
ld $(LDFLAGS) -o ChaOSKernel.bin $(SOURCES)
clean :
rm *.o *.bin