expand() filenames given to the ~@ tilde escape..
[s-mailx.git] / Makefile
blob1dcd8fb1540c2fa93a5b79fb4ce6f183582087c1
2 # Makefile for s-nail
6 # See the file INSTALL if you need help.
9 PREFIX = /usr/local
10 BINDIR = $(PREFIX)/bin
11 MANDIR = $(PREFIX)/man
12 SYSCONFDIR = $(PREFIX)/etc
13 DESTDIR =
15 MAILRC = $(SYSCONFDIR)/s-nail.rc
16 MAILSPOOL = /var/mail
17 SENDMAIL = /usr/sbin/sendmail
18 INSTALL = /usr/bin/install
21 # Define compiler, preprocessor, and linker flags here.
22 # Note that some Linux/glibc versions need -D_GNU_SOURCE in CPPFLAGS, or
23 # wcwidth() will not be available and multibyte characters will not be
24 # displayed correctly.
25 #CFLAGS =
26 #CPPFLAGS =
27 #LDFLAGS =
28 #WARN = -Wall -Wno-parentheses -Werror
30 # Some RedHat versions need INCLUDES = -I/usr/kerberos/include to compile
31 # with OpenSSL, or to compile with GSSAPI authentication included. In the
32 # latter case, they also need LDFLAGS = -L/usr/kerberos/lib.
33 #INCLUDES = -I/usr/kerberos/include
34 #LDFLAGS = -L/usr/kerberos/lib
36 # If you want to include SSL support using Mozilla NSS instead of OpenSSL,
37 # set something like the following paths. (You might also need to set LDFLAGS).
38 #MOZINC = /usr/include/mozilla-seamonkey-1.0.5
39 #INCLUDES = -I$(MOZINC)/nspr -I$(MOZINC)/nss
40 # These paths are suitable to activate NSS support on Solaris, provided that
41 # the packages SUNWmoznss, SUNWmoznss-devel, SUNWmoznspr, and SUNWmoznspr-devel
42 # are installed.
43 #MOZINC = /usr/sfw/include/mozilla
44 #MOZLIB = /usr/sfw/lib/mozilla
45 #INCLUDES = -I$(MOZINC)/nspr -I$(MOZINC)/nss
46 #LDFLAGS = -L$(MOZLIB) -R$(MOZLIB)
48 SHELL = /bin/sh
50 # If you know that the IPv6 functions work on your machine, you can enable
51 # them here.
52 #IPv6 = -DHAVE_IPv6_FUNCS
55 # Binaries are stripped with this command after installation.
57 STRIP = strip
59 ###########################################################################
60 ###########################################################################
61 # You should really know what you do if you change anything below this line
62 ###########################################################################
63 ###########################################################################
65 FEATURES = -DMAILRC='"$(MAILRC)"' -DMAILSPOOL='"$(MAILSPOOL)"' \
66 -DSENDMAIL='"$(SENDMAIL)"' $(IPv6)
68 OBJ = aux.o base64.o cache.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o \
69 dotlock.o edit.o fio.o getname.o getopt.o head.o hmac.o \
70 imap.o imap_search.o junk.o lex.o list.o lzw.o \
71 macro.o maildir.o main.o md5.o mime.o names.o nss.o \
72 openssl.o pop3.o popen.o quit.o \
73 send.o sendout.o smtp.o ssl.o strings.o temp.o thread.o tty.o \
74 v7.local.o vars.o \
75 version.o
77 .SUFFIXES: .o .c .x
78 .c.o:
79 $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURES) $(INCLUDES) $(WARN) -c $<
81 .c.x:
82 $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURES) $(INCLUDES) $(WARN) -E $< >$@
84 .c:
85 $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURES) $(INCLUDES) $(WARN) \
86 $(LDFLAGS) $< `grep '^[^#]' LIBS` $(LIBS) -o $@
88 all: s-nail
90 s-nail: $(OBJ)
91 $(CC) $(LDFLAGS) $(OBJ) `grep '^[^#]' LIBS` $(LIBS) -o s-nail
93 $(OBJ): config.h def.h extern.h glob.h rcv.h
94 imap.o: imap_gssapi.c
95 md5.o imap.o hmac.o smtp.o aux.o pop3.o junk.o: md5.h
96 nss.o: nsserr.c
97 version.o: version.h
99 #version.h: $(OBJ:.o=.c)
100 version.h:
101 eval VERSION=`git describe --dirty --tags`; \
102 echo > version.h \
103 "#define V \"<12.5 7/5/10; $${VERSION:-S-nail spooned}>\""
105 config.h: makeconfig
106 $(SHELL) ./makeconfig
108 install: all
109 test -d $(DESTDIR)$(BINDIR) || mkdir -p $(DESTDIR)$(BINDIR)
110 $(INSTALL) -c s-nail $(DESTDIR)$(BINDIR)/s-nail
111 $(STRIP) $(DESTDIR)$(BINDIR)/s-nail
112 test -d $(DESTDIR)$(MANDIR)/man1 || mkdir -p $(DESTDIR)$(MANDIR)/man1
113 $(INSTALL) -c -m 644 mailx.1 $(DESTDIR)$(MANDIR)/man1/s-nail.1
114 test -d $(DESTDIR)$(SYSCONFDIR) || mkdir -p $(DESTDIR)$(SYSCONFDIR)
115 test -f $(DESTDIR)$(MAILRC) || \
116 $(INSTALL) -c -m 644 nail.rc $(DESTDIR)$(MAILRC)
118 clean:
119 rm -f $(OBJ) s-nail *~ core log
121 distclean: clean
122 rm -f config.h config.log LIBS