1 # Automake rules for 'chem'
3 # File position: <groff-source>/contrib/chem/chem.am
5 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
6 # Written by Bernd Warken <groff-bernd.warken-72@web.de>.
7 # Moved to automake by Bertrand Garrigues
9 # Last update: 22 Aug 2015
11 # This file is part of 'chem' which is part of 'groff'.
13 # 'groff' is free software; you can redistribute it and/or modify it
14 # under the terms of the GNU General Public License (GPL) version 2 as
15 # published by the Free Software Foundation.
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.
22 # The GPL2 license text is available in the internet at
23 # <http://www.gnu.org/licenses/gpl-2.0.html>.
25 ########################################################################
27 chem_srcdir = $(top_srcdir)/contrib/chem
28 prefixexecbin_SCRIPTS += chem
30 # Files installed in $(datasubdir)/pic
31 chempicdir = $(datasubdir)/pic
32 dist_chempic_DATA = contrib/chem/chem.pic
35 CHEM_GENEXAMPLES = contrib/chem/examples/README
37 contrib/chem/examples/atp.chem \
38 contrib/chem/examples/cholesterin.chem \
39 contrib/chem/examples/ethamivan.chem \
40 contrib/chem/examples/lsd.chem \
41 contrib/chem/examples/morphine.chem \
42 contrib/chem/examples/penicillin.chem \
43 contrib/chem/examples/reserpine.chem
46 # Files installed in $(exampledir)/chem
47 chemexampledir = $(exampledir)/chem
48 nodist_chemexample_DATA = $(CHEM_GENEXAMPLES)
49 dist_chemexample_DATA = $(CHEM_EXAMPLES)
51 # Files installed in $(exampledir)/chem/122. All the .chem files in 122 are
52 # lazily installed by the local install target
53 chemexample122dir = $(chemexampledir)/122
54 nodist_chemexample122_DATA = contrib/chem/examples/122/README
57 contrib/chem/ChangeLog \
58 contrib/chem/chem.1.man \
59 contrib/chem/chem.pic \
60 contrib/chem/chem.pl \
61 contrib/chem/README.txt \
62 contrib/chem/examples/README.txt \
63 contrib/chem/examples/122/README.txt
65 man1_MANS += contrib/chem/chem.1
66 MOSTLYCLEANFILES += $(CHEM_GENEXAMPLES) $(nodist_chemexample122_DATA) \
69 # This is strangly built but not installed
70 all: contrib/chem/README
72 contrib/chem/README: $(chem_srcdir)/README.txt
73 $(AM_V_GEN)$(MKDIR_P) contrib/chem/ \
74 && sed -e "s|[@]g[@]|$(g)|g" $? >$@
76 contrib/chem/examples/README: $(chem_srcdir)/examples/README.txt
77 $(AM_V_GEN)$(MKDIR_P) contrib/chem/examples \
78 && sed -e "s|[@]g[@]|$(g)|g" $? >$@
80 contrib/chem/examples/122/README: $(chem_srcdir)/examples/122/README.txt
81 $(AM_V_GEN)$(MKDIR_P) contrib/chem/examples/122 \
82 && sed -e "s|[@]g[@]|$(g)|g" $? >$@
84 chem: $(chem_srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
86 && sed -f "$(SH_DEPS_SED_SCRIPT)" \
87 -e "s|[@]g[@]|$(g)|g" \
88 -e "s|[@]BINDIR[@]|$(DESTDIR)$(bindir)|g" \
89 -e "s|[@]MACRODIR[@]|$(DESTDIR)$(tmacdir)|g" \
90 -e "s|[@]PICDIR[@]|$(DESTDIR)$(datasubdir)/pic|g" \
91 -e "s|[@]VERSION[@]|$(VERSION)|g" \
92 -e "$(SH_SCRIPT_SED_CMD)" \
93 $(chem_srcdir)/chem.pl \
97 install-data-local: install_chem_extra
100 -test -d $(DESTDIR)$(chemexample122dir) \
101 || $(mkinstalldirs) $(DESTDIR)$(chemexample122dir);
102 for i in $(chem_srcdir)/examples/122/*.chem; do \
103 n=`echo $$i | sed 's|$(chem_srcdir)/examples/122/||g'`; \
104 $(INSTALL_DATA) $$i $(DESTDIR)$(chemexample122dir)/$$n; \
108 uninstall-local: uninstall_chem_extra
109 uninstall_chem_extra:
111 $(RM) $(DESTDIR)$(exampledir)/chem/122/*
112 -rmdir $(DESTDIR)$(exampledir)/chem/122
113 $(RM) $(DESTDIR)$(exampledir)/chem/*
114 -rmdir $(DESTDIR)$(exampledir)/chem
116 -rmdir $(DESTDIR)$(datasubdir)/pic
120 chmod u+w $(distdir)/contrib/chem/examples/122
121 for i in $(chem_srcdir)/examples/122/*.chem; do \
122 cp -f $$i $(distdir)/contrib/chem/examples/122; \
126 ########################################################################
128 ########################################################################
131 # mode: makefile-automake
134 # vim: set filetype=automake textwidth=72: