1 #@ Makefile for S-nail.
2 #@ See the file INSTALL if you need help.
9 SYSCONFDIR
= $(PREFIX
)/etc
11 # Prepended to all paths at installation time (for e.g. package building)
13 # (For those who want to install S-nail(1) as nail(1), use an empty *SID*)
17 SENDMAIL
= /usr
/sbin
/sendmail
20 INSTALL
= /usr
/bin
/install
23 #WARN = -W -Wall -pedantic
28 # To ease the life of forkers and packagers one may even adjust the "nail"
29 # of nail(1). Note that $(SID)$(NAIL) must be longer than two characters.
30 # There you go. Two lines for a completely clean fork.
32 SYSCONFRC
= $(SYSCONFDIR
)/$(SID
)$(NAIL
).rc
34 # Binaries builtin paths
35 PATHDEFS
= -DSYSCONFRC
='"$(SYSCONFRC)"' -DMAILSPOOL
='"$(MAILSPOOL)"' \
36 -DSENDMAIL
='"$(SENDMAIL)"'
38 OBJ
= aux.o base64.o cache.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o \
39 dotlock.o edit.o fio.o getname.o getopt.o head.o hmac.o \
40 imap.o imap_search.o junk.o
lex.o list.o lzw.o \
41 macro.o maildir.o main.o md5.o mime.o names.o nss.o \
42 openssl.o pop3.o popen.o quit.o \
43 send.o sendout.o smtp.o ssl.o strings.o temp.o thread.o tty.o \
47 .SUFFIXES
: .o .c .x .y
49 $(CC
) $(CFLAGS
) $(WARN
) $(FEATURES
) `cat INCS` -c
$<
52 $(CC
) $(CFLAGS
) $(WARN
) $(FEATURES
) -E
$< >$@
59 $(CC
) $(LDFLAGS
) $(OBJ
) `cat LIBS` -o
$@
61 $(OBJ
): config.h def.h extern.h glob.h rcv.h
63 md5.o imap.o hmac.o smtp.o aux.o pop3.o junk.o
: md5.h
67 [ -z
"$${VERSION}" ] && eval VERSION
="`git describe --dirty --tags`"; \
69 "const char *const uagent = \"$(SID)$(NAIL)\", \
70 *const version = \"$${VERSION:-spooky}\";"
72 config.h
: user.conf makeconfig Makefile
76 _SYSCONFRC
="$(SYSCONFRC)" _NAIL
="$(SID)$(NAIL)" \
77 < $< > $@ awk
'BEGIN {written = 0} \
78 /.\"--MKMAN-START--/, /.\"--MKMAN-END--/ { \
83 unail = toupper(ENVIRON["_NAIL"]); \
84 lnail = tolower(unail); \
85 cnail = toupper(substr(lnail, 1, 1)) substr(lnail, 2); \
86 print ".ds UU ", unail; \
87 print ".ds uu ", cnail; \
88 print ".ds UA \\\\fI", cnail, "\\\\fR"; \
89 print ".ds ua \\\\fI", lnail, "\\\\fR"; \
90 print ".ds ba \\\\fB", lnail, "\\\\fR"; \
91 print ".ds UR ", ENVIRON["_SYSCONFRC"]; \
99 _SYSCONFRC
="$(SYSCONFRC)" _NAIL
="$(SID)$(NAIL)" \
100 < $< > $@ awk
'BEGIN {written = 0} \
101 /#--MKRC-START--/, /#--MKRC-END--/ { \
106 lnail = tolower(ENVIRON["_NAIL"]); \
107 cnail = toupper(substr(lnail, 1, 1)) substr(lnail, 2); \
108 print "# ", ENVIRON["_SYSCONFRC"]; \
109 print "# Configuration file for ", cnail, "(1), a fork of"; \
116 install: all mkman
.1 mkrc.rc
117 test -d
$(DESTDIR
)$(BINDIR
) || mkdir
-p
$(DESTDIR
)$(BINDIR
)
118 $(INSTALL
) -c
$(SID
)$(NAIL
) $(DESTDIR
)$(BINDIR
)/$(SID
)$(NAIL
)
119 $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(SID
)$(NAIL
)
120 test -d
$(DESTDIR
)$(MANDIR
)/man1 || mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
121 $(INSTALL
) -c
-m
644 mkman
.1 $(DESTDIR
)$(MANDIR
)/man1
/$(SID
)$(NAIL
).1
122 test -d
$(DESTDIR
)$(SYSCONFDIR
) || mkdir
-p
$(DESTDIR
)$(SYSCONFDIR
)
123 test -f
$(DESTDIR
)$(SYSCONFRC
) || \
124 $(INSTALL
) -c
-m
644 mkrc.rc
$(DESTDIR
)$(SYSCONFRC
)
127 rm -f
$(DESTDIR
)$(BINDIR
)/$(SID
)$(NAIL
) \
128 $(DESTDIR
)$(MANDIR
)/man1
/$(SID
)$(NAIL
).1
131 rm -f
$(OBJ
) $(SID
)$(NAIL
) mkman
.1 mkrc.rc
*~ core log
134 rm -f config.h config.log LIBS INCS