File: Makefile

package info (click to toggle)
procmail-lib 1:1997.07.22-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 280 kB
  • ctags: 22
  • sloc: perl: 213; makefile: 126; sh: 6
file content (133 lines) | stat: -rw-r--r-- 4,176 bytes parent folder | download
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Makefile for procmail rc libraries
#
#    Copyright (C) 1995  Alan K. Stebbens <aks@sgi.com>
#
#    This program 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 of the License, or
#    (at your option) any later version.
#
#    This program 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 this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

#
# These are the defaults
ROOTDIR         =       $(LOCALROOT)
LIBDIR          =       $(LOCALLIB)

# Define these as the root and library path for local filesystems
LOCALROOT       =       /usr/local
LOCALLIB        =       ${ROOTDIR}/lib/procmail

# Set these variables to enable "install-ftp"
FTPHOST         =       root@anywhere
FTPHOME         =       /usr/home/ftp
FTPDESTDIR      =       /pub/mail/

# Set SHARFILES to the files to be included in the shar archive
SHARFILES =     README Makefile GNU-LICENSE procmail-lib.html \
               procmail-tutorial procmailrc-example \
               *.rc *.help *.info proclint Copyright

# Set to the default install behaviour: "install-local"
DEFAULT         = install-home install-local

SHARNAME        = procmail-lib


#
SHELL           = /bin/sh

default:
       @echo 'make install-home     Installs proclint to ~/bin'
       @echo 'make install-mail     Installs library recipes to ~/Mail'
       @echo 'make install-local    Installs library recipes to /usr/local'
       @echo 'make install-ftp      Installs library recipes to ftp server'
       @echo 'make check            Check for discrepancies'
       @echo 'make check-home       Check against ~/Mail'
       @echo 'make install          Install the default: $(DEFAULT)'

install: $(DEFAULT)

install-home:   $(HOME)/bin/proclint install-mail

$(HOME)/bin/proclint:   proclint
       @(set -x ; cp $? $@ ; chmod 755 $@ )

install-mail:
       ${MAKE} LIBDIR=$(HOME)/Mail install-lib

check-home check-mail:
       ${MAKE} LIBDIR=$(HOME)/Mail check

install-local:
       ${MAKE} ROOTDIR=$(LOCALROOT) install-lib

install-lib:
       @for lib in *.rc *.help *.info ; do \
           ${MAKE} SRC=$$lib DST=$(LIBDIR)/$$lib install-file ; \
       done

DST     =       .phony-dst
SRC     =       .phony-src

install-file:   $(DST)
$(DST):         $(SRC)
       @if [ -f $@ ]; then ( set -x ; mv $@ $@.old ) ; fi
       @(set -x ; cp $(SRC) $@ ; chmod 444 $@ )

check::
       @-for lib in *.rc *.help *.info ; do \
           inslib=$(LIBDIR)/$$lib ; \
           if [ -f $$inslib ]; then \
               (set -x ; diff -c $$inslib $$lib ) ; \
           else \
               echo $$lib not installed. ; \
           fi ; \
       done
       @-for inslib in $(LIBDIR)/*.rc ; do \
           lib=`basename $$inslib` ; \
           if [ ! -f $$lib ]; then \
               echo $$inslib has no source. ; \
           fi ; \
       done

uu::    $(SHARNAME).shar.gz.uu
$(SHARNAME).shar.gz.uu: $(SHARNAME).shar.gz
       uuencode $? < $? > $@

gzip::  $(SHARNAME).shar.gz
$(SHARNAME).shar.gz:    $(SHARNAME).shar
       gzip -f $?

pkzip:: $(SHARNAME).zip
$(SHARNAME).zip:        $(SHARFILES)
       cwd=`pwd` ; \
       cd ..; \
       dir=`basename $$cwd` ; \
       files=`echo "$(SHARFILES)" | \
              tr -s ' \10' '\12\12' | \
              sed -e "s=^=$$dir/=" | \
              tr '\12' ' ' ` ; \
       pkzip -9 $$dir/$@ $$files

shar::  $(SHARNAME).shar
$(SHARNAME).shar:       $(SHARFILES)
       cwd=`pwd` ; \
       cd ..; \
       dir=`basename $$cwd` ; \
       files=`echo "$(SHARFILES)" | \
              tr -s ' \10' '\12\12' | \
              sed -e "s=^=$$dir/=" | \
              tr '\12' ' ' ` ; \
       shar $$files > $$dir/$@

install-ftp: shar
       rcp $(SHARNAME).shar $(FTPHOST):$(FTPHOME)$(FTPDESTDIR)