Whamcloud - gitweb
Land b1_2_smallfix onto b1_2 (20040624_1212)
[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 # these empty rules are needed so that automake doesn't add its own
16 # recursive rules
17 etags-recursive:
18
19 ctags-recursive:
20
21 tags-recursive:
22
23 TAGS:
24
25 tags:
26         rm -f $(top_srcdir)/TAGS
27         ETAGSF=`etags --version | grep -iq exuberant && \
28                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
29         find $(top_srcdir) -name '*.[hc]' | xargs etags $$ETAGSF -a
30
31         rm -f $(top_srcdir)/tags
32         CTAGSF=`ctags --version | grep -iq exuberant && \
33                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
34         find $(top_srcdir) -name '*.[hc]' | xargs ctags $$CTAGSF -a
35
36 if MODULES
37 all-am: modules
38
39 if !LINUX25
40 DEP = dep
41 dep: .depend
42
43 .depend: $(LDISKFS) lvfs-sources libcfs-sources
44         $(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)"
45 endif
46
47 if LDISKFS
48 LDISKFS = ldiskfs-sources
49 ldiskfs-sources:
50         $(MAKE) sources -C ldiskfs
51 endif
52
53 lvfs-sources:
54         $(MAKE) sources -C lvfs
55
56 libcfs-sources:
57         $(MAKE) sources -C portals/libcfs
58
59 modules: lustre_build_version $(DEP) $(LDISKFS) lvfs-sources libcfs-sources
60         $(MAKE) $(ARCH_UM) -C $(LINUX) -f $(PWD)/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o include/config/MARKER $@
61
62 endif # MODULES
63
64 all-recursive: lustre_build_version
65
66 lustre_build_version:
67         perl $(top_builddir)/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver
68         echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver
69         cmp -s $(top_builddir)/include/linux/lustre_build_version.h tmpver \
70                 2> /dev/null &&                                            \
71                 $(RM) tmpver ||                                            \
72                 mv tmpver $(top_builddir)/include/linux/lustre_build_version.h
73
74 dist-hook:
75         find $(distdir) -name .deps | xargs rm -rf
76         find $(distdir) -name CVS | xargs rm -rf
77
78 rpms: dist Makefile
79         rpmbuild -ta $(distdir).tar.gz
80
81 CSTK=/tmp/checkstack
82 CSTKO=/tmp/checkstack.orig
83
84 checkstack:
85         [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv ${CSTK} ${CSTKO} || true
86         for i in ${SUBDIRS} portals/knals/*; do                              \
87                 MOD=$$i/`basename $$i`.o;                                    \
88                 [ -f $$MOD ] && objdump -d $$MOD | perl tests/checkstack.pl; \
89         done | sort -nr > ${CSTK}
90         [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
91
92 checkstack-update:
93         [ -f ${CSTK} ] && mv ${CSTK} ${CSTKO}
94
95 checkstack-clean:
96         rm -f ${CSTK} ${CSTKO}