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
|
# @(#)Makefile 1.12 02/03/11 falk
# $Id: Makefile,v 1.9 2003/12/22 06:03:14 efalk Exp $
# define NOSTRDUP if your system doesn't have strdup(3)
# define NOREGCOMP if your system doesn't have regcomp(3)
#
# Note: GNU regex is provided for systems that don't have the regex(3)
# interface. If you don't have regex(3), set REGEX = regex.c below
#DBG = -g -DDEBUG -Wall
DBG = -O
# SunOS 4.x
#CFLAGS = ${DBG} -DBSD -DSUNOS
#LDFLAGS = -n -Bdynamic -s
# Solaris
# CFLAGS = ${DBG} -DSOLARIS
# LDFLAGS = -lxnet -lresolv
# Linux
CFLAGS = ${DBG} -DLINUX -I/usr/include/gdbm
LDFLAGS = -lgdbm_compat
# Ultrix
#CFLAGS = ${DBG} -DULTRIX
#LDFLAGS =
#REGEX = regex.c
# HPUX 9.0
#CFLAGS = ${DBG} -DHPUX
#LDFLAGS = -n -s
#REGEX = regex.c
# ---------------------------------------------------------------------------
# Destination for make install:
#
# Note: version number in Makefile, INSTALL, sortmail.c, sortmail.lsm,
# sortmail.spec
VERSION = 2.4
prefix = /usr/local
bindir = $(prefix)/bin
docdir = $(prefix)/doc/sortmail-$(VERSION)
mandir = $(prefix)/man
man1dir = $(prefix)/man/man1
#CC = gcc
all: sortmail
SRCS = sortmail.c parse.c expr.c crctab.c pop2.c pop3.c imap.c \
md5c.c netutils.c utils.c locking.c $(REGEX)
HDRS = config.h crctab.h imap.h locking.h md5.h md5global.h netutils.h \
pop2.h pop3.h regex.h sortmail.h utils.h
OBJS = $(SRCS:.c=.o)
DOC = README sortmail.1 sample.forward sample.sortmailrc
$(OBJS): $(HDRS)
sortmail: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIB)
tags: $(HDRS) $(SRCS)
ctags *.[ch]
archive: Makefile $(HDRS) $(SRCS) $(DOC)
shar $(DOC) Makefile $(HDRS) $(SRCS) > archive
clean:
rm -f *.o *.i archive foo bar core tags
clobber: clean
rm -f sortmail
sortmail.o: sortmail.h config.h pop2.h pop3.h locking.h utils.h crctab.h
parse.o: sortmail.h config.h utils.h
expr.o: sortmail.h config.h utils.h
pop2.o: sortmail.h config.h netutils.h pop2.h utils.h
pop3.o: sortmail.h config.h netutils.h pop3.h utils.h md5global.h md5.h
netutils.o: sortmail.h config.h netutils.h
utils.o: sortmail.h config.h utils.h
locking.o: sortmail.h config.h locking.h
md5c.o: md5global.h md5.h
DESTDIRS = $(bindir) $(man1dir) $(docdir)
DOCFILES = LICENSE README sample.forward sample.sortmailrc sortmail.lsm \
sortmailrc.pop sortmailrc.sample sortmailrc.spam
# Install sortmail
install: sortmail $(DESTDIRS)
install -s sortmail $(bindir)
install -m 0444 sortmail.1 $(man1dir)
install -m 0444 $(DOCFILES) $(docdir)
$(DESTDIRS):
mkdir -p $@
# Build distribution tarfile.
DIST_NAME = sortmail-$(VERSION)
DIST_DIR = /tmp/$(DIST_NAME)
DIST_FILES = $(SRCS) $(HDRS) Makefile sortmail.lsm sortmail.1 \
$(DOCFILES) sortmail.spec
dist: clobber $(DIST_FILES)
rm -rf $(DIST_DIR)
mkdir $(DIST_DIR)
cp -pr $(DIST_FILES) $(DIST_DIR)
chmod -R a+r $(DIST_DIR)
chmod -R u+w $(DIST_DIR)
chmod -R go-w $(DIST_DIR)
cd $(DIST_DIR)/.. ; tar cvf $(DIST_NAME).tar $(DIST_NAME)
mv $(DIST_DIR).tar .
gzip $(DIST_NAME).tar
rm -rf $(DIST_DIR)
depend:
makedepend -- $(CFLAGS) -- $(SRCS)
|