1# vim:set noet ts=4:
2#
3# ibus - The Input Bus
4#
5# Copyright (c) 2007-2016 Peng Huang <shawn.p.huang@gmail.com>
6# Copyright (c) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
7# Copyright (c) 2007-2019 Red Hat, Inc.
8#
9# This library is free software; you can redistribute it and/or
10# modify it under the terms of the GNU Lesser General Public
11# License as published by the Free Software Foundation; either
12# version 2.1 of the License, or (at your option) any later version.
13#
14# This library is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17# Lesser General Public License for more details.
18#
19# You should have received a copy of the GNU Lesser General Public
20# License along with this library; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
22# USA
23
24NULL =
25
26if ENABLE_UI
27UI_DIR = ui
28endif
29
30if ENABLE_ENGINE
31ENGINE_DIR = engine
32endif
33
34if ENABLE_SETUP
35SETUP_DIR = setup
36endif
37
38if ENABLE_PYTHON_LIBRARY
39PYTHON_LIB_DIRS = ibus
40endif
41
42if ENABLE_DAEMON
43DAEMON_DIR = \
44	bus \
45	$(NULL)
46endif
47
48SUBDIRS = \
49	src \
50	bindings \
51	util \
52	conf \
53	client \
54	portal \
55	data \
56	m4 \
57	po \
58	docs \
59	$(ENGINE_DIR) \
60	$(UI_DIR) \
61	tools \
62	$(DAEMON_DIR) \
63	$(PYTHON_LIB_DIRS) \
64	$(SETUP_DIR) \
65	$(NULL)
66
67ACLOCAL_AMFLAGS = -I m4
68
69pkgconfigdir = $(prefix)/libdata/pkgconfig
70pkgconfig_DATA = ibus-@IBUS_API_VERSION@.pc
71
72ibus_pc_in = ibus-@IBUS_API_VERSION@.pc.in
73EXTRA_DIST = \
74	COPYING.unicode \
75	autogen.sh \
76	$(ibus_pc_in) \
77	ibus.spec.in \
78	python-config.py \
79	xinput-ibus \
80	$(NULL)
81
82noinst_DIST = \
83	$(NULL)
84
85DISTCLEANFILES = \
86	po/stamp-it \
87	$(NULL)
88
89install-data-hook:
90	$(MKDIR_P) $(DESTDIR)${pkgdatadir}/engine
91
92DISTCHECK_CONFIGURE_FLAGS = \
93	--enable-gtk-doc \
94	--disable-schemas-install \
95	--enable-memconf \
96	$(NULL)
97
98dist-hook:
99	if test -d .git ; then \
100		git log --name-status --date=iso > $(distdir)/ChangeLog ; \
101		IBUS_PREV_MICRO_VERSION=`expr $(IBUS_MICRO_VERSION) - 1`; \
102		IBUS_PREV_VERSION=\
103"$(IBUS_MAJOR_VERSION).$(IBUS_MINOR_VERSION).$$IBUS_PREV_MICRO_VERSION"; \
104		echo "Changes in IBus $(IBUS_VERSION)" > $(distdir)/NEWS; \
105		echo "" >> $(distdir)/NEWS; \
106		git shortlog $$IBUS_PREV_VERSION...$(IBUS_VERSION) \
107		        >> $(distdir)/NEWS; \
108		echo "" >> $(distdir)/NEWS; \
109		git log $$IBUS_PREV_VERSION...$(IBUS_VERSION) --reverse \
110		        --pretty=format:'%s (%an) %h' >> $(distdir)/NEWS; \
111	fi
112
113distclean-local:
114	if test "x$(srcdir)" = "x."; then :; else \
115		rm -f ChangeLog; \
116		rm -f NEWS; \
117	fi
118
119MAINTAINERCLEANFILES = \
120	$(srcdir)/ChangeLog \
121	$(NULL)
122
123rpm: dist @PACKAGE_NAME@.spec
124	rpmbuild -bb \
125			--define "_sourcedir `pwd`" \
126			--define "_builddir `pwd`/rpm" \
127			--define "_srcrpmdir `pwd`/rpm" \
128			--define "_rpmdir `pwd`"/rpm \
129			--define "_specdir `pwd`/rpm" \
130			@PACKAGE_NAME@.spec
131
132srpm: dist @PACKAGE_NAME@.spec
133	rpmbuild -bs \
134			--define "_sourcedir `pwd`" \
135			--define "_builddir `pwd`/rpm" \
136			--define "_srcrpmdir `pwd`/rpm" \
137			--define "_rpmdir `pwd`/rpm" \
138			--define "_specdir `pwd`/rpm" \
139			@PACKAGE_NAME@.spec
140
141clean-rpm:
142	$(RM) -r "`uname -i`"
143
144clean-local: clean-rpm
145
146git-tag:
147	git tag -s @PACKAGE_VERSION@
148
149git-clean-tree:
150	git clean -d -f -x
151
152GITIGNOREFILES = \
153	INSTALL \
154	aclocal.m4 \
155	compile \
156	config.guess \
157	config.h.in \
158	config.sub \
159	depcomp \
160	gtk-doc.make \
161	install-sh \
162	ltmain.sh \
163	missing \
164	mkinstalldirs \
165	py-compile \
166	stamp-h* \
167	$(NULL)
168
169-include $(top_srcdir)/git.mk
170