Whamcloud - gitweb
9b829bfc1995987f70fca0d53b0ed3e17711c623
[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 SUBDIRS = . include portals ldiskfs lvfs obdclass lov ldlm ptlrpc      \
9         obdecho osc mdc mds obdfilter ost llite cobd ptlbd snapfs smfs \
10         liblustre doc utils tests conf scripts
11
12 EXTRA_DIST = BUGS FDL Rules.in kernel_patches kernel-tests/Makefile     \
13         README.kernel-source
14
15 if MODULES
16 all-am: modules
17
18 if !LINUX25
19 DEP = dep
20 dep: .depend
21
22 .depend:
23         $(MAKE) $(ARCH_UM) -C $(LINUX) -f $(PWD)/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) -o scripts -o include/config/MARKER _sfdep_$(PWD) _FASTDEP_ALL_SUB_DIRS="$(PWD)"
24 endif
25
26 if LDISKFS
27 LDISKFS = ldiskfs-sources
28 ldiskfs-sources:
29         $(MAKE) sources -C ldiskfs
30 endif
31
32 lvfs-sources:
33         $(MAKE) sources -C lvfs
34
35 modules: lustre_build_version $(DEP) $(LDISKFS) lvfs-sources
36         $(MAKE) $(ARCH_UM) -C $(LINUX) -f $(PWD)/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) SUBDIRS=$(PWD) -o tmp_include_depends -o scripts -o include/config/MARKER $@
37
38 lustre_build_version:
39         perl $(top_builddir)/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver
40         echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver
41         cmp -s $(top_builddir)/include/linux/lustre_build_version.h tmpver \
42                 2> /dev/null &&                                            \
43                 $(RM) tmpver ||                                            \
44                 mv tmpver $(top_builddir)/include/linux/lustre_build_version.h
45
46 endif # MODULES
47
48 dist-hook:
49         find $(distdir) -name .deps | xargs rm -rf
50         find $(distdir) -name CVS | xargs rm -rf
51
52 rpms: dist Makefile
53         rpmbuild -ta $(distdir).tar.gz
54
55 CSTK=/tmp/checkstack
56 CSTKO=/tmp/checkstack.orig
57
58 checkstack:
59         [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv ${CSTK} ${CSTKO} || true
60         for i in ${SUBDIRS} portals/knals/*; do                              \
61                 MOD=$$i/`basename $$i`.o;                                    \
62                 [ -f $$MOD ] && objdump -d $$MOD | perl tests/checkstack.pl; \
63         done | sort -nr > ${CSTK}
64         [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
65
66 checkstack-update:
67         [ -f ${CSTK} ] && mv ${CSTK} ${CSTKO}
68
69 checkstack-clean:
70         rm -f ${CSTK} ${CSTKO}