-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (56 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#### global settings #####
.PHONY: nemu entry testcase kernel run gdb test submit clean
CC := gcc
LD := ld
CFLAGS := -MMD -Wall -Werror -c
LIB_COMMON_DIR := lib-common
LIBC_INC_DIR := $(LIB_COMMON_DIR)/uclibc/include
LIBC_LIB_DIR := $(LIB_COMMON_DIR)/uclibc/lib
LIBC := $(LIBC_LIB_DIR)/libc.a
FLOAT := obj/$(LIB_COMMON_DIR)/FLOAT/FLOAT.a
include config/Makefile.git
include config/Makefile.build
all: nemu
##### rules for building the project #####
include nemu/Makefile.part
include testcase/Makefile.part
include lib-common/FLOAT/Makefile.part
include kernel/Makefile.part
include game/Makefile.part
nemu: $(nemu_BIN)
testcase: $(testcase_BIN)
kernel: $(kernel_BIN)
game: $(game_BIN)
##### rules for cleaning the project #####
clean-nemu:
-rm -rf obj/nemu 2> /dev/null
clean-testcase:
-rm -rf obj/testcase 2> /dev/null
clean-kernel:
-rm -rf obj/kernel 2> /dev/null
clean-game:
-rm -rf obj/game 2> /dev/null
clean: clean-cpp
-rm -rf obj 2> /dev/null
-rm -f *log.txt entry $(FLOAT) 2> /dev/null
##### some convinient rules #####
USERPROG := obj/testcase/max
#USERPROG := $(game_BIN)
# USERPROG := obj/testcase/hello-str
ENTRY = $(kernel_BIN)
entry: $(ENTRY)
objcopy -S -O binary $(ENTRY) entry
run: $(nemu_BIN) $(USERPROG) entry
$(call git_commit, "run")
$(nemu_BIN) $(USERPROG)
gdb: $(nemu_BIN) $(USERPROG) entry
$(call git_commit, "gdb")
gdb -s $(nemu_BIN) --args $(nemu_BIN) $(USERPROG)
test: $(nemu_BIN) $(testcase_BIN) entry
$(call git_commit, "test")
bash test.sh $(testcase_BIN)
submit: clean
cd .. && tar cvj $(shell pwd | grep -o '[^/]*$$') > $(STU_ID).tar.bz2
count :
git diff --stat aff947dcbfa4d21c6ae8285dcfeac0dbdfb61929
# PA1 3269ac1175e562a701aee7e01d2ff099ba6d9cdb