Added execprog() and execprogl(), which are safer alternatives to system(3)
[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 and .. for config.h when building
21 # in different directory
22 INCLUDES = -I$(top_srcdir) -I. -I.. @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 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS)
35
36
37
38 .SUFFIXES:
39 .SUFFIXES: .c .o
40
41 .c.o:
42         $(COMPILE) $<
43
44 # this header file is parsed to generate signal messages (sigmsg.h)
45 SIGNAL_H = @SIGNAL_H@
46
47 # source for library functions
48 SRCS = addrsbr.c ambigsw.c brkstring.c  \
49         charset.c concat.c context_del.c  \
50         context_find.c context_read.c  \
51         context_replace.c context_save.c \
52         cpydata.c cpydgst.c crawl_folders.c  \
53         discard.c done.c dtime.c dtimep.c  \
54         error.c execprog.c ext_hook.c folder_addmsg.c folder_delmsgs.c  \
55         folder_free.c folder_read.c  \
56         folder_realloc.c gans.c getans.c getanswer.c  \
57         getarguments.c getcpy.c \
58         fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c  \
59         fmt_scan.c lock_file.c m_atoi.c \
60         m_convert.c m_draft.c m_getfld.c m_gmprot.c  \
61         m_name.c \
62         makedir.c mts.c norm_charmap.c  \
63         path.c pidwait.c pidstatus.c  \
64         print_help.c print_sw.c print_version.c \
65         putenv.c mhbasename.c  \
66         readconfig.c seq_add.c seq_bits.c  \
67         seq_del.c seq_getnum.c seq_list.c seq_nameok.c  \
68         seq_print.c seq_read.c seq_save.c seq_setcur.c  \
69         seq_setprev.c seq_setunseen.c signals.c  \
70         smatch.c snprintb.c strcasecmp.c  \
71         strindex.c trim.c trimcpy.c uprf.c vfgets.c fmt_def.c  \
72         mf.c utils.c m_mktemp.c seq_msgstats.c
73
74 OBJS =  $(SRCS:.c=.o)
75
76 # auxiliary files
77 AUX = Makefile.in sigmsg.awk dtimep.lex
78
79 # all files in this directory included in the distribution
80 DIST = $(SRCS) $(AUX)
81
82 # ========= DEPENDENCIES FOR BUILDING ==========
83
84 # default target
85 all: libmh.a
86
87 sigmsg.h: sigmsg.awk
88         $(AWK) -f $(srcdir)/sigmsg.awk $(SIGNAL_H) > $@
89
90 lint: sigmsg.h
91         $(LINT) $(LINTFLAGS) $(INCLUDES) $(DEFS) $(SRCS)
92
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.
97 dtimep.c: dtimep.lex
98         $(LEX) -n -t $(srcdir)/dtimep.lex > $@
99
100 pidstatus.o: sigmsg.h
101
102 libmh.a: $(OBJS)
103         rm -f $@
104         if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
105           $(LIBTOOL) -static -c -o libmh.a $(OBJS) ; \
106         else \
107           ar cr libmh.a `$(LORDER) $(OBJS) | $(TSORT) 2>/dev/null`  ; \
108           $(RANLIB) libmh.a  ; \
109         fi
110
111 install:
112
113 uninstall:
114
115 # ========== DEPENDENCIES FOR CLEANUP ==========
116
117 mostlyclean:
118         rm -f *.o *~
119
120 clean: mostlyclean
121         rm -f libmh.a sigmsg.h dtimep.c
122
123 distclean: clean
124         rm -f Makefile
125
126 realclean: distclean
127
128 superclean: realclean
129
130 # ========== DEPENDENCIES FOR MAINTENANCE ==========
131
132 subdir = sbr
133
134 Makefile: Makefile.in ../config.status
135         cd .. && ./config.status $(subdir)/$@
136
137 distdir = ../`cat ../distname`/$(subdir)
138 mmhdist: $(DIST)
139         @echo "Copying distribution files in $(subdir)"
140         @for file in $(DIST); do \
141           cp -p $(srcdir)/$$file $(distdir); \
142         done
143