-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibs.mk
More file actions
53 lines (40 loc) · 1.44 KB
/
Libs.mk
File metadata and controls
53 lines (40 loc) · 1.44 KB
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
pugixml_ver := 1.11.4
json_ver := 3.10.5
expected_ver := 0.5.0
libdir := lib
dir_targets := $(addprefix $(libdir)/, pugixml json expected)
pugixml_build_files := $(addprefix $(libdir)/, pugixml/lib pugixml/include)
CMAKE := $(shell command -v cmake)
.PHONY: default
default: build
.PHONY: clone
clone: $(dir_targets)
.PHONY: build
build: clone $(pugixml_build_files)
.PHONY: clean
clean:
rm -rf $(libdir)
.INTERMEDIATE: build_pugixml_procedure
build_pugixml_procedure: $(libdir)/pugixml
installdir=$(shell pwd)/$< && \
cd $< && mkdir -p build && cd build && \
$(CMAKE) -DCMAKE_INSTALL_PREFIX=$$installdir -DCMAKE_INSTALL_LIBDIR=lib \
-Wdev -Wdeprecated ..
$(MAKE) -C $</build install
$(libdir):
@mkdir -p $@
$(libdir)/pugixml: | $(libdir)
cd $(libdir) && \
wget https://github.com/zeux/pugixml/releases/download/v$(pugixml_ver)/pugixml-$(pugixml_ver).tar.gz && \
tar xf pugixml-$(pugixml_ver).tar.gz --one-top-level=$(@F) --strip-components=1 && \
rm -f pugixml-$(pugixml_ver).tar.gz
$(pugixml_build_files): build_pugixml_procedure
$(libdir)/json: | $(libdir)
cd $(libdir) && \
wget https://github.com/nlohmann/json/releases/download/v$(json_ver)/include.zip && \
unzip -q include.zip -d json && \
rm -f include.zip
$(libdir)/expected: | $(libdir)
@mkdir -p $(libdir)/expected/include/nonstd
wget -P $(libdir)/expected/include/nonstd \
https://github.com/martinmoene/expected-lite/releases/download/v$(expected_ver)/expected.hpp