a9fa2d4b7823bff5dbdee3ea6d5f67c036f94b1f
[mmh] / sbr / Makefile.in
1 #
2 # Makefile for sbr subdirectory
3 #
4
5 SHELL = /bin/sh
6
7 top_srcdir = @top_srcdir@
8 srcdir     = @srcdir@
9 VPATH      = @srcdir@
10
11 VERSION = `$(top_srcdir)/version.sh $(top_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 # add include dir . for sigmsg.h and .. for config.h when building
23 # in different directory
24 INCLUDES = -I$(top_srcdir) -I. -I.. @CPPFLAGS@
25
26 LEX    = @LEX@
27 AWK    = @AWK@
28 LORDER = @LORDER@
29 TSORT  = @TSORT@
30 RANLIB = @RANLIB@
31 LIBTOOL = @LIBTOOL@
32 GNU_LIBTOOL = @GNU_LIBTOOL@
33 LINT    = @LINT@
34 LINTFLAGS = @LINTFLAGS@
35
36 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
37
38 LOCALLIBS = ../config/config.o
39
40 .SUFFIXES:
41 .SUFFIXES: .c .o
42
43 .c.o:
44         $(COMPILE) $<
45
46 # this header file is parsed to generate signal messages (sigmsg.h)
47 SIGNAL_H = @SIGNAL_H@
48
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 cpydgst.c crawl_folders.c  \
55         dtime.c dtimep.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  \
59         getarguments.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  \
63         m_name.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
76
77 OBJS =  $(SRCS:.c=.o)
78
79 # ========= DEPENDENCIES FOR BUILDING ==========
80
81 # default target
82 all: libmh.a
83
84 sigmsg.h: sigmsg.awk
85         $(AWK) -f $(srcdir)/sigmsg.awk $(SIGNAL_H) > $@
86
87 lint: sigmsg.h
88         $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
89
90 # Note that not all lexes support -o (it is not POSIX); also
91 # some lexes will only accept '-n -t', not '-nt'.
92 # Also, not all makes accept $< in non-pattern rules,
93 # hence the explicit filenames here.
94 dtimep.c: dtimep.lex
95         $(LEX) -n -t $(srcdir)/dtimep.lex > $@
96
97 pidstatus.o: sigmsg.h
98
99 libmh.a: $(OBJS) $(LOCALLIBS) version.c
100         rm -f $@
101         $(COMPILE) -DVERSION="\"$(VERSION)\"" -o version.o $(srcdir)/version.c
102         if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
103           $(LIBTOOL) -static -c -o libmh.a $(OBJS) $(LOCALLIBS) version.o; \
104         else \
105           ar cr libmh.a `$(LORDER) $(OBJS) $(LOCALLIBS) version.o | $(TSORT) 2>/dev/null`  ; \
106           $(RANLIB) libmh.a  ; \
107         fi
108         rm -f version.o
109
110 install:
111
112 uninstall:
113
114 # ========== DEPENDENCIES FOR CLEANUP ==========
115
116 mostlyclean:
117         rm -f *.o *~
118
119 clean: mostlyclean
120         rm -f libmh.a sigmsg.h dtimep.c
121
122 distclean: clean
123         rm -f Makefile
124
125 realclean: distclean
126
127 superclean: realclean
128
129 # ========== DEPENDENCIES FOR MAINTENANCE ==========
130
131 subdir = sbr
132
133 Makefile: Makefile.in ../config.status
134         cd .. && ./config.status $(subdir)/$@
135