-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
46 lines (38 loc) · 1005 Bytes
/
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
ARCH = x86
KERNEL = hyper-os
TARGET = bin/$(KERNEL)
GZTARGET = bin/$(KERNEL).gz
MAP = bin/$(KERNEL).map
LDSCRIPT = arch/$(ARCH)/kernel.ld
OBJS = \
arch/$(ARCH)/boot/boot.o \
arch/$(ARCH)/kernel/gdt.o \
arch/$(ARCH)/kernel/irq.o \
arch/$(ARCH)/kernel/page.o \
arch/$(ARCH)/kernel/setup.o \
kernel/core.o \
kernel/list.o \
kernel/mem.o \
mm/mm.o \
drivers/video/video.o
CFLAGS = -Iinclude/ -Iarch/$(ARCH)/include/ -fno-stack-protector -m32
LDFLAGS = -m elf_i386
all: $(KERNEL)
$(LDSCRIPT): $(LDSCRIPT).S
@$(CC) -E -P $< $(CFLAGS) -o $@
$(KERNEL): $(OBJS) $(LDSCRIPT)
@echo LD $<
@$(LD) -T$(LDSCRIPT) -Map $(MAP) -o $(TARGET) $(OBJS) $(LDFLAGS)
install: $(KERNEL)
@echo -n installing kernel...
@mkdir image/temp
@mount -o loop image/hyper-os.img image/temp
@cp bin/hyper-os image/temp/boot/
@umount image/temp
@rmdir image/temp
@echo done
clean:
@echo -n Cleaning...
@rm -f $(OBJS) $(TARGET) $(MAP) $(LDSCRIPT)
@echo done
include rules.make