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