1 SUBDIRS := @LDISKFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
2 DIST_SUBDIRS := ldiskfs @SNMP_DIST_SUBDIR@ libsysio lustre-iokit @LIBCFS_SUBDIR@ lnet lustre config contrib
4 AUTOMAKE_OPTIONS = foreign
6 FIND_TAG_FILES_CMD = find $(top_srcdir) \
7 -path $(top_srcdir)/ldiskfs/linux-stage \
8 -prune -false -o -type f -name '*.[hc]'
10 # these empty rules are needed so that automake doesn't add its own
23 $(RM) $(top_srcdir)/TAGS
24 ETAGSF=`etags --version | grep -iq exuberant && \
25 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
26 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
29 $(RM) $(top_srcdir)/tags
30 CTAGSF=`ctags --version | grep -iq exuberant && \
31 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
32 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
37 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
38 $(FIND_TAG_FILES_CMD) > cscope.files
42 $(FIND_TAG_FILES_CMD) | xargs mkid
45 doxygen: doxygen-api doxygen-ref
47 doxygen-%: build/doxyfile.%
51 .PHONY: ldiskfs-sources lustre-sources
55 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
59 $(MAKE) sources -C lustre || exit $$?
64 modules: ldiskfs-sources lustre-sources module-symvers
65 $(MAKE) CC="$(CC)" $(CROSS_VARS) -C $(LINUX_OBJ) \
66 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
67 LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -I$$(srctree)/arch/$$(SRCARCH)/include/uapi -Iarch/$$(SRCARCH)/include/generated/uapi -I$$(srctree)/include/uapi -Iinclude/generated/uapi -include $(CONFIG_INCLUDE)' \
68 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
69 include/config/MARKER $@
75 find $(distdir) -name .deps -o \
79 -name .#* | xargs rm -rf
80 $(MAKE) $(AM_MAKEFLAGS) \
81 top_distdir="$(top_distdir)" distdir="$(distdir)" \
84 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
89 rpms: @PACKAGE_TARNAME@.spec dist Makefile
90 rpmbuild @RPMBUILD_BINARY_ARGS@ -ta $(distdir).tar.gz
92 srpm: @PACKAGE_TARNAME@.spec dist Makefile
93 rpmbuild @RPMBUILD_SOURCE_ARGS@ -ts $(distdir).tar.gz
95 # In the debs target, first make sure what's in the changelog reflects
96 # the software version. Here's how we could dig the version out of the
97 # autoconf version file directly:
98 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
99 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
101 # However, one cannot really run "make debs" without having done a
102 # configure first, so we could use the easier method of digging the
103 # version out of the config.h file.
105 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
106 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
107 if [ "$$lversion" != "$$cversion" ]; then \
108 echo -e "1i\nlustre ($$lversion-1) unstable; urgency=low\n\n * Automated changelog entry update\n\n -- Brian J. Murrell <brian@interlinx.bc.ca> $$(date -R)\n\n.\nwq" | ed debian/changelog; \
111 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
112 rc=$${PIPESTATUS[0]}; \
113 [ $${rc} -gt 1 ] && exit $${rc}; \
116 export KPKG_DEST_DIR="$$(pwd)/.." && \
117 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
118 rm -rf debian/tmp/modules-deb && \
119 mkdir debian/tmp/modules-deb && \
120 pushd debian/tmp/modules-deb && \
121 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
123 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
124 chmod 755 usr_src/modules/lustre/debian/rules && \
125 mkdir -p usr_share_modass && \
126 ln -s /usr/share/modass/include/ usr_share_modass/ && \
127 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
128 echo "lustre" > usr_share_modass/compliant.list && \
129 export MA_DIR=$$(pwd)/usr_share_modass && \
130 KVERS=$${KVERS:-$(LINUXRELEASE)}; \
131 m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
133 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
135 mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes ../lustre_$${VER%-[0-9]*}.orig.tar.gz ../lustre_$${VER}.diff.gz ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
137 EXTRA_DIST += config.h.in
140 EXTRA_DIST += debian/*
145 @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
146 cat @SPL_OBJ@/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
147 elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
148 cat @SPL_OBJ@/module/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
151 "*** Missing spl symbols. Ensure you have built spl:\n" \
152 "*** - @SPL_OBJ@/@SYMVERFILE@\n"; \
155 @if [ -f @ZFS_OBJ@/@ZFS_SYMBOLS@ ]; then \
156 cat @ZFS_OBJ@/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
157 elif [ -f @ZFS_OBJ@/module/@ZFS_SYMBOLS@ ]; then \
158 cat @ZFS_OBJ@/module/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
161 "*** Missing zfs symbols. Ensure you have built zfs:\n" \
162 "*** - @ZFS_OBJ@/@SYMVERFILE@\n"; \
167 module-symvers: module-symvers-zfs
170 CSTKO=/tmp/checkstack.orig
173 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
174 { for MOD in $$(find . -name "*.ko"); do \
175 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
176 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
177 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
180 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
183 rm -f ${CSTK} ${CSTKO}
186 if [ -d .git ]; then \
187 perl lustre/scripts/version_tag.pl --make_META > $(distdir)/META; \
188 elif [ -f META ]; then \
189 cp META $(distdir)/META; \
191 echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \