Fixed building in different build directory, as described in INSTALL.
[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 prefix      = @prefix@
12 exec_prefix = @exec_prefix@
13 bindir      = @bindir@
14 libdir      = @libdir@
15 etcdir      = @sysconfdir@
16
17 CC       = @CC@
18 CFLAGS   = @CFLAGS@
19 DEFS     = @DEFS@
20 # add include dir . for sigmsg.h when building in different directory
21 INCLUDES = -I$(top_srcdir) -I. @CPPFLAGS@
22
23 LEX    = @LEX@
24 AWK    = @AWK@
25 LORDER = @LORDER@
26 TSORT  = @TSORT@
27 RANLIB = @RANLIB@
28 LIBTOOL = @LIBTOOL@
29 GNU_LIBTOOL = @GNU_LIBTOOL@
30 LINT    = @LINT@
31 LINTFLAGS = @LINTFLAGS@
32
33 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
34
35
36
37 .SUFFIXES:
38 .SUFFIXES: .c .o
39
40 .c.o:
41         $(COMPILE) $<
42
43 # this header file is parsed to generate signal messages (sigmsg.h)
44 SIGNAL_H = @SIGNAL_H@
45
46 # source for library functions
47 SRCS = addrsbr.c ambigsw.c brkstring.c  \
48         charset.c concat.c context_del.c  \
49         context_find.c context_read.c  \
50         context_replace.c context_save.c \
51         cpydata.c cpydgst.c crawl_folders.c  \
52         discard.c done.c dtime.c dtimep.c  \
53         error.c ext_hook.c folder_addmsg.c folder_delmsgs.c  \
54         folder_free.c folder_read.c  \
55         folder_realloc.c gans.c getans.c getanswer.c  \
56         getarguments.c getcpy.c \
57         fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c  \
58         fmt_scan.c lock_file.c m_atoi.c \
59         m_convert.c m_draft.c m_getfld.c m_gmprot.c  \
60         m_name.c \
61         makedir.c mts.c norm_charmap.c  \
62         path.c pidwait.c pidstatus.c  \
63         print_help.c print_sw.c print_version.c \
64         putenv.c mhbasename.c  \
65         readconfig.c seq_add.c seq_bits.c  \
66         seq_del.c seq_getnum.c seq_list.c seq_nameok.c  \
67         seq_print.c seq_read.c seq_save.c seq_setcur.c  \
68         seq_setprev.c seq_setunseen.c signals.c  \
69         smatch.c snprintb.c strcasecmp.c  \
70         strindex.c trim.c trimcpy.c uprf.c vfgets.c fmt_def.c  \
71         mf.c utils.c m_mktemp.c seq_msgstats.c
72
73 OBJS =  $(SRCS:.c=.o)
74
75 # auxiliary files
76 AUX = Makefile.in sigmsg.awk dtimep.lex
77
78 # all files in this directory included in the distribution
79 DIST = $(SRCS) $(AUX)
80
81 # ========= DEPENDENCIES FOR BUILDING ==========
82
83 # default target
84 all: libmh.a
85
86 sigmsg.h: sigmsg.awk
87         $(AWK) -f $(srcdir)/sigmsg.awk $(SIGNAL_H) > $@
88
89 lint: sigmsg.h
90         $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
91
92 # Note that not all lexes support -o (it is not POSIX); also
93 # some lexes will only accept '-n -t', not '-nt'.
94 # Also, not all makes accept $< in non-pattern rules,
95 # hence the explicit filenames here.
96 dtimep.c: dtimep.lex
97         $(LEX) -n -t $(srcdir)/dtimep.lex > $@
98
99 pidstatus.o: sigmsg.h
100
101 libmh.a: $(OBJS)
102         rm -f $@
103         if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
104           $(LIBTOOL) -static -c -o libmh.a $(OBJS) ; \
105         else \
106           ar cr libmh.a `$(LORDER) $(OBJS) | $(TSORT) 2>/dev/null`  ; \
107           $(RANLIB) libmh.a  ; \
108         fi
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
136 distdir = ../`cat ../distname`/$(subdir)
137 mmhdist: $(DIST)
138         @echo "Copying distribution files in $(subdir)"
139         @for file in $(DIST); do \
140           cp -p $(srcdir)/$$file $(distdir); \
141         done
142