1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
export OUT = $(PWD)/out
# TODO: calculate these using $(MAKE_HOST)
export ARCH = x86
export OS = lin
export BITS = 64
export ROOT = $(PWD)
export TMP = $(PWD)/tmp
ifneq ($(BITS),)
export TARGET = $(ARCH).$(OS).$(BITS)
else
export TARGET = $(ARCH).$(OS)
endif
................................................................................
uninstall: $(header-dir)/k $(lib-dir)/k
rm -rf $^
lists = moddirs functions assemblies fnobjects rtobjects binaries binmods POSIX
dbg:
@echo -e lists: $(foreach var, $(lists), "\\n - \\e[1m$(var)\\e[m = $($(var))")
%.obj: %/makefile $(TMP)/system_calls.h $(TMP)/system_calls.s $(OUT)
cd $* && $(MAKE) obj
%.tool: %/makefile $(OUT)
cd $* && $(MAKE) tool
%.dbg: %/makefile $(OUT)
cd $* && $(MAKE) dbg
%.def: %/makefile $(TMP)/typesize.def $(OUT) $(OUT)/k
cd $* && $(MAKE) def
.PRECIOUS: $(TMP)/system_calls.%
$(TMP)/system_calls.%: arch/makefile
$(MAKE) -C arch $@
$(TMP)/typesize.def: arch/makefile $(TMP)
$(MAKE) -C arch $@
$(OUT)/libk.so: $(fnobjects)
ld -shared $(COMPLIB) -o $@ $^
@# $(CC) -shared -fPIC -nostdlib $(COMPLIB) -o $@ $(OUT)/*.o
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
export OUT = $(PWD)/out
# TODO: calculate these using $(MAKE_HOST)
export ARCH = x86
export OS = lin
export BITS = 64
export ROOT = $(PWD)
export TMP = $(PWD)/gen
ifneq ($(BITS),)
export TARGET = $(ARCH).$(OS).$(BITS)
else
export TARGET = $(ARCH).$(OS)
endif
................................................................................
uninstall: $(header-dir)/k $(lib-dir)/k
rm -rf $^
lists = moddirs functions assemblies fnobjects rtobjects binaries binmods POSIX
dbg:
@echo -e lists: $(foreach var, $(lists), "\\n - \\e[1m$(var)\\e[m = $($(var))")
%.obj: %/makefile $(OUT)
cd $* && $(MAKE) obj
%.tool: %/makefile $(OUT)
cd $* && $(MAKE) tool
%.dbg: %/makefile $(OUT)
cd $* && $(MAKE) dbg
%.def: %/makefile $(TMP)/typesize.def \
$(TMP)/system_calls.h \
$(TMP)/system_calls.s \
$(TMP)/error_table.h \
$(OUT) $(OUT)/k
cd $* && $(MAKE) def
.PRECIOUS: $(TMP)/system_calls.%
$(TMP)/system_calls.%: arch/makefile
$(MAKE) -C arch $@
$(TMP)/error_table.h: arch/makefile
$(MAKE) -C arch $@
$(TMP)/typesize.def: arch/makefile $(TMP)
$(MAKE) -C arch $@
$(OUT)/libk.so: $(fnobjects)
ld -shared $(COMPLIB) -o $@ $^
@# $(CC) -shared -fPIC -nostdlib $(COMPLIB) -o $@ $(OUT)/*.o
|