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)$$(building_out_of_srctree),-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 $@
87 grep -v config.h.in config.h.in > $@
90 find $(distdir) -name .deps -o \
94 -name .#* -exec rm -rf {} \;
96 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
100 lustre-dkms_pre-build.sh \
101 lustre-dkms_post-build.sh \
103 LUSTRE-VERSION-FILE \
106 config/lustre-version.m4
108 # contrib is a directory. Putting a directory in EXTRA_DIST
109 # recursively includes the entire directory contents in the
110 # distribution tarball (the tarball created with "make dist").
111 EXTRA_DIST += contrib
115 @(if test -z "$(RPMBUILD)"; then \
117 "*** Required util 'rpmbuild' missing. Please install the\n" \
118 "*** package for your distribution which provides 'rpmbuild',\n" \
119 "*** re-run configure, and try again.\n"; \
122 $(MKDIR_P) $(rpmbuilddir)/TMP && \
123 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
124 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
125 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
126 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
127 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
130 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
131 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
132 $(MAKE) $(AM_MAKEFLAGS) \
133 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
135 --define "_tmppath $$rpmbuilddir/TMP" \
136 --define "_topdir $$rpmbuilddir" \
137 --define "_sourcedir $(top_srcdir)" \
138 --with servers --with zfs -without ldiskfs \
139 --bs $(PACKAGE)-dkms.spec || exit 1; \
141 --define "_tmppath $$rpmbuilddir/TMP" \
142 --define "_topdir $$rpmbuilddir" \
143 --define "_sourcedir $(top_srcdir)" \
144 --with servers --without zfs --with ldiskfs \
145 --bs $(PACKAGE)-dkms.spec || exit 1; \
147 --define "_tmppath $$rpmbuilddir/TMP" \
148 --define "_topdir $$rpmbuilddir" \
149 --define "_sourcedir $(top_srcdir)" \
150 --with servers --with zfs --with ldiskfs \
151 --bs $(PACKAGE)-dkms.spec || exit 1; \
152 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
156 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
158 --define "_tmppath $$rpmbuilddir/TMP" \
159 --define "_topdir $$rpmbuilddir" \
160 @RPMBUILD_BINARY_ARGS@ \
161 --with servers --with zfs --without ldiskfs \
162 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
164 --define "_tmppath $$rpmbuilddir/TMP" \
165 --define "_topdir $$rpmbuilddir" \
166 @RPMBUILD_BINARY_ARGS@ \
167 --with servers --without zfs --with ldiskfs \
168 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
170 --define "_tmppath $$rpmbuilddir/TMP" \
171 --define "_topdir $$rpmbuilddir" \
172 @RPMBUILD_BINARY_ARGS@ \
173 --with servers --with zfs --with ldiskfs \
174 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
175 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
179 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
180 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
181 $(MAKE) $(AM_MAKEFLAGS) \
182 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
184 --define "_tmppath $$rpmbuilddir/TMP" \
185 --define "_topdir $$rpmbuilddir" \
186 --define "_sourcedir $(top_srcdir)" \
188 --bs $(PACKAGE)-dkms.spec || exit 1; \
189 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
193 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
195 --define "_tmppath $$rpmbuilddir/TMP" \
196 --define "_topdir $$rpmbuilddir" \
197 @RPMBUILD_BINARY_ARGS@ \
199 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
200 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
205 dkms-srpms: dkms-srpm
210 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
211 $(MAKE) $(AM_MAKEFLAGS) \
212 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
214 --define "_tmppath $$rpmbuilddir/TMP" \
215 --define "_topdir $$rpmbuilddir" \
216 @RPMBUILD_BINARY_ARGS@ \
217 --rebuild $(distdir)-*.src.rpm || exit 1; \
218 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
221 srpm: @PACKAGE_TARNAME@.spec dist Makefile
222 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
223 $(MAKE) $(AM_MAKEFLAGS) \
224 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
225 cp $(top_srcdir)/rpm/* $(top_srcdir); \
227 --define "_tmppath $$rpmbuilddir/TMP" \
228 --define "_topdir $$rpmbuilddir" \
229 --define "dist %{nil}" \
230 -ts $(distdir).tar.gz || exit 1; \
231 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
234 # In the debs target, first make sure what's in the changelog reflects
235 # the software version.
237 cp -v debian/changelog.in debian/changelog ; \
238 lversion=$$(echo @VERSION@ | tr '_' '-'); \
239 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
240 if [ "$$lversion" != "$$cversion" ]; then \
241 echo -e "1i\nlustre ($$lversion-1) unstable; urgency=low\n\n * Automated changelog entry update\n\n -- Andreas Dilger <adilger@whamcloud.com> $$(date -R)\n\n.\nwq" | ed debian/changelog; \
244 if test "x@ENABLE_SERVER@" = "xyes"; then \
245 DEB_BUILD_PROFILES="server"; \
247 DEB_BUILD_PROFILES="client"; \
249 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
250 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
252 if test "x@ENABLE_ZFS@" = "xyes"; then \
253 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
254 export SPL_SRC="@SPL@"; \
255 export ZFS_SRC="@ZFS@"; \
256 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
257 echo "SPL: $${SPL_SRC}"; \
258 echo "ZFS: $${ZFS_SRC}"; \
260 if test "x@ENABLEO2IB@" != "xno"; then \
261 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
262 export O2IB_SRC="@O2IBPATH@"; \
264 if test "x@ENABLE_GSS@" = "xyes"; then \
265 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
266 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
267 cp debian/control $$debiantmp/control.bkp ; \
268 cp debian/control.main $$debiantmp/control.main.bkp ; \
269 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
270 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
271 awk 'BEGIN{change=0} $$1 == "Package:" {if (($$2 == "lustre-client-utils") || ($$2 == "lustre-server-utils")) change=1; else change=0; fi } {if (($$1 == "Depends:") && change) print $$0 ", libgssapi-krb5-2, libkrb5-3, libssl1.1"; else print; fi}' debian/control.main > $$debiantmp/control.main && mv $$debiantmp/control.main debian/control.main ; \
272 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
273 elif test "x@ENABLE_GSS@" = "xno"; then \
274 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
276 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
277 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
278 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
279 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
281 if test "x@systemdsystemunitdir@" != "x"; then \
282 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
284 export KERNEL_OBJ="$(LINUX_OBJ)"; \
285 export KERNEL_SRC="$(LINUX)"; \
286 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
287 echo "Kernel Source: $${KERNEL_SRC}"; \
288 echo "Kernel Object: $${KERNEL_OBJ}"; \
289 if test "x@ENABLEO2IB@" = "xno"; then \
290 export IB_OPTIONS="--with-o2ib=no"; \
292 if test "x@ENABLEO2IB@" != "xyes" && \
293 test -n "@O2IBPATH@"; then \
294 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
296 export IB_OPTIONS="--with-o2ib=yes"; \
299 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
300 rc=$${PIPESTATUS[0]}; \
301 cp $$debiantmp/control.bkp debian/control || true && \
302 cp $$debiantmp/control.main.bkp debian/control.main || true && \
303 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
304 [ $${rc} -gt 1 ] && exit $${rc}; \
307 cp $$debiantmp/control.bkp debian/control || true && \
308 cp $$debiantmp/control.main.bkp debian/control.main || true && \
309 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
310 export KPKG_DEST_DIR="$$(pwd)/.." && \
311 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
312 rm -rf debian/tmp/modules-deb && \
313 mkdir debian/tmp/modules-deb && \
314 pushd debian/tmp/modules-deb && \
315 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
317 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
318 chmod 755 usr_src/modules/lustre/debian/rules && \
319 mkdir -p usr_share_modass && \
320 ln -s /usr/share/modass/include/ usr_share_modass/ && \
321 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
322 echo "lustre" > usr_share_modass/compliant.list && \
323 export MA_DIR=$$(pwd)/usr_share_modass && \
324 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
325 export KSRC_TREE=$(LINUX) && \
326 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
327 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
329 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
330 if test "x@ENABLE_SERVER@" = "xyes"; then \
331 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
334 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
335 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
336 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \
337 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
338 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
342 cp -v debian/changelog.in debian/changelog ; \
343 lversion=$$(echo @VERSION@ | tr '_' '-'); \
344 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
345 if [ "$$lversion" != "$$cversion" ]; then \
346 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; \
349 export DEB_BUILD_PROFILES="client"; \
350 export KERNEL_OBJ="$(LINUX_OBJ)"; \
351 export KERNEL_SRC="$(LINUX)"; \
352 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
353 echo "Kernel Source: $${KERNEL_SRC}"; \
354 echo "Kernel Object: $${KERNEL_OBJ}"; \
355 export BUILD_DKMS="true" && \
356 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
357 rc=$${PIPESTATUS[0]}; \
358 [ $${rc} -gt 1 ] && exit $${rc}; \
361 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
363 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
364 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
365 ../lustre-*-utils_$${VER}_*.deb \
366 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
367 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
370 EXTRA_DIST += debian/*
373 CSTKO=/tmp/checkstack.orig
376 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
377 { for MOD in $$(find . -name "*.ko"); do \
378 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
379 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
380 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
383 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
386 rm -f ${CSTK} ${CSTKO}