412a1521d92b3adf081cb350bf9b491a4729fd8b
[mmh] / zotnet / Makefile.in
1 #
2 # Makefile for zotnet subdirectory
3 #
4 # $Id$
5 #
6
7 SHELL = /bin/sh
8
9 srcdir = @srcdir@
10 VPATH  = @srcdir@
11
12 LORDER = @LORDER@
13 TSORT  = @TSORT@
14 RANLIB = @RANLIB@
15 LIBTOOL = @LIBTOOL@
16 GNU_LIBTOOL = @GNU_LIBTOOL@
17
18 # flags passed to recursive makes in subdirectories
19 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
20 CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
21 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
22 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
23 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)' \
24 default_editor='$(default_editor)' default_pager='$(default_pager)'
25
26 # object files in libzot.a
27 OBJS = mts/mts.o mts/client.o \
28        tws/dtime.o tws/dtimep.o tws/lexstring.o
29
30 # auxiliary files
31 AUX = Makefile.in
32
33 # all files in this directory included in the distribution
34 DIST = $(AUX)
35
36 # subdirectories
37 SUBDIRS = mts tws
38
39 # ========= DEPENDENCIES FOR BUILDING AND INSTALLING ==========
40
41 all: all-recursive libzot.a
42
43 libzot.a: $(OBJS)
44         rm -f $@
45         if test x$(LIBTOOL) != x -a x$(GNU_LIBTOOL) = x ; then \
46           $(LIBTOOL) -static -c $(OBJS) -o $@  ; \
47         else \
48           ar cr $@ `$(LORDER) $(OBJS) | $(TSORT)`  ; \
49           $(RANLIB) $@  ; \
50         fi 
51
52 all-recursive:
53         for subdir in $(SUBDIRS); do \
54           (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
55         done
56
57 install uninstall:
58         for subdir in $(SUBDIRS); do \
59           (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
60         done
61
62 # ========== DEPENDENCIES FOR CLEANUP ==========
63
64 mostlyclean: mostlyclean-recursive mostlyclean-local
65 clean:       clean-recursive       clean-local
66 distclean:   distclean-recursive   distclean-local
67 realclean:   realclean-recursive   realclean-local
68 superclean:  superclean-recursive  superclean-local
69
70 mostlyclean-local:
71         rm -f *~
72
73 clean-local: mostlyclean-local
74         rm -f libzot.a
75
76 distclean-local: clean-local
77         rm -f Makefile
78
79 realclean-local: distclean-local
80
81 superclean-local: realclean-local
82
83 mostlyclean-recursive clean-recursive distclean-recursive realclean-recursive superclean-recursive:
84         for subdir in $(SUBDIRS); do \
85           target=`echo $@ | sed 's/-recursive//'`; \
86           (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
87         done
88
89 # ========== DEPENDENCIES FOR MAINTENANCE ==========
90
91 subdir = zotnet
92
93 Makefile: Makefile.in ../config.status
94         cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
95  
96 distdir = ../`cat ../distname`/$(subdir)
97 nmhdist: $(DIST)
98         @echo "Copying distribution files in $(subdir)"
99         @for file in $(DIST); do \
100           cp -p $(srcdir)/$$file $(distdir); \
101         done
102         @for subdir in $(SUBDIRS); do \
103           mkdir $(distdir)/$$subdir; \
104           chmod 755 $(distdir)/$$subdir; \
105           (cd $$subdir && $(MAKE) $@) || exit 1; \
106         done
107