Differences From
Artifact [216e76c37d]:
6 6 export TMP = $(PWD)/tmp
7 7
8 8 export TARGET = $(ARCH).$(OS).$(BITS)
9 9
10 10 moddirs = $(wildcard k*)
11 11 binaries = $(wildcard */exe.*.c)
12 12 binmods = $(sort $(dir $(binaries)))
13 +
14 +header-dir = /usr/include
15 +lib-dir = /usr/lib
13 16
14 17 posix-oses = lin fbsd dar and hai mgw
15 18
16 19 ifeq ($(findstring $(OS),$(posix-oses)),$(OS))
17 20 export POSIX = yes
18 21 else
19 22 export POSIX = no
................................................................................
28 31 lib.static: defs obj $(OUT)/libk.a
29 32 lib.shared: defs obj $(OUT)/libk.so
30 33 obj: $(moddirs:%=%.obj)
31 34 defs: $(moddirs:%=%.def)
32 35 tool: $(OUT)/libk.a $(binmods:%=%.tool)
33 36 clean:
34 37 rm -rf $(TMP) $(OUT)
38 +
39 +install: all
40 + install -d $(header-dir)/k -o root -g wheel
41 + install $(OUT)/k/* $(header-dir)/k/ -o root -g wheel -m 0644
42 + install -d $(lib-dir)/k -o root -g wheel
43 + install $(OUT)/libk.a $(OUT)/libk.so $(OUT)/boot.o \
44 + $(lib-dir)/k/ -o root -g wheel -m 0644
45 +
46 +uninstall: $(header-dir)/k $(lib-dir)/k
47 + rm -rf $^
35 48
36 49 lists = moddirs objects binaries binmods POSIX
37 50 dbg:
38 51 @echo -e lists: $(foreach var, $(lists), "\\n - \\e[1m$(var)\\e[m = $($(var))")
39 52
40 53 %.obj: %/makefile ${TARGET}.calls $(OUT)
41 54 cd $* && $(MAKE) obj