forked from jcbf/smf-spf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (44 loc) · 1.21 KB
/
Makefile
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
CC = gcc
PREFIX = /usr/local
SBINDIR = $(PREFIX)/sbin
DATADIR = /var/run/smfs
CONFDIR = /etc/mail/smfs
USER = smfs
GROUP = smfs
CFLAGS = -O2 -D_REENTRANT -fomit-frame-pointer -I/usr/local/include
# Linux
LDFLAGS = -lmilter -lpthread -L/usr/lib/libmilter -L/usr/local/lib -lspf2
# FreeBSD
#LDFLAGS = -lmilter -pthread -L/usr/local/lib -lspf2
# Solaris
#LDFLAGS = -lmilter -lpthread -lsocket -lnsl -lresolv -lspf2
# Sendmail v8.11
#LDFLAGS += -lsmutil
all: smf-spf
smf-spf: smf-spf.o
$(CC) -o smf-spf smf-spf.o $(LDFLAGS)
strip smf-spf
smf-spf.o: smf-spf.c
$(CC) $(CFLAGS) -c smf-spf.c
coverage:
$(CC) $(CFLAGS) -c smf-spf.c -coverage
$(CC) -o smf-spf smf-spf.o $(LDFLAGS) -lgcov
strip smf-spf
clean:
rm -f smf-spf.o smf-spf smf.spf.gcno sample coverage.info smf-spf.gcno
install:
@./install.sh
@cp -f -p smf-spf $(SBINDIR)
@if test ! -d $(DATADIR); then \
mkdir -m 700 $(DATADIR); \
chown $(USER):$(GROUP) $(DATADIR); \
fi
@if test ! -d $(CONFDIR); then \
mkdir -m 755 $(CONFDIR); \
fi
@if test ! -f $(CONFDIR)/smf-spf.conf; then \
cp -p smf-spf.conf $(CONFDIR)/smf-spf.conf; \
else \
cp -p smf-spf.conf $(CONFDIR)/smf-spf.conf.new; \
fi
@echo Please, inspect and edit the $(CONFDIR)/smf-spf.conf file.