-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (41 loc) · 1.57 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
BIN := varnam-ibus-engine
INSTALL_PREFIX := /usr/local
VERSION := $(shell echo $$(git describe --abbrev=0 --tags || echo "latest") | sed s/v//)
RELEASE_NAME := varnam-ibus-engine-${VERSION}-${shell uname -m}
IBUS_COMPONENT_INSTALL_LOC := "/usr/share/ibus/component"
install-script:
cp install.sh.in install.sh
sed -i "s#@INSTALL_PREFIX@#${INSTALL_PREFIX}#g" install.sh
sed -i "s#@IBUS_COMPONENT_INSTALL_LOC@#${IBUS_COMPONENT_INSTALL_LOC}#g" install.sh
chmod +x install.sh
install:
./install.sh
ibus-xml: SHELL := /bin/bash
ibus-xml:
$(shell mkdir component)
./${BIN} -s ml-inscript -lang ml -xml component/varnam-ml-inscript.xml -prefix ${INSTALL_PREFIX}
$(shell SCHEMES=("ml" "ta" "hi" "te" "kn" "bn" "ne"); for s in $${SCHEMES[@]}; do echo $s; ./${BIN} -s $$s -lang $$s -xml component/varnam-$$s.xml -prefix ${INSTALL_PREFIX}; done)
ubuntu-14:
CGO_CFLAGS="-w" go build -tags "pango_1_36,gtk_3_10,glib_2_40,cairo_1_13,gdk_pixbuf_2_30" -ldflags "-s -w" -o ${BIN} .
$(MAKE) ibus-xml
$(MAKE) install-script
# Won't work
ubuntu-18:
go build -tags "pango_1_42,gtk_3_22,glib_2_66,cairo_1_15" -ldflags "-s -w" -o ${BIN} .
$(MAKE) ibus-xml
$(MAKE) install-script
# Won't work
ubuntu-20:
go build -ldflags "-s -w" -o ${BIN} .
$(MAKE) ibus-xml
$(MAKE) install-script
release:
mkdir -p ${RELEASE_NAME} ${RELEASE_NAME}/icons ${RELEASE_NAME}/component
cp ${BIN} ${RELEASE_NAME}/
cp install.sh ${RELEASE_NAME}/
cp icons/*.png ${RELEASE_NAME}/icons/
cp component/*.xml ${RELEASE_NAME}/component
zip -r ${RELEASE_NAME}.zip ${RELEASE_NAME}/*
clean:
rm "component/*.xml"
rmdir component