-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
53 lines (42 loc) · 1.69 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
48
49
50
51
52
53
# Main makefile
#
# Copyright (C) 2007 Beihang University
# Written by Zhu Like ( [email protected] )
#
drivers_dir := drivers
boot_dir := boot
user_dir := user
init_dir := init
lib_dir := lib
fs_dir := fs
mm_dir := mm
tools_dir := tools
vmlinux_elf := gxemul/vmlinux
link_script := $(tools_dir)/scse0_3.lds
modules := boot drivers init lib mm user fs
objects := $(boot_dir)/start.o \
$(init_dir)/main.o \
$(init_dir)/init.o \
$(init_dir)/code.o \
$(drivers_dir)/gxconsole/console.o \
$(lib_dir)/*.o \
$(user_dir)/*.x \
$(fs_dir)/*.x \
$(mm_dir)/*.o
.PHONY: all $(modules) clean
all: $(modules) vmlinux
vmlinux: $(modules)
$(LD) -o $(vmlinux_elf) -N -T $(link_script) $(objects)
$(modules):
$(MAKE) --directory=$@
clean:
for d in $(modules); \
do \
$(MAKE) --directory=$$d clean; \
done; \
rm -rf *.o *~ $(vmlinux_elf)
start:
/OSLAB/gxemul -E testmips -C R3000 -M 64 -d gxemul/fs.img ~/16231086-lab/gxemul/vmlinux
debug:
/OSLAB/gxemul -E testmips -C R3000 -M 64 -d gxemul/fs.img -v -V ~/16231086-lab/gxemul/vmlinux
include include.mk