-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakefile
79 lines (62 loc) · 1.49 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
CC = gcc
CC_INCLUDE_FLAGS = -nostdinc -I src/include/
CC_FLAGS = -m32 $(CC_INCLUDE_FLAGS) \
-fno-stack-protector -std=gnu99 \
-fno-builtin -Werror -Wall -O2
CPPC = g++
CPPC_INCLUDE_FLAGS = -I src/include/ -I .
CPPC_FLAGS = -std=c++14 -Werror -Wall -O2 $(CPPC_INCLUDE_FLAGS) \
-Wno-unused-result
LD = ld
LD_FLAGS = -m elf_i386
ASM = nasm
ASM_FLAGS =
C_SUFFIX = _C_FILES
CPP_SUFFIX = _CPP_FILES
O_SUFFIX = _O_FILES
D_SUFFIX = _D_FILES
TOOLS =
TOOLS_TGTS =
APPS =
APPS_TGTS =
include ./make/tool
include ./make/application
# disk img
HD = hd.img
.PHONY : all
all : $(HD) apps tools
include ./make/lib
include ./make/shared
include ./make/kernel
$(eval $(call make_tool,mkdpt,MKDPT))
$(eval $(call make_tool,bin_trans,BIN_TRANS))
$(eval $(call make_tool,disk_ipt,DISK_IPT))
$(eval $(call make_app,cat,CAT))
$(eval $(call make_app,cp,CP))
$(eval $(call make_app,ed,ED))
$(eval $(call make_app,file,FILE))
$(eval $(call make_app,help,HELP))
$(eval $(call make_app,less,LESS))
$(eval $(call make_app,ls,LS))
$(eval $(call make_app,mkdir,MKDIR))
$(eval $(call make_app,pwd,PWD))
.PHONY : apps
apps : $(APPS_TGTS)
.PHONY : tools
tools : $(TOOLS_TGTS)
.PHONY: clean
clean :
rm -f $(shell find ./src/ -name "*.dtmp")
rm -f $(shell find ./src/ -name "*.o")
rm -f $(shell find ./src/ -name "*.d")
rm -f $(shell find ./src/ -name "*.bootbin")
rm -f $(shell find ./src/ -name "*.bin")
rm -f $(TOOLS) $(APPS)
.PHONY: run
run :
make all
echo c | bochs
.PHONY: fs
fs :
bash setup_old.sh
make clean