Imported Upstream version 1.22.3
[platform/upstream/groff.git] / contrib / gpinyin / Makefile.sub
1 # Makefile.sub for `gpinyin' (preprocessor for added Perl parts)
2
3 # File position: <groff-source>/contrib/gpinyin/Makefile.sub
4
5 # Copyright (C) 2014  Free Software Foundation, Inc.
6 # Written by Bernd Warken <groff-bernd.warken-72@web.de>.
7
8 # This file is part of `gpinyin' which is part of `groff'.
9
10 # `groff' is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 2 of the License, or
13 # (at your option) any later version.
14
15 # `groff' is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # General Public License for more details.
19
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see
22 # <http://www.gnu.org/licenses/gpl-2.0.html>.
23
24 ########################################################################
25
26 MAN1=gpinyin.n
27
28 MOSTLYCLEANADD=gpinyin $(MAN1)
29
30 # not all make programs have $(RM) predefined.
31 RM=rm -f
32
33 all: gpinyin
34
35 gpinyin: gpinyin.pl
36         sed -f "$(SH_DEPS_SED_SCRIPT)" \
37             -e "s|@g@|$(g)|g" \
38             -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
39             -e "s|@gpinyin_dir@|$(DESTIR)$(gpinyin_dir)|" \
40             -e "s|@VERSION@|$(version)$(revision)|g" \
41             -e "$(SH_SCRIPT_SED_CMD)" \
42             $(srcdir)/gpinyin.pl >$@; \
43         chmod +x $@
44
45 .PHONY: install_data
46 install_data: gpinyin subs.pl
47         test -d $(DESTDIR)$(bindir) || \
48           $(mkinstalldirs) $(DESTDIR)$(bindir); \
49         $(RM) $(DESTDIR)$(bindir)/gpinyin; \
50         $(INSTALL_SCRIPT) gpinyin $(DESTDIR)$(bindir)/gpinyin; \
51         test -d $(DESTDIR)$(gpinyin_dir) || \
52           $(mkinstalldirs) $(DESTDIR)$(gpinyin_dir); \
53         $(RM) $(DESTDIR)$(gpinyin_dir)/subs.pl; \
54         $(INSTALL_SCRIPT) $(srcdir)/subs.pl \
55           $(DESTDIR)$(gpinyin_dir)/subs.pl
56
57 .PHONY: uninstall_sub
58 uninstall_sub:
59         $(RM) $(DESTDIR)$(bindir)/gpinyin; \
60         $(RM) $(DESTDIR)$(gpinyin_dir)/subs.pl;
61         -test -d $(DESTDIR)$(gpinyin_dir) && \
62           rmdir $(DESTDIR)$(gpinyin_dir)
63
64
65 ########################################################################
66 # Emacs settings
67 ########################################################################
68 #
69 # Local Variables:
70 # mode: makefile
71 # End: