Remove no longer needed catman periodic via 'make upgrade'.
[dragonfly.git] / contrib / groff / contrib / chem / Makefile.sub
1 # Makefile.sub for `chem' (integration into the `groff' source tree)
2
3 # File position: <groff-source>/contrib/chem/Makefile.sub
4
5 # Copyright (C) 2006, 2009 Free Software Foundation, Inc.
6 # Written by Bernd Warken.
7
8 # Last update: 5 Jan 2009
9
10 # This file is part of `chem' which is part of `groff'.
11
12 # `groff' is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
16
17 # `groff' is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 # General Public License for more details.
21
22 # You should have received a copy of the GNU General Public License
23 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24
25 ########################################################################
26
27 MAN1=chem.n
28 MOSTLYCLEANADD=chem chem.n README examples/README
29
30 # not all make programs have $(RM) predefined.
31 RM=rm -f
32
33 all: README examples/README chem $(MAN1)
34
35 README: $(srcdir)/README.txt
36         sed -e "s|@g@|$(g)|g" $? >$@
37
38 examples/README: $(srcdir)/examples/README.txt
39         -test -d examples || $(mkinstalldirs) examples
40         sed -e "s|@g@|$(g)|g" $? >$@
41
42 chem: $(srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
43         sed -f "$(SH_DEPS_SED_SCRIPT)" \
44           -e "s|@g@|$(g)|g" \
45           -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
46           -e "s|@MACRODIR@|$(DESTDIR)$(tmacdir)|g" \
47           -e "s|@PICDIR@|$(DESTDIR)$(datasubdir)/pic|g" \
48           -e "s|@VERSION@|$(version)$(revision)|g" \
49           -e "$(SH_SCRIPT_SED_CMD)" \
50           $(srcdir)/chem.pl >$@
51         chmod +x $@
52
53 install_data: chem \
54               README examples/README \
55               $(srcdir)/chem.pic \
56               $(srcdir)/examples/*.chem $(srcdir)/examples/122/*
57         -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
58         $(RM) $(DESTDIR)$(bindir)/$(g)chem
59         $(INSTALL_SCRIPT) chem $(DESTDIR)$(bindir)/$(g)chem
60         -test -d $(DESTDIR)$(datasubdir)/pic \
61           || $(mkinstalldirs) $(DESTDIR)$(datasubdir)/pic
62         $(RM) $(DESTDIR)$(datasubdir)/pic/chem.pic
63         $(INSTALL_DATA) $(srcdir)/chem.pic \
64           $(DESTDIR)$(datasubdir)/pic/chem.pic
65         -test -d $(DESTDIR)$(exampledir)/chem \
66           || $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem/122
67         -test -d $(DESTDIR)$(exampledir)/chem/122 \
68           || $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem/122
69         -$(RM) $(DESTDIR)$(exampledir)/chem/*
70         $(INSTALL_DATA) examples/README \
71           $(DESTDIR)$(exampledir)/chem/README
72         for i in $(srcdir)/examples/*.chem; do \
73           n=`echo $$i | sed 's|$(srcdir)/examples/||g'`; \
74           $(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/$$n; \
75         done
76         -$(RM) $(DESTDIR)$(exampledir)/chem/122/*
77         for i in $(srcdir)/examples/122/*; do \
78           n=`echo $$i | sed 's|$(srcdir)/examples/122/||g'`; \
79           $(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/122/$$n; \
80         done
81
82 uninstall_sub:
83         $(RM) $(DESTDIR)$(bindir)/chem
84         $(RM) $(DESTDIR)$(datasubdir)/pic/chem.pic
85         -rmdir $(DESTDIR)$(datasubdir)/pic
86         $(RM) $(DESTDIR)$(exampledir)/chem/122/*
87         -rmdir $(DESTDIR)$(exampledir)/chem/122
88         $(RM) $(DESTDIR)$(exampledir)/chem/*
89         -rmdir $(DESTDIR)$(exampledir)/chem
90         -rmdir $(DESTDIR)$(exampledir)
91
92 ########################################################################
93 # Emacs settings
94 ########################################################################
95 #
96 # Local Variables:
97 # mode: makefile
98 # End: