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) LDFLAGS= 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 \
98 lustre-dkms_pre-build.sh \
99 lustre-dkms_post-build.sh \
101 LUSTRE-VERSION-FILE \
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
111 @(if test -z "$(RPMBUILD)"; then \
113 "*** Required util 'rpmbuild' missing. Please install the\n" \
114 "*** package for your distribution which provides 'rpmbuild',\n" \
115 "*** re-run configure, and try again.\n"; \
118 $(MKDIR_P) $(rpmbuilddir)/TMP && \
119 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
120 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
121 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
122 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
123 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
126 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
127 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
128 $(MAKE) $(AM_MAKEFLAGS) \
129 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
131 --define "_tmppath $$rpmbuilddir/TMP" \
132 --define "_topdir $$rpmbuilddir" \
133 --define "_sourcedir $(top_srcdir)" \
134 --with servers --with zfs -without ldiskfs \
135 --bs $(PACKAGE)-dkms.spec || exit 1; \
137 --define "_tmppath $$rpmbuilddir/TMP" \
138 --define "_topdir $$rpmbuilddir" \
139 --define "_sourcedir $(top_srcdir)" \
140 --with servers --without zfs --with ldiskfs \
141 --bs $(PACKAGE)-dkms.spec || exit 1; \
143 --define "_tmppath $$rpmbuilddir/TMP" \
144 --define "_topdir $$rpmbuilddir" \
145 --define "_sourcedir $(top_srcdir)" \
146 --with servers --with zfs --with ldiskfs \
147 --bs $(PACKAGE)-dkms.spec || exit 1; \
148 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
152 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
154 --define "_tmppath $$rpmbuilddir/TMP" \
155 --define "_topdir $$rpmbuilddir" \
156 @RPMBUILD_BINARY_ARGS@ \
157 --with servers --with zfs --without ldiskfs \
158 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
160 --define "_tmppath $$rpmbuilddir/TMP" \
161 --define "_topdir $$rpmbuilddir" \
162 @RPMBUILD_BINARY_ARGS@ \
163 --with servers --without zfs --with ldiskfs \
164 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
166 --define "_tmppath $$rpmbuilddir/TMP" \
167 --define "_topdir $$rpmbuilddir" \
168 @RPMBUILD_BINARY_ARGS@ \
169 --with servers --with zfs --with ldiskfs \
170 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
171 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
175 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
176 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
177 $(MAKE) $(AM_MAKEFLAGS) \
178 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
180 --define "_tmppath $$rpmbuilddir/TMP" \
181 --define "_topdir $$rpmbuilddir" \
182 --define "_sourcedir $(top_srcdir)" \
184 --bs $(PACKAGE)-dkms.spec || exit 1; \
185 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
189 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
191 --define "_tmppath $$rpmbuilddir/TMP" \
192 --define "_topdir $$rpmbuilddir" \
193 @RPMBUILD_BINARY_ARGS@ \
195 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
196 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
201 dkms-srpms: dkms-srpm
206 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
207 $(MAKE) $(AM_MAKEFLAGS) \
208 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
210 --define "_tmppath $$rpmbuilddir/TMP" \
211 --define "_topdir $$rpmbuilddir" \
212 @RPMBUILD_BINARY_ARGS@ \
213 --rebuild $(distdir)-*.src.rpm || exit 1; \
214 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
217 srpm: @PACKAGE_TARNAME@.spec dist Makefile
218 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
219 $(MAKE) $(AM_MAKEFLAGS) \
220 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
221 cp $(top_srcdir)/rpm/* $(top_srcdir); \
223 --define "_tmppath $$rpmbuilddir/TMP" \
224 --define "_topdir $$rpmbuilddir" \
225 --define "dist %{nil}" \
226 -ts $(distdir).tar.gz || exit 1; \
227 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
230 # In the debs target, first make sure what's in the changelog reflects
231 # the software version.
233 lversion=$$(echo @VERSION@ | tr '_' '-'); \
234 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
235 if [ "$$lversion" != "$$cversion" ]; then \
236 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; \
239 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
240 rc=$${PIPESTATUS[0]}; \
241 [ $${rc} -gt 1 ] && exit $${rc}; \
244 export KPKG_DEST_DIR="$$(pwd)/.." && \
245 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
246 rm -rf debian/tmp/modules-deb && \
247 mkdir debian/tmp/modules-deb && \
248 pushd debian/tmp/modules-deb && \
249 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
251 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
252 chmod 755 usr_src/modules/lustre/debian/rules && \
253 mkdir -p usr_share_modass && \
254 ln -s /usr/share/modass/include/ usr_share_modass/ && \
255 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
256 echo "lustre" > usr_share_modass/compliant.list && \
257 export MA_DIR=$$(pwd)/usr_share_modass && \
258 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
259 if test "x@ENABLEO2IB@" = "xno"; then \
260 export IB_OPTIONS="--with-o2ib=no"; \
262 if test -n "@O2IBPATH@"; then \
263 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
266 export KSRC_TREE=$(LINUX) && \
267 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
268 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
270 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
272 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
273 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
274 ../lustre-utils_$${VER}_*.deb \
275 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
276 ../lustre_$${VER}.tar.gz ../lustre-client-modules-$${KVERS}_$${VER}_*.deb \
280 EXTRA_DIST += debian/*
284 CSTKO=/tmp/checkstack.orig
287 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
288 { for MOD in $$(find . -name "*.ko"); do \
289 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
290 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
291 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
294 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
297 rm -f ${CSTK} ${CSTKO}