* docs/MAIL.FILTERING: added note on removing procmail -f or
[mmh] / sbr / Makefile.in
1 #
2 # Makefile for sbr subdirectory
3 #
4 # $Id$
5 #
6
7 SHELL = /bin/sh
8
9 top_srcdir = @top_srcdir@
10 srcdir     = @srcdir@
11 VPATH      = @srcdir@
12
13 prefix      = @prefix@
14 exec_prefix = @exec_prefix@
15 bindir      = @bindir@
16 libdir      = @libdir@
17 etcdir      = @sysconfdir@
18
19 CC       = @CC@
20 CFLAGS   = @CFLAGS@
21 DEFS     = @DEFS@
22 KRB4_INCLUDES = @KRB4_INCLUDES@      # for mts
23 HESIOD_INCLUDES = @HESIOD_INCLUDES@  # for mts
24 CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' -DMAILSPOOL='"$(mailspool)"' -DSENDMAILPATH='"$(sendmailpath)"'
25 INCLUDES = -I.. -I. -I$(top_srcdir)
26
27 LEX    = @LEX@
28 AWK    = @AWK@
29 LORDER = @LORDER@
30 TSORT  = @TSORT@
31 RANLIB = @RANLIB@
32 LIBTOOL = @LIBTOOL@
33 GNU_LIBTOOL = @GNU_LIBTOOL@
34 LINT    = @LINT@
35 LINTFLAGS = @LINTFLAGS@ 
36
37 LIBOBJS = @LIBOBJS@
38
39 mailspool    = @mailspool@
40 sendmailpath = @sendmailpath@
41
42 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
43 COMPILE2 = $(CC) -c $(DEFS) $(CONFIGDEFS) $(INCLUDES) $(KRB4_INCLUDES) $(HESIOD_INCLUDES) $(CFLAGS)
44
45
46
47 .SUFFIXES:
48 .SUFFIXES: .c .o
49
50 .c.o:
51         $(COMPILE) $<
52
53 # this header file is parsed to generate signal messages (sigmsg.h)
54 SIGNAL_H = @SIGNAL_H@
55
56 # source for library functions
57 SRCS = addrsbr.c ambigsw.c atooi.c brkstring.c                  \
58         check_charset.c client.c closefds.c concat.c context_del.c      \
59         context_find.c context_foil.c context_read.c                    \
60         context_replace.c context_save.c copy.c                         \
61         copyip.c cpydata.c cpydgst.c discard.c done.c dtime.c dtimep.c  \
62         error.c ext_hook.c fdcompare.c folder_addmsg.c folder_delmsgs.c \
63         folder_free.c folder_pack.c folder_read.c                       \
64         folder_realloc.c gans.c getans.c getanswer.c                    \
65         getarguments.c getcpy.c getfolder.c getpass.c                   \
66         fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c                \
67         fmt_scan.c lock_file.c m_atoi.c m_backup.c                      \
68         m_convert.c m_draft.c m_getfld.c m_gmprot.c                     \
69         m_maildir.c m_name.c m_scratch.c m_tmpfil.c                     \
70         makedir.c mts.c norm_charmap.c                                  \
71         path.c peekc.c pidwait.c pidstatus.c                            \
72         print_help.c print_sw.c print_version.c push.c                  \
73         putenv.c refile.c       remdir.c r1bindex.c                     \
74         readconfig.c ruserpass.c seq_add.c seq_bits.c                   \
75         seq_del.c seq_getnum.c seq_list.c seq_nameok.c                  \
76         seq_print.c seq_read.c seq_save.c seq_setcur.c                  \
77         seq_setprev.c seq_setunseen.c showfile.c signals.c              \
78         smatch.c snprintb.c ssequal.c strcasecmp.c                      \
79         strindex.c trimcpy.c uprf.c vfgets.c fmt_def.c                  \
80         m_msgdef.c mf.c utils.c
81
82 # source for compatibility functions
83 COMPAT = memmove.c snprintf.c strdup.c strerror.c
84
85 OBJS =  $(SRCS:.c=.o) $(LIBOBJS)
86
87 # auxiliary files
88 AUX = Makefile.in sigmsg.awk dtimep.lex
89
90 # all files in this directory included in the distribution
91 DIST = $(SRCS) $(COMPAT) $(AUX)
92
93 # ========= DEPENDENCIES FOR BUILDING ==========
94
95 # default target
96 all: libmh.a
97
98 sigmsg.h: sigmsg.awk
99         $(AWK) -f $(srcdir)/sigmsg.awk $(SIGNAL_H) > $@
100
101 lint: sigmsg.h
102         $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
103
104 # Note that not all lexes support -o (it is not POSIX); also
105 # some lexes will only accept '-n -t', not '-nt'.
106 # Also, not all makes accept $< in non-pattern rules,
107 # hence the explicit filenames here.
108 dtimep.c: dtimep.lex
109         $(LEX) -n -t $(srcdir)/dtimep.lex > dtimep.c
110
111 client.o: client.c
112         $(COMPILE2) $(srcdir)/client.c
113
114 mts.o: mts.c
115         $(COMPILE2) $(srcdir)/mts.c
116
117 pidstatus.o: sigmsg.h
118
119 libmh.a: $(OBJS)
120         rm -f $@
121         if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
122           $(LIBTOOL) -static -c -o libmh.a $(OBJS) ; \
123         else \
124           ar cr libmh.a `$(LORDER) $(OBJS) | $(TSORT)`  ; \
125           $(RANLIB) libmh.a  ; \
126         fi
127
128 install:
129
130 uninstall:
131
132 # ========== DEPENDENCIES FOR CLEANUP ==========
133
134 mostlyclean:
135         rm -f *.o *~
136
137 clean: mostlyclean
138         rm -f libmh.a sigmsg.h dtimep.c
139
140 distclean: clean
141         rm -f Makefile
142
143 realclean: distclean
144
145 superclean: realclean
146
147 # ========== DEPENDENCIES FOR MAINTENANCE ==========
148
149 subdir = sbr
150
151 Makefile: Makefile.in ../config.status
152         cd .. && ./config.status $(subdir)/$@
153  
154 distdir = ../`cat ../distname`/$(subdir)
155 nmhdist: $(DIST)
156         @echo "Copying distribution files in $(subdir)"
157         @for file in $(DIST); do \
158           cp -p $(srcdir)/$$file $(distdir); \
159         done
160