Whamcloud - gitweb
05bb666b1c60b71c629d7173673916dae3c95917
[fs/lustre-release.git] / lustre / autoMakefile.am
1 # Copyright (C) 2001  Cluster File Systems, Inc.
2 #
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
5
6 AUTOMAKE_OPTIONS = foreign
7
8 ALWAYS_SUBDIRS := include lvfs obdclass ldlm ptlrpc osc lov obdecho \
9         mgc doc utils tests conf scripts autoconf
10
11 SERVER_SUBDIRS := ldiskfs obdfilter ost mds mgs
12
13 CLIENT_SUBDIRS := mdc llite
14
15 QUOTA_SUBDIRS := quota
16
17 LIBLUSTRE_SUBDIRS := liblustre
18
19 SUBDIRS := $(ALWAYS_SUBDIRS)
20
21 if SERVER
22 SUBDIRS += $(SERVER_SUBDIRS)
23 endif
24
25 if CLIENT
26 SUBDIRS += $(CLIENT_SUBDIRS)
27 endif
28
29 if QUOTA
30 SUBDIRS += $(QUOTA_SUBDIRS)
31 endif
32
33 # this needs to be after the client subdirs
34 if LIBLUSTRE
35 if !CLIENT
36 SUBDIRS += $(CLIENT_SUBDIRS)
37 endif
38 SUBDIRS += $(LIBLUSTRE_SUBDIRS)
39 endif
40
41 DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS)   \
42         $(LIBLUSTRE_SUBDIRS) $(QUOTA_SUBDIRS)
43
44 EXTRA_DIST = BUGS FDL kernel_patches
45
46 if LDISKFS
47 LDISKFS = ldiskfs-sources
48 ldiskfs-sources:
49         $(MAKE) sources -C ldiskfs
50 endif
51
52 lvfs-sources:
53         $(MAKE) sources -C lvfs
54
55 sources: $(LDISKFS) lvfs-sources lustre_build_version
56
57 all-recursive: lustre_build_version
58
59 lustre_build_version:
60         perl $(top_builddir)/lustre/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver
61         echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver
62         cmp -s $(top_builddir)/lustre/include/linux/lustre_build_version.h tmpver \
63                 2> /dev/null &&                                            \
64                 $(RM) tmpver ||                                            \
65                 mv tmpver $(top_builddir)/lustre/include/linux/lustre_build_version.h
66
67 CSTK=/tmp/checkstack
68 CSTKO=/tmp/checkstack.orig
69
70 checkstack:
71         [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv ${CSTK} ${CSTKO} || true
72         for i in ${SUBDIRS} lnet/klnds/*; do                                 \
73                 MOD=$$i/`basename $$i`.o;                                    \
74                 [ -f $$MOD ] && objdump -d $$MOD | perl tests/checkstack.pl; \
75         done | sort -nr > ${CSTK}
76         [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
77
78 checkstack-update:
79         [ -f ${CSTK} ] && mv ${CSTK} ${CSTKO}
80
81 checkstack-clean:
82         rm -f ${CSTK} ${CSTKO}