summaryrefslogtreecommitdiff
path: root/contrib/mm/Makefile.sub
blob: 88446b957e4acb15d962ba6c17a53a45f32b306a (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
# Copyright 1991, 1992, 1993, 1999, 2000, 2001, 2006, 2007
# 
# This file 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 file COPYING.  If not, write to the Free Software
# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
#
# Makefile.sub
#
#
PROG=mmroff
MAN1=\
  mmroff.n
MAN7=\
  groff_mm.n \
  groff_mmse.n
FILES=0.MT 5.MT 4.MT ms.cov se_ms.cov 
# Local configuration files with default values.
LOCALE=locale se_locale
CLEANADD=temp

all: mmroff

install_bin: install_mmroff

install_data: install_m
	-test -d $(DESTDIR)$(tmacdir)/mm \
	  || $(mkinstalldirs) $(DESTDIR)$(tmacdir)/mm
	-for f in $(FILES); do \
		rm -f $(DESTDIR)$(tmacdir)/mm/$$f; \
		$(INSTALL_DATA) $(srcdir)/mm/$$f $(DESTDIR)$(tmacdir)/mm/$$f; \
	done
	-for f in $(LOCALE); do \
		test -f $(DESTDIR)$(tmacdir)/mm/$$f \
		  || touch $(DESTDIR)$(tmacdir)/mm/$$f; \
	done

install_m:
	-test -d $(DESTDIR)$(tmacdir) \
	  || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
	-rm -f $(DESTDIR)$(tmacdir)/tmac.$(tmac_m_prefix)m
	-rm -f $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
	$(INSTALL_DATA) $(srcdir)/m.tmac \
	  $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
	@sed -e "s;^.mso m.tmac;.mso $(tmac_m_prefix)m.tmac;g" \
	  $(srcdir)/mse.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mse.tmac
	@sed -e "s;^.mso mse.tmac;.mso $(tmac_m_prefix)mse.tmac;g" \
	  $(srcdir)/mmse.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mmse.tmac
	@sed -e "s;^.mso m.tmac;.mso $(tmac_m_prefix)m.tmac;g" \
	  $(srcdir)/mm.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mm.tmac

install_mmroff: mmroff
	-test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
	-rm -f $(DESTDIR)$(bindir)/mmroff
	$(INSTALL_SCRIPT) mmroff $(DESTDIR)$(bindir)/mmroff

mmroff: mmroff.pl
	-rm -f $@
	-sed -e 's;/usr/bin/perl;$(PERLPATH);' $(srcdir)/mmroff.pl >$@
	-chmod +x $@

uninstall_sub:
	-for f in $(FILES); do \
		rm -f $(DESTDIR)$(tmacdir)/mm/$$f; \
	done
	-for f in $(LOCALE); do \
		test -s $(DESTDIR)$(tmacdir)/mm/$$f \
		  || rm -f $(DESTDIR)$(tmacdir)/mm/$$f; \
	done
	-rm -f $(DESTDIR)$(tmacdir)/tmac.$(tmac_m_prefix)m
	-rm -f $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
	-rm -f $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mm.tmac
	-rm -f $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mse.tmac
	-rm -f $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mmse.tmac
	-rmdir $(DESTDIR)$(tmacdir)/mm
	-rm -f $(DESTDIR)$(bindir)/mmroff