Whamcloud - gitweb
LU-84 Allow building against kernel devel headers with quotas
[fs/lustre-release.git] / autoMakefile.am
1 SUBDIRS := @LDISKFS_SUBDIR@ @SPL_SUBDIR@ @ZFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
2 DIST_SUBDIRS := @SNMP_DIST_SUBDIR@ libsysio ldiskfs @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre 
3 SOURCES_SUBDIRS := @LDISKFS_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
4 RPM_SUBDIRS := @LDISKFS_SUBDIR@ @LUSTREIOKIT_SUBDIR@
5 if LDISKFS_ENABLED
6 if !LDISKFS_IN_KERNEL
7 EXTRA_SOURCES := @SYMVERFILE@
8 endif
9 endif
10
11 @TESTS_TRUE@BUILD_TESTS = true
12 @TESTS_FALSE@BUILD_TESTS = false
13
14 include build/autoMakefile.am.toplevel
15
16 EXTRA_DIST += config.h.in
17
18 if USES_DPKG
19 EXTRA_DIST += debian/*
20 endif
21
22 if LDISKFS_ENABLED
23 if !LDISKFS_IN_KERNEL
24 @SYMVERFILE@: @LDISKFS_DIR@/@SYMVERFILE@
25         touch @SYMVERFILE@
26         -grep -v ldiskfs @SYMVERFILE@ > @SYMVERFILE@.old
27         cat @SYMVERFILE@.old @LDISKFS_DIR@/@SYMVERFILE@ > @SYMVERFILE@
28 endif
29 endif
30
31 CSTK=/tmp/checkstack
32 CSTKO=/tmp/checkstack.orig
33
34 checkstack:
35         [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
36         { for MOD in $$(find . -name "*.ko"); do                             \
37                 objdump -d $$MOD | perl build/checkstack.pl;                 \
38           done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
39         [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
40
41 checkstack-update:
42         [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
43
44 checkstack-clean:
45         rm -f ${CSTK} ${CSTKO}
46
47 module-dist-hook:
48         if [ -d CVS -o -d .git ]; then \
49             perl lustre/scripts/make_META.pl > $(distdir)/META; \
50             cp $(distdir)/META $(distdir)/ldiskfs/META; \
51         elif [ -f META ]; then \
52             cp META $(distdir)/META; \
53             cp $(distdir)/META $(distdir)/ldiskfs/META; \
54         else \
55             echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \
56             exit 1; \
57         fi
58         if [ -d .git ]; then \
59                 build/extract_patches $(distdir); \
60                 if grep -e "^--- .*\/autoconf" -e "^--- .*\/Makefile\.am" -e ".*\/configure\.ac" -e ".*\/configure\.in" $(distdir)/debian/patches/*; then \
61                         cp build/autogen.sh $(distdir)/build; \
62                         cp libsysio/autogen.sh $(distdir)/libsysio; \
63                         cp lustre-iokit/autogen.sh $(distdir)/lustre-iokit; \
64                 fi; \
65                 mkdir empty; \
66                 diff -urN empty $(distdir)/debian > debian.diff; \
67                 rm -rf $(distdir)/debian; \
68                 rmdir empty; \
69         fi