-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (37 loc) · 1 KB
/
Makefile
File metadata and controls
54 lines (37 loc) · 1 KB
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
48
49
50
#
# Makefile for ICE
#
AR =ar
NASM =nasm -f elf
AS =as
LD =ld
LDFLAGS =-s -x -Ttext 0x0 -e _startup_32
CC =g++
CFLAGS =-Wall -O2 -fstrength-reduce -fomit-frame-pointer -nostdinc
CPP =gcc -E -nostdinc
OBJDUMP =objdump
OBJCOPY =objcopy
# The order of this shit is important!
SYSTEM_OBJS = boot/kickstart.o init/libinit.a kernel/libkernel.a
# All subdirs except boot.. =)
SUBDIRS = init kernel
all: system
system: $(SYSTEM_OBJS)
$(LD) $(LDFLAGS) -o system.elf $(SYSTEM_OBJS)
$(OBJCOPY) --remove-section=.note --remove-section=.comment --output-target=binary system.elf system.bin
(cd boot; make boot)
cat boot/boot.b system.bin > system
rm -f system.elf system.bin
sync
init/libinit.a:
(cd init; make dep; make)
kernel/libkernel.a:
(cd kernel; make dep; make)
boot/kickstart.o:
(cd boot; make kickstart)
clean:
for i in $(SUBDIRS); do (cd $$i && make clean); done;
(cd boot; make clean)
rm -f core system.elf system.bin system *~ tmp_make
dep:
for i in $(SUBDIRS); do (cd $$i && make dep); done;