1################################################################
2###
3###			       Makefile
4###
5### Author:  Internet Message Group <img@mew.org>
6### Created: Apr 23, 1997
7### Revised: Mar 22, 2003
8###
9
10SHELL=	/bin/sh
11
12INSTALL=@INSTALL@
13INSTALL_PROGRAM = @INSTALL_PROGRAM@
14INSTALL_DATA = @INSTALL_DATA@
15
16chmod=	@im_path_chmod@
17mkdir=	@im_path_mkdir@
18rm=	@im_path_rm@
19mv=	@im_path_mv@
20sed=	@im_path_sed@
21
22prefix=	@prefix@
23exec_prefix=@exec_prefix@
24
25# --bindir
26bindir=@bindir@
27# --sysconfdir
28sysconfdir=@sysconfdir@
29# --with-perldir
30perldir=@im_path_siteperl@
31
32# If you modify imsysconfdir, you should also modify IM/Config.
33imsysconfdir= $(sysconfdir)/im
34moddir=	  $(perldir)/IM
35
36RPOP=	@im_rpop@
37
38PROG =	imali imcat imcd imclean \
39	imgrep imhist imhsync imjoin imls \
40	immknmz immv impack impath imput \
41	impwagent imrm imsetup imsort imstore imtar
42
43ALLPROG = $(PROG) imget
44
45CNF = config.h config.status config.cache config.log configure.lineno
46
47all:
48	@echo everything has been done by configure.
49	@echo you only need to do "make install".
50
51install:: installbin installdata
52
53installbin::
54	-if test ! -d $(DESTDIR)$(bindir); then \
55		$(mkdir) -p $(DESTDIR)$(bindir) && $(chmod) 755 $(DESTDIR)$(bindir); \
56	fi
57	for f in $(PROG); do \
58		$(sed) -e '/###DELETE-ON-INSTALL###/d' $${f} > $${f}.tmp ; \
59		$(INSTALL) -m 755 $${f}.tmp $(DESTDIR)$(bindir)/$${f} ; \
60		$(rm) -f $${f}.tmp ; \
61	done
62	$(sed) -e '/###DELETE-ON-INSTALL###/d' imget > imget.tmp
63	$(INSTALL) $(RPOP) imget.tmp $(DESTDIR)$(bindir)/imget
64	$(rm) -f imget.tmp
65
66installdata::
67	-if test ! -d $(DESTDIR)$(moddir); then \
68		$(mkdir) -p $(DESTDIR)$(moddir); \
69	fi
70	$(chmod) 755 $(DESTDIR)$(moddir)
71	for f in IM/*.pm; do \
72		$(INSTALL_DATA) $${f} $(DESTDIR)$(moddir) ; \
73	done
74	-if test ! -d $(DESTDIR)$(imsysconfdir); then \
75		$(mkdir) -p $(DESTDIR)$(imsysconfdir); \
76	fi
77	$(chmod) 755 $(DESTDIR)$(imsysconfdir)
78	for cnf_im in SiteConfig.sample ; do \
79		if test ! -f $(DESTDIR)$(imsysconfdir)/$$cnf_im; then \
80			$(INSTALL_DATA) cnf.im/$$cnf_im $(DESTDIR)$(imsysconfdir); \
81		else \
82			$(INSTALL_DATA) cnf.im/$$cnf_im $(DESTDIR)$(imsysconfdir)/$$cnf_im.new; \
83		fi ;\
84	done
85
86clean::
87	$(rm) -f $(ALLPROG)
88	$(rm) -f cnf.im/SiteConfig
89	$(rm) -f IM/Config.pm
90
91distclean:: clean
92	$(rm) -f Makefile $(CNF)
93
94### Copyright (C) 1997, 1998, 1999 IM developing team
95### All rights reserved.
96###
97### Redistribution and use in source and binary forms, with or without
98### modification, are permitted provided that the following conditions
99### are met:
100###
101### 1. Redistributions of source code must retain the above copyright
102###    notice, this list of conditions and the following disclaimer.
103### 2. Redistributions in binary form must reproduce the above copyright
104###    notice, this list of conditions and the following disclaimer in the
105###    documentation and/or other materials provided with the distribution.
106### 3. Neither the name of the team nor the names of its contributors
107###    may be used to endorse or promote products derived from this software
108###    without specific prior written permission.
109###
110### THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
111### ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
112### IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
113### PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
114### LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
115### CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
116### SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
117### BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
118### WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
119### OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
120### IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
121