forked from 0install/0install
/
Makefile.build
52 lines (42 loc) · 1.97 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
52
SRCDIR ?= NOTSET
DISTDIR ?= NOTSET
BUILDDIR ?= NOTSET
DOCS = README.md COPYING
MANPAGES = 0launch.1 0store-secure-add.1 0store.1 0desktop.1 0install.1
vpath %.po ${SRCDIR}
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)
OS = $(shell uname -s)
MACHINE = $(shell uname -m)
VERSION = $(shell sed -n 's/let version = "\(.*\)"/\1/p' ${SRCDIR}/ocaml/zeroinstall/about.ml)
all:
(cd "${SRCDIR}/ocaml" && ocaml build-in.ml "${BUILDDIR}/ocaml" "${MAKE}")
(cd "${SRCDIR}" && cp README.md COPYING "${DISTDIR}/")
install -d "${DISTDIR}/files"
install -d "${DISTDIR}/files/share"
-install ocaml/gui_gtk.c*[sa] "${DISTDIR}/files/"
install 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"
ln -f "${DISTDIR}/files/0install" "${DISTDIR}/files/0alias"
(cd "${SRCDIR}" && cp ${MANPAGES} "${DISTDIR}/files")
install "${SRCDIR}/install.sh.src" "${DISTDIR}/install.sh"
(cd "${SRCDIR}" && cp -r share/0install.net share/applications share/appdata share/bash-completion share/fish share/icons share/zsh "${DISTDIR}/files/share/")
install -d "${DISTDIR}/0install"
[ -f "${DISTDIR}/0install/build-environment.xml" ] || sed 's/@ARCH@/${OS}-${MACHINE}/;s/@VERSION@/${VERSION}/' "${SRCDIR}/binary-feed.xml.in" > "${DISTDIR}/0install/feed.xml"
install: install_local
install_home:
(cd "${DISTDIR}" && ./install.sh home)
install_system:
(cd "${DISTDIR}" && ./install.sh system)
install_local:
(cd "${DISTDIR}" && ./install.sh local)
%.mo: %.po
mkdir -p `dirname "$@"`
msgfmt -o "$@" "$<"
.PHONY: all install