libk  Check-in [2ed2a90fe5]

Overview
Comment:add {,un}install rule
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2ed2a90fe516f32b056ee5ae044ac8c0a4a964ed47c2feb108607883dd1ceeb8
User & Date: lexi on 2019-06-28 01:59:19
Other Links: manifest | tags
Context
2019-06-28
04:32
restructure file naming conventions and conclusively fix longstanding architectural build system problems with loads and loads of variables and a shit ton of function calls check-in: d27f92e3b7 user: lexi tags: trunk
01:59
add {,un}install rule check-in: 2ed2a90fe5 user: lexi tags: trunk
2019-06-27
22:14
fixes for shared building check-in: ec9b2b74b3 user: lexi tags: trunk
Changes

Modified makefile from [216e76c37d] to [6234448ba2].

6
7
8
9
10
11
12



13
14
15
16
17
18
19
..
28
29
30
31
32
33
34










35
36
37
38
39
40
41
export TMP = $(PWD)/tmp

export TARGET = $(ARCH).$(OS).$(BITS)

moddirs = $(wildcard k*)
binaries = $(wildcard */exe.*.c)
binmods = $(sort $(dir $(binaries)))




posix-oses = lin fbsd dar and hai mgw

ifeq ($(findstring $(OS),$(posix-oses)),$(OS))
export POSIX = yes
else
export POSIX = no
................................................................................
lib.static: defs obj $(OUT)/libk.a
lib.shared: defs obj $(OUT)/libk.so
obj: $(moddirs:%=%.obj)
defs: $(moddirs:%=%.def)
tool: $(OUT)/libk.a $(binmods:%=%.tool) 
clean:
	rm -rf $(TMP) $(OUT)











lists = moddirs objects binaries binmods POSIX
dbg:
	@echo -e lists: $(foreach var, $(lists), "\\n - \\e[1m$(var)\\e[m = $($(var))")

%.obj: %/makefile ${TARGET}.calls $(OUT)
	cd $* && $(MAKE) obj







>
>
>







 







>
>
>
>
>
>
>
>
>
>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export TMP = $(PWD)/tmp

export TARGET = $(ARCH).$(OS).$(BITS)

moddirs = $(wildcard k*)
binaries = $(wildcard */exe.*.c)
binmods = $(sort $(dir $(binaries)))

header-dir = /usr/include
lib-dir = /usr/lib

posix-oses = lin fbsd dar and hai mgw

ifeq ($(findstring $(OS),$(posix-oses)),$(OS))
export POSIX = yes
else
export POSIX = no
................................................................................
lib.static: defs obj $(OUT)/libk.a
lib.shared: defs obj $(OUT)/libk.so
obj: $(moddirs:%=%.obj)
defs: $(moddirs:%=%.def)
tool: $(OUT)/libk.a $(binmods:%=%.tool) 
clean:
	rm -rf $(TMP) $(OUT)

install: all
	install -d $(header-dir)/k -o root -g wheel
	install $(OUT)/k/* $(header-dir)/k/ -o root -g wheel -m 0644
	install -d $(lib-dir)/k -o root -g wheel
	install $(OUT)/libk.a $(OUT)/libk.so $(OUT)/boot.o \
		$(lib-dir)/k/ -o root -g wheel -m 0644

uninstall: $(header-dir)/k $(lib-dir)/k
	rm -rf $^

lists = moddirs objects binaries binmods POSIX
dbg:
	@echo -e lists: $(foreach var, $(lists), "\\n - \\e[1m$(var)\\e[m = $($(var))")

%.obj: %/makefile ${TARGET}.calls $(OUT)
	cd $* && $(MAKE) obj