-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile.include
44 lines (34 loc) · 1.36 KB
/
Makefile.include
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
s2q=$(subst \ ,?,$1)
q2s=$(subst ?,\ ,$1)
# use this when result will be quoted
unesc2=$(subst ?, ,$1)
# install assembly
pkglib_SCRIPTS = $(ASSEMBLY) $(ASSEMBLY).mdb
# install .pc files
linuxpkgconfigdir = @libdir@/pkgconfig
linuxpkgconfig_DATA = $(LINUX_PKGCONFIG)
# install bin wrapper
bin_SCRIPTS = $(BINARIES)
build_sources = $(FILES) $(GENERATED_FILES)
build_resources_embed = $(foreach res,$(RESOURCES), $(addprefix -resource:,$(res)))
build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))))
build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref)))
build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref)))
CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb $(PROGRAMFILES) $(LINUX_PKGCONFIG)
DISTCLEANFILES = $(GENERATED_FILES)
# macros
# $(call emit-deploy-target,deploy-variable-name)
define emit-deploy-target
$($1): $($1_SOURCE)
mkdir -p '$$(shell dirname '$$@')'
cp '$$<' '$$@'
endef
# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x)
# assumes that for a wrapper foo.pc its source template is foo.pc.in
# if $3 is non-empty then wrapper is marked exec
define emit-deploy-wrapper
$($1): $2
mkdir -p '$$(shell dirname '$$@')'
cp '$$<' '$$@'
$(if $3,chmod +x '$$@')
endef