2 # Makefile for sbr subdirectory
7 top_srcdir = @top_srcdir@
11 VERSION = `$(top_srcdir)/version.sh $(top_srcdir)`
14 exec_prefix = @exec_prefix@
22 # add include dir . for sigmsg.h and .. for config.h when building
23 # in different directory
24 INCLUDES = -I$(top_srcdir) -I. -I.. @CPPFLAGS@
32 GNU_LIBTOOL = @GNU_LIBTOOL@
34 LINTFLAGS = @LINTFLAGS@
36 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
38 LOCALLIBS = ../config/config.o
46 # this header file is parsed to generate signal messages (sigmsg.h)
49 # source for library functions
50 SRCS = addrsbr.c ambigsw.c brkstring.c \
51 charset.c concat.c context_del.c \
52 context_find.c context_read.c \
53 context_replace.c context_save.c \
54 cpydata.c crawl_folders.c \
56 error.c execprog.c ext_hook.c folder_addmsg.c folder_delmsgs.c \
57 folder_free.c folder_read.c \
58 folder_realloc.c gans.c getans.c getanswer.c \
60 fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c \
61 fmt_scan.c lock_file.c m_atoi.c \
62 m_convert.c m_draft.c m_getfld2.c m_gmprot.c \
64 makedir.c mts.c norm_charmap.c \
65 path.c pidwait.c pidstatus.c \
66 print_help.c print_sw.c print_version.c \
67 putenv.c mhbasename.c \
68 readconfig.c seq_add.c seq_bits.c \
69 seq_del.c seq_getnum.c seq_list.c seq_nameok.c \
70 seq_print.c seq_read.c seq_save.c seq_setcur.c \
71 seq_setprev.c seq_setunseen.c signals.c \
72 smatch.c snprintb.c strcasecmp.c \
73 strindex.c trim.c trimcpy.c uprf.c vfgets.c fmt_def.c \
74 mf.c utils.c m_mktemp.c seq_msgstats.c \
75 unquote.c encode_rfc2047.c parse_msgs.c \
80 # ========= DEPENDENCIES FOR BUILDING ==========
86 $(AWK) -f $(srcdir)/sigmsg.awk $(SIGNAL_H) > $@
89 $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
91 # Note that not all lexes support -o (it is not POSIX); also
92 # some lexes will only accept '-n -t', not '-nt'.
93 # Also, not all makes accept $< in non-pattern rules,
94 # hence the explicit filenames here.
96 $(LEX) -n -t $(srcdir)/dtimep.lex > $@
100 libmh.a: $(OBJS) $(LOCALLIBS) version.c
102 $(COMPILE) -DVERSION="\"$(VERSION)\"" -o version.o $(srcdir)/version.c
103 if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
104 $(LIBTOOL) -static -c -o libmh.a $(OBJS) $(LOCALLIBS) version.o; \
106 ar cr libmh.a `$(LORDER) $(OBJS) $(LOCALLIBS) version.o | $(TSORT) 2>/dev/null` ; \
107 $(RANLIB) libmh.a ; \
115 # ========== DEPENDENCIES FOR CLEANUP ==========
121 rm -f libmh.a sigmsg.h dtimep.c
128 superclean: realclean
130 # ========== DEPENDENCIES FOR MAINTENANCE ==========
134 Makefile: Makefile.in ../config.status
135 cd .. && ./config.status $(subdir)/$@