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