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 \
57 error.c execprog.c ext_hook.c fold.c \
58 folder_addmsg.c folder_delmsgs.c \
59 folder_free.c folder_read.c \
60 folder_realloc.c gans.c getans.c getanswer.c \
62 fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c \
63 fmt_scan.c lock_file.c m_atoi.c \
64 m_convert.c m_draft.c m_getfld2.c m_gmprot.c \
66 makedir.c mts.c norm_charmap.c \
67 path.c pidwait.c pidstatus.c \
68 print_help.c print_sw.c print_version.c \
69 putenv.c mhbasename.c \
70 readconfig.c seq_add.c seq_bits.c \
71 seq_del.c seq_getnum.c seq_list.c seq_nameok.c \
72 seq_print.c seq_read.c seq_save.c seq_setcur.c \
73 seq_setunseen.c signals.c \
74 smatch.c snprintb.c strcasecmp.c \
75 strindex.c trim.c trimcpy.c uprf.c vfgets.c fmt_def.c \
76 mf.c utils.c m_mktemp.c seq_msgstats.c \
77 unquote.c encode_rfc2047.c parse_msgs.c \
82 # ========= DEPENDENCIES FOR BUILDING ==========
88 $(AWK) -f $(srcdir)/sigmsg.awk $(SIGNAL_H) > $@
91 $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
93 # Note that not all lexes support -o (it is not POSIX); also
94 # some lexes will only accept '-n -t', not '-nt'.
95 # Also, not all makes accept $< in non-pattern rules,
96 # hence the explicit filenames here.
98 $(LEX) -n -t $(srcdir)/dtimep.lex > $@
100 pidstatus.o: sigmsg.h
102 libmh.a: $(OBJS) $(LOCALLIBS) version.c
104 $(COMPILE) -DVERSION="\"$(VERSION)\"" -o version.o $(srcdir)/version.c
105 if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
106 $(LIBTOOL) -static -c -o libmh.a $(OBJS) $(LOCALLIBS) version.o; \
108 ar cr libmh.a `$(LORDER) $(OBJS) $(LOCALLIBS) version.o | $(TSORT) 2>/dev/null` ; \
109 $(RANLIB) libmh.a ; \
117 # ========== DEPENDENCIES FOR CLEANUP ==========
123 rm -f libmh.a sigmsg.h
126 rm -f Makefile dtimep.c
130 superclean: realclean
132 # ========== DEPENDENCIES FOR MAINTENANCE ==========
136 Makefile: Makefile.in ../config.status
137 cd .. && ./config.status $(subdir)/$@