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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
# $Id: Makefile,v 1.18 1999/12/02 03:53:45 chip Exp $
#
# Makefile for deliver
#
# +----------------+
# | Things to make |
# +----------------+
#
# deliver Compile and link the deliver program.
# header Compile and link the header program.
# install Install deliver and header. (You must be root.)
# lint Run lint on all sources, creating lint.out.
# clean Clean up.
# clobber Remove everything that can be regenerated.
# dist Create distribution proto-tarball.
#
# +---------------+
# | Configuration |
# +---------------+
#
# SHELL
# I don't have to tell you...
#
# COPY
# Your local copy program. Users of SCO UNIX or Xenix may want to
# change this to "copy -m" which preserves file modification time.
#
# CC
# Your favorite C compiler.
#
# DELHOME
# Base directory for Deliver installation, if any. A typical value
# is "/usr/deliver". If you define DELHOME, uncomment the definition
# of HDEFS that follows it.
#
# OSHEADER
# Name of OS configuration header file in "conf" directory.
#
# UDEFS
# User-added flags for cc and lint.
#
# * If your compiler is ANSI but doesn't define __STDC__,
# include "-DANSI_C".
#
# DEFS
# Flags for cc and lint.
#
# CFLAGS
# Compile-time flags for cc; should include DEFS.
#
# LDFLAGS
# Link-time flags for cc. The -i flag creates pure (sharable) code.
#
# LIBS
# Depending on your environment, you may or may not need to link
# with "-lx". SCO Xenix System V needs it; Altos Xenix doesn't.
#
# LINT
# Your favorite lint program, with flags.
#
# BIN
# Target directory for installation; /usr/bin is recommended.
# You may use /usr/local/bin (or whatever), but if you do,
# be sure that the directory you choose is in your SAFEPATH
# as defined in config.h.
#
# GROUP
# Name of group that should own the installed Deliver binary.
#
SHELL = /bin/sh
COPY = cp
CC = cc
#DELHOME = /usr/deliver
#HDEFS = -DDELHOME=\"$(DELHOME)\"
UDEFS = -DHAS_NFS
OSHEADER = os-linux.h
DEFS = -Iconf -DOSINCLUDE=\"$(OSHEADER)\" $(HDEFS) $(UDEFS)
CFLAGS = -g -O2 $(DEFS)
LDFLAGS =
LIBS =
LINT = lint -x
BIN = /usr/bin
#BIN = $(DELHOME)/bin
GROUP = root
####################################################
## YOU SHOULD NOT HAVE TO EDIT BELOW THIS POINT ##
####################################################
#
# The files that make up the deliver distribution.
#
DOCS = README INSTALL SENDMAIL MMDF deliver.8 header.1
MF = Makefile
ALLCONF = conf/*.h
DELHDR = config.h context.h deliver.h dest.h patchlevel.h misc.h
DELSRC = addr.c context.c copymsg.c debug.c dest.c dfile.c lock.c \
log.c main.c mbox.c procs.c subs.c sysdep.c uucp.c \
unctime.y unctime.c
UIDSRCS = uid.c
HDRSRCS = header.c
COMSRCS = getopt.c
SAMPLES = samples/README samples/[a-z]*
DIST = $(DOCS) $(MF) $(ALLCONF) $(DELHDR) $(DELSRC) \
$(UIDSRCS) $(HDRSRCS) $(COMSRCS) $(SAMPLES)
DELOBJS = addr.o context.o copymsg.o debug.o dest.o dfile.o lock.o \
log.o main.o mbox.o procs.o subs.o sysdep.o unctime.o uucp.o
UIDOBJS = uid.o
HDROBJS = header.o
COMOBJS = getopt.o
CONFIG = config.h conf/$(OSHEADER) conf/finish-os.h conf/local.h
#
# For GNU Make. Sorry about the ugliness.
#
.PHONY: all install lint clean clobber dist
#
# The default target.
#
all: deliver header uid
#
# "make clobber" implies "make clean".
#
clobber:: clean
#
# How to install deliver and associated utilities.
#
install: deliver header uid
@set X `./uid -uU | fgrep '(root)' | wc -l`; \
case "$$2" in \
2) ;; \
*) echo "Sorry! You must be root to install deliver."; exit 1 ;; \
esac
@h="$(DELHOME)"; \
case "$$h" in \
?*) for d in $$h $$h/bin $$h/lib $$h/log; \
do \
test -d $$d && continue; \
( set -x; \
mkdir $$d || exit 1; \
chgrp $(GROUP) $$d; \
chmod 755 $$d ) || exit 1; \
done ;; \
esac
rm -f $(BIN)/deliver.O
-mv $(BIN)/deliver $(BIN)/deliver.O
$(COPY) deliver $(BIN)/deliver
chgrp $(GROUP) $(BIN)/deliver
chown root $(BIN)/deliver
chmod 4755 $(BIN)/deliver
rm -f $(BIN)/header.O
-mv $(BIN)/header $(BIN)/header.O
$(COPY) header $(BIN)/header
chmod 755 $(BIN)/header
#
# How to compile and link the program.
#
deliver: $(DELOBJS) $(COMOBJS)
$(CC) $(LDFLAGS) -o $@ $(DELOBJS) $(COMOBJS) $(LIBS)
$(DELOBJS): $(CONFIG) $(DELHDRS)
unctime.o: unctime.c
clean::
rm -f $(DELOBJS) $(DELYC)
clobber::
rm -f deliver
#
# A header parsing program.
#
header: $(HDRSRCS) $(COMOBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(HDRSRCS) $(COMOBJS) $(LIBS)
rm -f $(HDROBJS)
clobber::
rm -f header
#
# A little program to check on user and group id's.
# (I wish that the System V "id" program were available everywhere.)
#
uid: $(CONFIG) $(UIDSRCS) $(COMOBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(UIDSRCS) $(COMOBJS) $(LIBS)
rm -f $(UIDOBJS)
clobber::
rm -f uid
#
# Common subroutines
#
$(COMOBJS): $(CONFIG)
clean::
rm -f $(COMOBJS)
#
# Look for fuzz.
#
lint: deliver.lint header.lint uid.lint
deliver.lint: $(CONFIG) $(DELHDRS) $(DELSRCC) $(COMSRCS)
$(LINT) $(DEFS) $(DELSRCC) $(COMSRCS) $(LIBS) >$@
header.lint: $(HDRSRCS) $(COMSRCS)
$(LINT) $(DEFS) $(HDRSRCS) $(COMSRCS) $(LIBS) >$@
uid.lint: $(CONFIG) $(UIDSRCS) $(COMSRCS)
$(LINT) $(DEFS) $(UIDSRCS) $(COMSRCS) $(LIBS) >$@
clean::
rm -f *.lint
#
# Make distribution tarball.
#
dist:
tar czf deliver.tar.gz $(DIST)
|