1 SUBDIRS := @LDISKFS_SUBDIR@ \
9 DIST_SUBDIRS := ldiskfs \
17 AUTOMAKE_OPTIONS = foreign
19 FIND_TAG_FILES_CMD = find $(top_srcdir) \
20 -path $(top_srcdir)/ldiskfs/linux-stage \
21 -prune -false -o -type f -name '*.[hc]'
23 # these empty rules are needed so that automake doesn't add its own
36 $(RM) $(top_srcdir)/TAGS
37 ETAGSF=`etags --version | grep -iq exuberant && \
38 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
39 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
42 $(RM) $(top_srcdir)/tags
43 CTAGSF=`ctags --version | grep -iq exuberant && \
44 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
45 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
50 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
51 $(FIND_TAG_FILES_CMD) > cscope.files
55 $(FIND_TAG_FILES_CMD) | xargs mkid
58 doxygen: doxygen-api doxygen-ref
60 doxygen-%: build/doxyfile.%
64 .PHONY: ldiskfs-sources
68 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
74 modules: undef.h ldiskfs-sources
75 $(MAKE) CC="$(CC)" -C $(LINUX_OBJ) \
76 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
77 LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -Iarch/$$(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)' \
78 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
79 include/config/MARKER $@
85 grep -v config.h.in config.h.in > $@
88 find $(distdir) -name .deps -o \
92 -name .#* -exec rm -rf {} \;
94 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
99 lustre-dkms_pre-build.sh \
100 lustre-dkms_post-build.sh \
104 # contrib is a directory. Putting a directory in EXTRA_DIST
105 # recursively includes the entire directory contents in the
106 # distribution tarball (the tarball created with "make dist").
107 EXTRA_DIST += contrib
110 @(if test -z "$(RPMBUILD)"; then \
112 "*** Required util 'rpmbuild' missing. Please install the\n" \
113 "*** package for your distribution which provides 'rpmbuild',\n" \
114 "*** re-run configure, and try again.\n"; \
117 $(MKDIR_P) $(rpmbuilddir)/TMP && \
118 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
119 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
120 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
121 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
122 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
125 DKMS_PACKAGE=$(PACKAGE)
126 DKMS_SERVER=--with servers
128 DKMS_PACKAGE=$(PACKAGE)-client
129 DKMS_SERVER=--without servers
132 # Only zfs Lustre DKMS Server is supported, so previous configure command
133 # must use related parameters for success.
134 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
135 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
136 $(MAKE) $(AM_MAKEFLAGS) \
137 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
139 --define "_tmppath $$rpmbuilddir/TMP" \
140 --define "_topdir $$rpmbuilddir" \
141 --define "_sourcedir $(top_srcdir)" \
143 --bs $(PACKAGE)-dkms.spec || exit 1; \
144 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
148 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
150 --define "_tmppath $$rpmbuilddir/TMP" \
151 --define "_topdir $$rpmbuilddir" \
152 @RPMBUILD_BINARY_ARGS@ \
153 --rebuild $(DKMS_PACKAGE)-dkms-*.src.rpm || exit 1; \
154 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
158 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
159 $(MAKE) $(AM_MAKEFLAGS) \
160 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
162 --define "_tmppath $$rpmbuilddir/TMP" \
163 --define "_topdir $$rpmbuilddir" \
164 @RPMBUILD_BINARY_ARGS@ \
165 --rebuild $(distdir)-*.src.rpm || exit 1; \
166 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
169 srpm: @PACKAGE_TARNAME@.spec dist Makefile
170 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
171 $(MAKE) $(AM_MAKEFLAGS) \
172 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
174 --define "_tmppath $$rpmbuilddir/TMP" \
175 --define "_topdir $$rpmbuilddir" \
176 --define "build_src_rpm 1" \
177 --define "dist %{nil}" \
178 -ts $(distdir).tar.gz || exit 1; \
179 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
182 # In the debs target, first make sure what's in the changelog reflects
183 # the software version.
185 lversion=$$(echo @VERSION@ | tr '_' '-'); \
186 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
187 if [ "$$lversion" != "$$cversion" ]; then \
188 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; \
191 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
192 rc=$${PIPESTATUS[0]}; \
193 [ $${rc} -gt 1 ] && exit $${rc}; \
196 export KPKG_DEST_DIR="$$(pwd)/.." && \
197 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
198 rm -rf debian/tmp/modules-deb && \
199 mkdir debian/tmp/modules-deb && \
200 pushd debian/tmp/modules-deb && \
201 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
203 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
204 chmod 755 usr_src/modules/lustre/debian/rules && \
205 mkdir -p usr_share_modass && \
206 ln -s /usr/share/modass/include/ usr_share_modass/ && \
207 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
208 echo "lustre" > usr_share_modass/compliant.list && \
209 export MA_DIR=$$(pwd)/usr_share_modass && \
210 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
211 if test "x@ENABLEO2IB@" = "xno"; then \
212 export IB_OPTIONS="--with-o2ib=no"; \
214 if test -n "@O2IBPATH@"; then \
215 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
218 export KSRC_TREE=$(LINUX) && \
219 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
220 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
222 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
224 mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb \
225 ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb \
226 ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \
227 ../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \
228 ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
231 EXTRA_DIST += debian/*
235 CSTKO=/tmp/checkstack.orig
238 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
239 { for MOD in $$(find . -name "*.ko"); do \
240 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
241 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
242 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
245 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
248 rm -f ${CSTK} ${CSTKO}