forked from menghuanlater/BUAA_MIPS_OS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (38 loc) · 974 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
47
# Main makefile
#
# Copyright (C) 2007 Beihang University
# Written by Zhu Like ( zlike@cse.buaa.edu.cn )
#
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) gxemul/*.img
include include.mk