forked from 0install/0install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.build
51 lines (39 loc) · 1.86 KB
/
Makefile.build
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
SRCDIR ?= NOTSET
DISTDIR ?= NOTSET
BUILDDIR ?= NOTSET
SCRIPTS = 0install-python-fallback 0alias
DOCS = README.md COPYING
MANPAGES = 0launch.1 0store-secure-add.1 0store.1 0desktop.1 0install.1
vpath %.po ${SRCDIR}
PYTHON=$(shell which python3 || which python2 || echo python)
MO = $(shell cd ${SRCDIR}; find share/locale -name '*.po' | sort | sed -e 's/\.po/\.mo/')
YOJSON = $(shell ocamlfind query yojson)
BINIOU = $(shell ocamlfind query biniou)
EASY_FORMAT = $(shell ocamlfind query easy-format)
JSON_LIBS = "${EASY_FORMAT}/easy_format.cmo" "${BINIOU}/bi_util.cmo" "${BINIOU}/bi_share.cmo" "${BINIOU}/bi_outbuf.cmo" "${YOJSON}/yojson.cmo"
XMLM = $(shell ocamlfind query xmlm)
all: translations
(cd "${SRCDIR}" && $(PYTHON) setup.py build --build-lib="${BUILDDIR}/build/lib" --build-base="${BUILDDIR}/build")
(cd "${SRCDIR}/ocaml" && $(PYTHON) build-in.py "${BUILDDIR}/ocaml")
(cd "${SRCDIR}" && cp README.md COPYING "${DISTDIR}/")
install -d "${DISTDIR}/files"
install -s ocaml/0install "${DISTDIR}/files/0install"
ln -f "${DISTDIR}/files/0install" "${DISTDIR}/files/0launch"
ln -f "${DISTDIR}/files/0install" "${DISTDIR}/files/0store"
ln -f "${DISTDIR}/files/0install" "${DISTDIR}/files/0store-secure-add"
ln -f "${DISTDIR}/files/0install" "${DISTDIR}/files/0desktop"
(cd "${SRCDIR}" && cp ${MANPAGES} ${SCRIPTS} setup.py "${DISTDIR}/files")
install "${SRCDIR}/install.sh.src" "${DISTDIR}/install.sh"
(cp -r build/lib/zeroinstall "${DISTDIR}/files/")
(cp -r share "${DISTDIR}/files/")
(cd "${SRCDIR}" && cp -r share/0install.net share/applications share/bash-completion share/fish share/icons share/zsh "${DISTDIR}/files/share/")
translations: $(MO)
install: install_system
install_home:
(cd "${DISTDIR}" && ./install.sh home)
install_system:
(cd "${DISTDIR}" && ./install.sh system)
%.mo: %.po
mkdir -p `dirname "$@"`
msgfmt -o "$@" "$<"
.PHONY: all install translations