-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.devel
80 lines (62 loc) · 1.65 KB
/
Makefile.devel
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
80
#
# We assume that devel-include=<dir> and devel-lib=<dir> is passed
# in command line, if not -- create default directory.
#
.PHONY: install-devel install-devel-headers
.PHONY: install-devel-libs install-devel-lds
devel-objs += std
devel-objs += shmem
devel-objs += fds
devel-lds += pack.lds.S
devel-dirs :=
devel-files :=
devel-default-includedir := devel/include
devel-default-libdir := devel/lib
#
# Prepare direcory structure for headers and libraries.
#
# Headers
ifeq ($(devel-include),)
devel-include := $(devel-default-includedir)
endif
devel-hdr-dir := $(devel-include)/compel
$(devel-hdr-dir):
$(E) " GEN " $@
$(Q) $(MKDIR) -p $(devel-hdr-dir)
@true
#
# Libraries
ifeq ($(devel-lib),)
devel-lib := $(devel-default-libdir)
endif
devel-lib-dir := $(devel-lib)/compel
$(devel-lib-dir):
$(E) " GEN " $@
$(Q) $(MKDIR) -p $(devel-lib-dir)
@true
#
# Copying of headers
install-devel-headers: $(devel-hdr-dir)
$(Q) $(MAKE) $(run) -f Makefile headers-dst-dir=$(devel-hdr-dir) install-headers
@true
#
# Libraries
install-devel-objs :=
define gen-plugin-lib-rule
$(1)/$(2).compel.o: plugins/$(2)/built-in.o
$$(E) " GEN " $$@
$(Q) $(CP) -u $$^ $$@
install-devel-objs += $(1)/$(2).compel.o
endef
$(foreach compel-obj, \
$(devel-objs), \
$(eval $(call gen-plugin-lib-rule,$(devel-lib-dir),$(compel-obj))))
install-devel-libs: $(devel-lib-dir) $(install-devel-objs)
@true
$(devel-lib-dir)/pack.lds.S: scripts/arch/$(ARCH)/pack.lds.S
$(E) " GEN " $@
$(Q) $(CP) -u $^ $@
install-devel-lds: $(devel-lib-dir)/pack.lds.S
@true
install-devel: plugins install-devel-headers install-devel-libs install-devel-lds
@true