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