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