1 # SPDX-License-Identifier: GPL-2.0
4 # This file is part of Lustre, http://www.lustre.org/
8 # Used by automake to create the top-level autoMakefile.in,
9 # which is used by config.status to create the top-level
13 SUBDIRS := @LDISKFS_SUBDIR@ \
15 @LUSTREIOKIT_SUBDIR@ \
20 DIST_SUBDIRS := ldiskfs \
27 AUTOMAKE_OPTIONS = foreign
29 if DEQUOTE_CC_VERSION_TEXT
33 FIND_TAG_FILES_CMD = find $(top_srcdir) \
34 -path $(top_srcdir)/ldiskfs/linux-stage \
35 -prune -false -o -type f -name '*.[hc]'
38 @echo 'Cleaning targets:'
39 @echo ' clean - Remove generated object files but keep the files'
40 @echo ' generated by autotools; use `git clean -xdf` to'
41 @echo ' purge all files not tracked by git'
43 @echo 'Generic targets:'
44 @echo ' all - Build all modules and utilities enabled by'
46 @echo ' checkpatch - Run checkpatch.pl on latest commit'
47 @echo ' checkstack - Run checkstack.pl'
48 @echo ' checkstack-update - Update checkstack.pl'
49 @echo ' checkstack-clean - Remove checkstack.pl artifacts'
51 @echo 'Packaging targets:'
52 @echo ' rpms - Create RPM packages'
53 @echo ' srpm - Create source RPM packages'
54 @echo ' dkms-rpm - Create DKMS RPM packages'
55 @echo ' dkms-srpm - Create source DKMS RPM packages'
56 @echo ' debs - Create Debian packages'
57 @echo ' dkms-debs - Create DKMS Debian packages'
60 @git diff HEAD~1 | ./contrib/scripts/checkpatch.pl
62 # these empty rules are needed so that automake doesn't add its own
75 $(RM) $(top_srcdir)/TAGS
76 ETAGSF=`etags --version | grep -iq exuberant && \
77 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
78 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
81 $(RM) $(top_srcdir)/tags
82 CTAGSF=`ctags --version | grep -iq exuberant && \
83 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
84 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
89 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
90 $(FIND_TAG_FILES_CMD) > cscope.files
94 $(FIND_TAG_FILES_CMD) | xargs mkid
98 .PHONY: ldiskfs-sources
102 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
105 $(MAKE) sources -C lnet/klnds/in-kernel-o2iblnd || exit $$?
111 modules: undef.h ldiskfs-sources
112 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
113 KBUILD_EXTRA_SYMBOLS="@INT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
114 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
115 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
116 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)' \
117 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
118 include/config/MARKER $@
120 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) BUILD_EXT_O2IB=yes \
121 KBUILD_EXTRA_SYMBOLS="$(PWD)/Module.symvers @EXT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
122 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
123 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
124 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)' \
125 $(MODULE_TARGET)=$(PWD)/lnet/klnds/o2iblnd -o tmp_include_depends -o scripts -o \
126 include/config/MARKER $@
127 endif # EXTERNAL_KO2IBLND
134 # compiler plugins should be built as soon as possible,
135 # so they can be available to the rest of the build
139 $(MAKE) all -C cc-plugins
143 grep -v config.h.in config.h.in > $@
146 find $(distdir) -name .deps -o \
150 -name .#* -exec rm -rf {} \;
152 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
156 lustre-dkms_pre-build.sh \
157 lustre-dkms_post-build.sh \
159 LUSTRE-VERSION-FILE \
163 config/lustre-version.m4
165 # contrib is a directory. Putting a directory in EXTRA_DIST
166 # recursively includes the entire directory contents in the
167 # distribution tarball (the tarball created with "make dist").
168 EXTRA_DIST += contrib
172 @(if test -z "$(RPMBUILD)"; then \
174 "*** Required util 'rpmbuild' missing. Please install the\n" \
175 "*** package for your distribution which provides 'rpmbuild',\n" \
176 "*** re-run configure, and try again.\n"; \
179 $(MKDIR_P) $(rpmbuilddir)/TMP && \
180 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
181 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
182 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
183 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
184 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
187 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
188 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
189 $(MAKE) $(AM_MAKEFLAGS) \
190 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
192 --define "_tmppath $$rpmbuilddir/TMP" \
193 --define "_topdir $$rpmbuilddir" \
194 --define "_sourcedir $(top_srcdir)" \
195 --with servers --with zfs -without ldiskfs \
196 --bs $(PACKAGE)-dkms.spec || exit 1; \
198 --define "_tmppath $$rpmbuilddir/TMP" \
199 --define "_topdir $$rpmbuilddir" \
200 --define "_sourcedir $(top_srcdir)" \
201 --with servers --without zfs --with ldiskfs \
202 --bs $(PACKAGE)-dkms.spec || exit 1; \
204 --define "_tmppath $$rpmbuilddir/TMP" \
205 --define "_topdir $$rpmbuilddir" \
206 --define "_sourcedir $(top_srcdir)" \
207 --with servers --with zfs --with ldiskfs \
208 --bs $(PACKAGE)-dkms.spec || exit 1; \
209 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
213 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
215 --define "_tmppath $$rpmbuilddir/TMP" \
216 --define "_topdir $$rpmbuilddir" \
217 @RPMBUILD_BINARY_ARGS@ \
218 --with servers --with zfs --without ldiskfs \
219 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
221 --define "_tmppath $$rpmbuilddir/TMP" \
222 --define "_topdir $$rpmbuilddir" \
223 @RPMBUILD_BINARY_ARGS@ \
224 --with servers --without zfs --with ldiskfs \
225 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
227 --define "_tmppath $$rpmbuilddir/TMP" \
228 --define "_topdir $$rpmbuilddir" \
229 @RPMBUILD_BINARY_ARGS@ \
230 --with servers --with zfs --with ldiskfs \
231 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
232 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
236 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
237 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
238 $(MAKE) $(AM_MAKEFLAGS) \
239 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
241 --define "_tmppath $$rpmbuilddir/TMP" \
242 --define "_topdir $$rpmbuilddir" \
243 --define "_sourcedir $(top_srcdir)" \
245 --bs $(PACKAGE)-dkms.spec || exit 1; \
246 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
250 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
252 --define "_tmppath $$rpmbuilddir/TMP" \
253 --define "_topdir $$rpmbuilddir" \
254 @RPMBUILD_BINARY_ARGS@ \
256 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
257 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
262 dkms-srpms: dkms-srpm
267 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
268 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
269 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
271 $(MAKE) $(AM_MAKEFLAGS) \
272 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
274 --define "_tmppath $$rpmbuilddir/TMP" \
275 --define "_topdir $$rpmbuilddir" \
276 @RPMBUILD_BINARY_ARGS@ \
277 --rebuild $(distdir)-*.src.rpm || exit 1; \
278 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
281 srpm: @PACKAGE_TARNAME@.spec dist Makefile
282 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
283 $(MAKE) $(AM_MAKEFLAGS) \
284 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
285 cp $(top_srcdir)/rpm/* $(top_srcdir); \
287 --define "_tmppath $$rpmbuilddir/TMP" \
288 --define "_topdir $$rpmbuilddir" \
289 --define "dist %{nil}" \
290 -ts $(distdir).tar.gz || exit 1; \
291 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
295 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
296 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
297 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
298 echo "************************************************************" ; \
299 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
300 echo "************************************************************" ; \
303 # In the debs target, first make sure what's in the changelog reflects
304 # the software version.
305 debs: undef.h debs_common
306 cp -v debian/changelog.in debian/changelog ; \
307 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
308 lversion=$$(echo @VERSION@ | tr '_' '-'); \
309 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
310 if [ "$$lversion" != "$$cversion" ]; then \
311 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; \
314 if test "x@ENABLE_SERVER@" = "xyes"; then \
315 DEB_BUILD_PROFILES="server"; \
317 DEB_BUILD_PROFILES="client"; \
319 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
320 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
322 if test "x@ENABLE_ZFS@" = "xyes"; then \
323 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
324 export SPL_SRC="@SPL@"; \
325 export ZFS_SRC="@ZFS@"; \
326 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
327 echo "SPL: $${SPL_SRC}"; \
328 echo "ZFS: $${ZFS_SRC}"; \
330 if test "x@ENABLEO2IB@" != "xno"; then \
331 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
332 export O2IB_SRC="@O2IBPATH@"; \
334 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
335 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
337 if test "x@ENABLE_GSS@" = "xyes"; then \
338 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
339 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
340 cp debian/control $$debiantmp/control.bkp ; \
341 cp debian/control.main $$debiantmp/control.main.bkp ; \
342 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
343 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
344 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|libssl3"; else print; fi}' debian/control.main > $$debiantmp/control.main && mv $$debiantmp/control.main debian/control.main ; \
345 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
346 elif test "x@ENABLE_GSS@" = "xno"; then \
347 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
349 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
350 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
351 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
352 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
354 if test "x@systemdsystemunitdir@" != "x"; then \
355 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
357 if test "x@ENABLE_PINGER@" = "xyes"; then \
358 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
359 elif test "x@ENABLE_PINGER@" = "xno"; then \
360 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
362 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
363 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
364 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
365 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
367 if test "x@ENABLE_FLOCK@" = "xyes"; then \
368 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
369 elif test "x@ENABLE_FLOCK@" = "xno"; then \
370 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
372 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
373 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
374 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
375 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
377 if test "x@ENABLE_MINDF@" = "xyes"; then \
378 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
379 elif test "x@ENABLE_MINDF@" = "xno"; then \
380 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
382 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
383 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
384 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
385 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
387 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
388 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
389 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
390 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
392 if test "x@ENABLE_LU_REF@" = "xyes"; then \
393 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
394 elif test "x@ENABLE_LU_REF@" = "xno"; then \
395 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
397 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
398 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
399 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
400 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
402 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
403 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
404 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
405 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
407 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
408 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
409 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
410 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
412 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
413 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
414 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
415 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
417 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
418 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
419 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
420 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
422 if test "x@ENABLE_READLINE@" = "xyes"; then \
423 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
424 elif test "x@ENABLE_READLINE@" = "xno"; then \
425 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
427 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
428 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
429 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
430 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
432 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
433 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
434 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
435 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
437 if test "x@ENABLE_GNI@" = "xyes"; then \
438 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gni"; \
439 elif test "x@ENABLE_GNI@" = "xno"; then \
440 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogni"; \
442 if test "x@ENABLE_EFENCE@" = "xyes"; then \
443 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
444 elif test "x@ENABLE_EFENCE@" = "xno"; then \
445 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
447 export KERNEL_OBJ="$(LINUX_OBJ)"; \
448 export KERNEL_SRC="$(LINUX)"; \
449 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
450 echo "Kernel Source: $${KERNEL_SRC}"; \
451 echo "Kernel Object: $${KERNEL_OBJ}"; \
452 if test "x@ENABLEO2IB@" = "xno"; then \
453 export IB_OPTIONS="--with-o2ib=no"; \
455 if test "x@ENABLEO2IB@" != "xyes" && \
456 test -n "@O2IBPATH@"; then \
457 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
459 export IB_OPTIONS="--with-o2ib=yes"; \
462 sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \
463 > debian/lustre-tests.install; \
464 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
465 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
466 rc=$${PIPESTATUS[0]}; \
467 cp $$debiantmp/control.bkp debian/control || true && \
468 cp $$debiantmp/control.main.bkp debian/control.main || true && \
469 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
470 [ $${rc} -gt 1 ] && exit $${rc}; \
473 cp $$debiantmp/control.bkp debian/control || true && \
474 cp $$debiantmp/control.main.bkp debian/control.main || true && \
475 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
476 export KPKG_DEST_DIR="$$(pwd)/.." && \
477 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
478 rm -rf debian/tmp/modules-deb && \
479 mkdir debian/tmp/modules-deb && \
480 pushd debian/tmp/modules-deb && \
481 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
483 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
484 chmod 755 usr_src/modules/lustre/debian/rules && \
485 mkdir -p usr_share_modass && \
486 ln -s /usr/share/modass/include/ usr_share_modass/ && \
487 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
488 echo "lustre" > usr_share_modass/compliant.list && \
489 export MA_DIR=$$(pwd)/usr_share_modass && \
490 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
491 export KSRC_TREE=$(LINUX) && \
492 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
493 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
494 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
496 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
497 if test "x@ENABLE_SERVER@" = "xyes"; then \
498 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
501 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
502 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
503 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \
504 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
505 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
506 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
509 dkms-debs: undef.h debs_common
510 cp -v debian/changelog.in debian/changelog ; \
511 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
512 lversion=$$(echo @VERSION@ | tr '_' '-'); \
513 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
514 if [ "$$lversion" != "$$cversion" ]; then \
515 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; \
518 export DEB_BUILD_PROFILES="client"; \
519 export KERNEL_OBJ="$(LINUX_OBJ)"; \
520 export KERNEL_SRC="$(LINUX)"; \
521 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
522 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
523 echo "Kernel Source: $${KERNEL_SRC}"; \
524 echo "Kernel Object: $${KERNEL_OBJ}"; \
525 export BUILD_DKMS="true" && \
526 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
527 rc=$${PIPESTATUS[0]}; \
528 [ $${rc} -gt 1 ] && exit $${rc}; \
531 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
533 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
534 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
535 ../lustre-*-utils_$${VER}_*.deb \
536 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
537 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
538 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
541 EXTRA_DIST += debian/*
544 CSTKO=/tmp/checkstack.orig
547 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
548 { for MOD in $$(find . -name "*.ko"); do \
549 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
550 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
551 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
554 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
557 rm -f ${CSTK} ${CSTKO}