Imported Upstream version 1.22.3
[platform/upstream/groff.git] / src / roff / groff / Makefile.sub
1 # Makefile.sub for `src roff groff'
2
3 # File position: <groff-source>/src/roff/groff/Makefile.sub
4
5 # Copyright (C) 1993-2014  Free Software Foundation, Inc.
6
7 #   Rewritten by Bernd Warken <groff-bernd.warken-72@web.de> and
8 #   Werner LEMBERG  <wl@gnu.org>
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 3 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 <http://www.gnu.org/licenses/>.
22
23 ########################################################################
24
25 PROG=groff$(EXEEXT)
26 MAN1=groff.n
27 XLIBS=$(LIBGROFF) $(LIBGNU)
28 MLIB=$(LIBM)
29 OBJS=groff.$(OBJEXT) pipeline.$(OBJEXT)
30 CCSRCS=$(srcdir)/groff.cpp
31 CSRCS=$(srcdir)/pipeline.c
32 HDRS=$(srcdir)/pipeline.h
33
34 GROFF_OPTS_OUTPUT=\
35   groff_opts_no_arg.txt \
36   groff_opts_with_arg.txt
37
38 MOSTLYCLEANADD=groff_opts.tmp $(GROFF_OPTS_OUTPUT)
39
40 RM=rm -f
41
42 all: $(srcdir)/groff.cpp groff_opts.tmp $(GROFF_OPTS_OUTPUT)
43
44 groff_opts.tmp: $(srcdir)/groff.cpp
45         @$(GREP) -e ':.*:.*:' $? | sed -e 's/[ \t",]//g' > $@
46         @echo -n 'groff options: '
47         @cat $@
48
49 groff_opts_no_arg.txt: groff_opts.tmp
50         @sed -e 's/[a-zA-Z]://g' $? > $@
51         @echo -n 'no arg: '
52         @cat $@
53
54 groff_opts_with_arg.txt: groff_opts_no_arg.txt
55         @sed "s/[`cat $?`:]//g" groff_opts.tmp > $@
56         @echo -n 'with arg: '
57         @cat $@
58
59 install_data: $(GROFF_OPTS_OUTPUT)
60         -test -d $(DESTDIR)$(libprogramdir) \
61           || $(mkinstalldirs) $(DESTDIR)$(libprogramdir)
62         for f in  $(GROFF_OPTS_OUTPUT); do \
63           $(RM) $(DESTDIR)$(libprogramdir)/$$f; \
64           $(INSTALL_SCRIPT) $$f $(DESTDIR)$(libprogramdir); \
65         done
66
67 uninstall_sub:
68         -for f in $(GROFF_OPTS_OUTPUT); do \
69           $(RM) $(DESTDIR)$(libprogramdir)/$$f;\
70         done
71 # XXX This will be removed by `uninstall_dirs' in `$(top_srcdir)/Makefile.in'
72 # XXX (And only from there it is successful on an empty directory)
73 #       -d=$(DESTDIR)$(libprogramdir);\
74 #         if test -d $$d; then rmdir $$d; fi
75
76 ########################################################################
77 # Emacs settings
78 ########################################################################
79 #
80 # Local Variables:
81 # mode: makefile
82 # End: