Whamcloud - gitweb
land b_smallfix 20040407_1414:
[fs/lustre-release.git] / lustre / Makefile.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 DIST_SUBDIRS = 
9 SUBDIRS = include portals conf scripts ldlm
10
11 # ldiskfs creates headers that the ldiskfs fsfilt will need
12 if MODULES
13 if LDISKFS
14 SUBDIRS += ldiskfs
15 else
16 DIST_SUBDIRS += ldiskfs
17 endif
18 else
19 DIST_SUBDIRS += ldiskfs
20 endif
21
22 # directories shared by the liblustre and modules builds
23 CORE_SUBDIRS = lvfs obdclass lov ptlrpc obdecho osc mdc
24 if LIBLUSTRE
25 SUBDIRS += $(CORE_SUBDIRS)
26 else
27 if MODULES
28 SUBDIRS += $(CORE_SUBDIRS)
29 else
30 DIST_SUBDIRS += $(CORE_SUBDIRS)
31 endif
32 endif
33
34 # directories only built in the modules build
35 MODULES_SUBDIRS = mds obdfilter ost llite cobd
36 MODULES_DIST_SUBDIRS =
37
38 if LINUX25
39 MODULES_DIST_SUBDIRS += ptlbd
40 else
41 MODULES_SUBDIRS += ptlbd
42 endif
43
44 if SNAPFS
45 MODULES_SUBDIRS += snapfs
46 else
47 MODULES_DIST_SUBDIRS += snapfs
48 endif
49
50 if SMFS
51 MODULES_SUBDIRS += smfs
52 else
53 MODULES_DIST_SUBDIRS += smfs
54 endif
55
56 if MODULES
57 SUBDIRS += $(MODULES_SUBDIRS)
58 DIST_SUBDIRS += $(MODULES_DIST_SUBDIRS)
59 else
60 DIST_SUBDIRS += $(MODULES_SUBDIRS) $(MODULES_DIST_SUBDIRS)
61 endif
62
63 if LIBLUSTRE
64 SUBDIRS += liblustre
65 else
66 DIST_SUBDIRS += liblustre
67 endif
68
69 if DOC
70 SUBDIRS += doc
71 else
72 DIST_SUBDIRS += doc
73 endif
74
75 if UTILS
76 SUBDIRS += utils
77 else
78 DIST_SUBDIRS += utils
79 endif
80
81 if TESTS
82 SUBDIRS += tests
83 else
84 DIST_SUBDIRS += tests
85 endif
86
87 DIST_SUBDIRS += $(SUBDIRS)
88
89 EXTRA_DIST = BUGS FDL Rules.in kernel_patches kernel-tests/Makefile
90
91 dist-hook:
92         find $(distdir) -name .deps | xargs rm -rf
93         find $(distdir) -name CVS | xargs rm -rf
94
95 rpms: dist Makefile
96         rpmbuild -ta $(distdir).tar.gz
97
98 CSTK=/tmp/checkstack
99 CSTKO=/tmp/checkstack.orig
100
101 checkstack:
102         [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv ${CSTK} ${CSTKO} || true
103         for i in ${SUBDIRS} portals/knals/*; do                              \
104                 MOD=$$i/`basename $$i`.o;                                    \
105                 [ -f $$MOD ] && objdump -d $$MOD | perl tests/checkstack.pl; \
106         done | sort -nr > ${CSTK}
107         [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
108
109 checkstack-update:
110         [ -f ${CSTK} ] && mv ${CSTK} ${CSTKO}
111
112 checkstack-clean:
113         rm -f ${CSTK} ${CSTKO}