-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (59 loc) · 1.76 KB
/
Makefile
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
pkgname := ftn2xml
.SILENT:
.PHONY: all dist dist-clean install uninstall clean help update-version clear-version configure build
all: configure build
install:
cd build && \
meson install && \
:
uninstall:
sudo rm -f /usr/bin/ftn2{xml,html,fdx,pdf} ; \
sudo rm -rf /usr/share/ftn2xml ; \
sudo rm -rf /usr/share/doc/ftn2xml ; \
:
clean:
rm -rf build && \
:
help:
echo "Please provide a target:" ; \
echo " [default] - configure and build" ; \
echo " install - install to system" ; \
echo " uninstall - delete from system" ; \
echo " clean - delete build dir" ; \
:
update-version:
version=$(shell git describe --tags --abbrev=7 | sed -E 's/^[^0-9]*//;s/-([0-9]*-g.*)$$/.r\1/;s/-/./g') && \
meson rewrite kwargs set project / version $$version && \
echo "project version: $$version" && \
:
clear-version:
meson rewrite kwargs delete project / version - && \
:
configure:
meson setup build -Dcpp_std=c++17 && \
:
build:
export PKG_CONFIG_PATH="$(pkgconf_path)" && \
cd build && \
ninja && \
:
dist:
export version=$(shell git describe --tags --abbrev=7 | sed -E 's/^[^0-9]*//;s/-([0-9]*-g.*)$$/.r\1/;s/-/./g') && \
echo "... $${version} ..." && \
export pkgdir="$(pkgname)_$$version" && \
echo "... $${pkgdir} ..." && \
mkdir -p "$${pkgdir}" && \
cp --reflink=auto -r -t "$${pkgdir}/" -- data source config* *.md Makefile meson* && \
pushd "$${pkgdir}" && \
echo "rewrite version..." && \
meson rewrite kwargs set project / version $$version && \
echo "rewrite depends..." && \
meson rewrite kwargs delete dependency libpodofo version xxx && \
popd && \
echo "tar..." && \
tar -c -J --numeric-owner --owner=0 -f "$${pkgdir}.orig.tar.xz" "$${pkgdir}" && \
:
dist-clean:
rm -rf $(pkgname)_*/ && \
rm -f $(pkgname)_*.orig.tar.xz && \
: