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 \
28 AUTOMAKE_OPTIONS = foreign
30 if DEQUOTE_CC_VERSION_TEXT
58 FIND_TAG_FILES_CMD = find $(top_srcdir) \
59 -path $(top_srcdir)/ldiskfs/linux-stage \
60 -prune -false -o -type f -name '*.[hc]'
63 @echo 'Cleaning targets:'
64 @echo ' clean - Remove generated object files but keep the files'
65 @echo ' generated by autotools; use `git clean -xdf` to'
66 @echo ' purge all files not tracked by git'
68 @echo 'Generic targets:'
69 @echo ' all - Build all modules and utilities enabled by'
71 @echo ' utils - Build only userspace utilities'
72 @echo ' checkpatch - Run checkpatch.pl on latest commit'
73 @echo ' checkstack - Run checkstack.pl'
74 @echo ' checkstack-update - Update checkstack.pl'
75 @echo ' checkstack-clean - Remove checkstack.pl artifacts'
77 @echo 'Packaging targets:'
78 @echo ' rpms - Create RPM packages'
79 @echo ' srpm - Create source RPM packages'
80 @echo ' dkms-rpm - Create DKMS RPM packages'
81 @echo ' dkms-srpm - Create source DKMS RPM packages'
82 @echo ' debs - Create Debian packages'
83 @echo ' dkms-debs - Create DKMS Debian packages'
86 @git diff HEAD~1 | ./contrib/scripts/checkpatch.pl
89 $(MAKE) -C libcfs/libcfs/util
91 $(MAKE) -C lustre/utils
93 # these empty rules are needed so that automake doesn't add its own
106 $(RM) $(top_srcdir)/TAGS
107 ETAGSF=`etags --version | grep -iq exuberant && \
108 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
109 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
112 $(RM) $(top_srcdir)/tags
113 CTAGSF=`ctags --version | grep -iq exuberant && \
114 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
115 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
120 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
121 $(FIND_TAG_FILES_CMD) > cscope.files
125 $(FIND_TAG_FILES_CMD) | xargs mkid
129 .PHONY: ldiskfs-sources
133 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
136 $(MAKE) sources -C lnet/klnds/in-kernel-o2iblnd || exit $$?
142 modules: undef.h ldiskfs-sources
143 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
144 KBUILD_EXTRA_SYMBOLS="@INT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
145 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
146 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
147 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)' \
148 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
149 include/config/MARKER $@
151 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) BUILD_EXT_O2IB=yes \
152 KBUILD_EXTRA_SYMBOLS="$(PWD)/Module.symvers @EXT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
153 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
154 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
155 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)' \
156 $(MODULE_TARGET)=$(PWD)/lnet/klnds/o2iblnd -o tmp_include_depends -o scripts -o \
157 include/config/MARKER $@
158 endif # EXTERNAL_KO2IBLND
165 # compiler plugins should be built as soon as possible,
166 # so they can be available to the rest of the build
170 $(MAKE) all -C cc-plugins
174 grep -v config.h.in config.h.in > $@
177 find $(distdir) -name .deps -o \
181 -name .#* -exec rm -rf {} \;
183 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
187 lustre-dkms_pre-build.sh \
188 lustre-dkms_post-build.sh \
190 LUSTRE-VERSION-FILE \
194 config/lustre-version.m4
196 # contrib is a directory. Putting a directory in EXTRA_DIST
197 # recursively includes the entire directory contents in the
198 # distribution tarball (the tarball created with "make dist").
199 EXTRA_DIST += contrib
203 @(if test -z "$(RPMBUILD)"; then \
205 "*** Required util 'rpmbuild' missing. Please install the\n" \
206 "*** package for your distribution which provides 'rpmbuild',\n" \
207 "*** re-run configure, and try again.\n"; \
210 $(MKDIR_P) $(rpmbuilddir)/TMP && \
211 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
212 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
213 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
214 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
215 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
218 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
219 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
220 $(MAKE) $(AM_MAKEFLAGS) \
221 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
223 --define "_tmppath $$rpmbuilddir/TMP" \
224 --define "_topdir $$rpmbuilddir" \
225 --define "_sourcedir $(top_srcdir)" \
226 --with servers --with zfs -without ldiskfs \
227 --bs $(PACKAGE)-dkms.spec || exit 1; \
229 --define "_tmppath $$rpmbuilddir/TMP" \
230 --define "_topdir $$rpmbuilddir" \
231 --define "_sourcedir $(top_srcdir)" \
232 --with servers --without zfs --with ldiskfs \
233 --bs $(PACKAGE)-dkms.spec || exit 1; \
235 --define "_tmppath $$rpmbuilddir/TMP" \
236 --define "_topdir $$rpmbuilddir" \
237 --define "_sourcedir $(top_srcdir)" \
238 --with servers --with zfs --with ldiskfs \
239 --bs $(PACKAGE)-dkms.spec || exit 1; \
240 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
244 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
246 --define "_tmppath $$rpmbuilddir/TMP" \
247 --define "_topdir $$rpmbuilddir" \
248 @RPMBUILD_BINARY_ARGS@ \
249 --with servers --with zfs --without ldiskfs \
250 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
252 --define "_tmppath $$rpmbuilddir/TMP" \
253 --define "_topdir $$rpmbuilddir" \
254 @RPMBUILD_BINARY_ARGS@ \
255 --with servers --without zfs --with ldiskfs \
256 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
258 --define "_tmppath $$rpmbuilddir/TMP" \
259 --define "_topdir $$rpmbuilddir" \
260 @RPMBUILD_BINARY_ARGS@ \
261 --with servers --with zfs --with ldiskfs \
262 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
263 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
267 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
268 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
269 $(MAKE) $(AM_MAKEFLAGS) \
270 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
272 --define "_tmppath $$rpmbuilddir/TMP" \
273 --define "_topdir $$rpmbuilddir" \
274 --define "_sourcedir $(top_srcdir)" \
276 --bs $(PACKAGE)-dkms.spec || exit 1; \
277 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
281 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
283 --define "_tmppath $$rpmbuilddir/TMP" \
284 --define "_topdir $$rpmbuilddir" \
285 @RPMBUILD_BINARY_ARGS@ \
287 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
288 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
293 dkms-srpms: dkms-srpm
298 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
299 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
300 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
302 $(MAKE) $(AM_MAKEFLAGS) \
303 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
305 --define "_tmppath $$rpmbuilddir/TMP" \
306 --define "_topdir $$rpmbuilddir" \
307 @RPMBUILD_BINARY_ARGS@ \
308 --rebuild $(distdir)-*.src.rpm || exit 1; \
309 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
312 srpm: @PACKAGE_TARNAME@.spec dist Makefile
313 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
314 $(MAKE) $(AM_MAKEFLAGS) \
315 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
316 cp $(top_srcdir)/rpm/* $(top_srcdir); \
318 --define "_tmppath $$rpmbuilddir/TMP" \
319 --define "_topdir $$rpmbuilddir" \
320 --define "dist %{nil}" \
321 -ts $(distdir).tar.gz || exit 1; \
322 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
326 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
327 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
328 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
329 echo "************************************************************" ; \
330 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
331 echo "************************************************************" ; \
334 # In the debs target, first make sure what's in the changelog reflects
335 # the software version.
336 debs: undef.h debs_common
337 cp -v debian/changelog.in debian/changelog ; \
338 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
339 lversion=$$(echo @VERSION@ | tr '_' '-'); \
340 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
341 if [ "$$lversion" != "$$cversion" ]; then \
342 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; \
345 if test "x@ENABLE_SERVER@" = "xyes"; then \
346 DEB_BUILD_PROFILES="server"; \
348 DEB_BUILD_PROFILES="client"; \
350 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
351 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
353 if test "x@ENABLE_ZFS@" = "xyes"; then \
354 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
355 export SPL_SRC="@SPL@"; \
356 export ZFS_SRC="@ZFS@"; \
357 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
358 echo "SPL: $${SPL_SRC}"; \
359 echo "ZFS: $${ZFS_SRC}"; \
361 if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \
362 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} multiple-lnds"; \
364 if test "x@ENABLE_GNI@" = "xyes"; then \
365 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gnilnd"; \
367 if test "x@KFILND@" = "xkfilnd"; then \
368 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} kfilnd"; \
370 if test "x@DPKG_EXT_O2IB@" != "x"; then \
371 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ext_o2ib"; \
372 export O2IB_SRC="@EXT_O2IBPATH@"; \
374 if test "x@DPKG_INT_O2IB@" != "x"; then \
375 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} int_o2ib"; \
377 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
378 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
380 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
381 cp debian/control.main $$debiantmp/control.main.bkp ; \
382 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
383 if test "x@ENABLE_GSS@" = "xyes"; then \
384 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
385 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
386 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 ; \
387 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
388 elif test "x@ENABLE_GSS@" = "xno"; then \
389 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
391 if test "x$(ENABLE_MPITESTS)" = "xyes"; then \
392 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mpitests"; \
393 elif test "x$(ENABLE_MPITESTS)" = "xno"; then \
394 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nompitests"; \
395 sed -i -e 's/mpi-default-dev,//' -e 's/mpi-default-bin,//' debian/control.main ; \
397 if test "x$(ENABLE_TESTS)" = "xyes"; then \
398 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} tests"; \
399 elif test "x$(ENABLE_TESTS)" = "xno"; then \
400 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} notests"; \
401 sed -i -e 's/mpi-default-dev,//' -e 's/mpi-default-bin,//' debian/control.main ; \
403 if test "x$(ENABLE_IOKIT)" = "xyes"; then \
404 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} iokit"; \
405 elif test "x$(ENABLE_IOKIT)" = "xno"; then \
406 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noiokit"; \
408 if test "x$(ENABLE_UTILS)" = "xyes"; then \
409 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} utils"; \
410 elif test "x$(ENABLE_UTILS)" = "xno"; then \
411 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noutils"; \
413 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
414 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
415 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
416 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
418 if test "x@systemdsystemunitdir@" != "x"; then \
419 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
420 export SYSTEMD_OPTIONS="--with-systemdsystemunitdir=@systemdsystemunitdir@"; \
422 if test "x@ENABLE_PINGER@" = "xyes"; then \
423 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
424 elif test "x@ENABLE_PINGER@" = "xno"; then \
425 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
427 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
428 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
429 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
430 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
432 if test "x@ENABLE_FLOCK@" = "xyes"; then \
433 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
434 elif test "x@ENABLE_FLOCK@" = "xno"; then \
435 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
437 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
438 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
439 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
440 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
442 if test "x@ENABLE_MINDF@" = "xyes"; then \
443 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
444 elif test "x@ENABLE_MINDF@" = "xno"; then \
445 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
447 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
448 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
449 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
450 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
452 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
453 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
454 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
455 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
457 if test "x@ENABLE_LU_REF@" = "xyes"; then \
458 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
459 elif test "x@ENABLE_LU_REF@" = "xno"; then \
460 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
462 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
463 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
464 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
465 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
467 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
468 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
469 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
470 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
472 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
473 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
474 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
475 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
477 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
478 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
479 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
480 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
482 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
483 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
484 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
485 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
487 if test "x@ENABLE_READLINE@" = "xyes"; then \
488 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
489 elif test "x@ENABLE_READLINE@" = "xno"; then \
490 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
492 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
493 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
494 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
495 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
497 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
498 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
499 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
500 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
502 if test "x@ENABLE_EFENCE@" = "xyes"; then \
503 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
504 elif test "x@ENABLE_EFENCE@" = "xno"; then \
505 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
507 if test "x@TESTS_FALSE@" = "x"; then \
508 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} notests"; \
510 export KERNEL_OBJ="$(LINUX_OBJ)"; \
511 export KERNEL_SRC="$(LINUX)"; \
512 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
513 echo "Kernel Source: $${KERNEL_SRC}"; \
514 echo "Kernel Object: $${KERNEL_OBJ}"; \
515 if test "x@ENABLEO2IB@" = "xno"; then \
516 export IB_OPTIONS="--with-o2ib=no"; \
518 if test "x@ENABLEO2IB@" != "xyes" && \
519 test -n "@EXT_O2IBPATH@"; then \
520 export IB_OPTIONS="--with-o2ib=@EXT_O2IBPATH@"; \
522 export IB_OPTIONS="--with-o2ib=yes"; \
525 cp -v debian/control.main debian/control ; \
526 sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \
527 > debian/lustre-tests.install; \
528 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
529 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
530 rc=$${PIPESTATUS[0]}; \
531 cp $$debiantmp/control.main.bkp debian/control.main || true && \
532 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
533 [ $${rc} -gt 1 ] && exit $${rc}; \
536 cp $$debiantmp/control.main.bkp debian/control.main || true && \
537 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
538 export KPKG_DEST_DIR="$$(pwd)/.." && \
539 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
540 rm -rf debian/tmp/modules-deb && \
541 mkdir debian/tmp/modules-deb && \
542 pushd debian/tmp/modules-deb && \
543 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
545 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
546 chmod 755 usr_src/modules/lustre/debian/rules && \
547 mkdir -p usr_share_modass && \
548 ln -s /usr/share/modass/include/ usr_share_modass/ && \
549 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
550 echo "lustre" > usr_share_modass/compliant.list && \
551 export MA_DIR=$$(pwd)/usr_share_modass && \
552 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
553 export KSRC_TREE=$(LINUX) && \
554 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
555 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
556 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
558 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
559 if test "x@ENABLE_SERVER@" = "xyes"; then \
560 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
563 if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \
564 debian/repackage-multiple-lnds.sh $${KVERS} $${VER} ../lustre-*-modules-$${KVERS}_$${VER}_*.deb ; \
565 MULTILNDPKGS="../lustre-lnet-module-*-$${KVERS}_$${VER}_*.deb"; \
568 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
569 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
570 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} $${MULTILNDPKGS} \
571 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
572 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
573 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
574 debs/ 2> /dev/null || true
576 dkms-debs: undef.h debs_common
577 cp -v debian/changelog.in debian/changelog ; \
578 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
579 lversion=$$(echo @VERSION@ | tr '_' '-'); \
580 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
581 if [ "$$lversion" != "$$cversion" ]; then \
582 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; \
585 export DEB_BUILD_PROFILES="client"; \
586 export KERNEL_OBJ="$(LINUX_OBJ)"; \
587 export KERNEL_SRC="$(LINUX)"; \
588 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
589 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
590 echo "Kernel Source: $${KERNEL_SRC}"; \
591 echo "Kernel Object: $${KERNEL_OBJ}"; \
592 export BUILD_DKMS="true" && \
593 cp -v debian/control.main debian/control ; \
594 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
595 rc=$${PIPESTATUS[0]}; \
596 [ $${rc} -gt 1 ] && exit $${rc}; \
599 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
601 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
602 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
603 ../lustre-*-utils_$${VER}_*.deb \
604 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
605 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
606 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
609 EXTRA_DIST += debian/*
612 CSTKO=/tmp/checkstack.orig
615 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
616 { for MOD in $$(find . -name "*.ko"); do \
617 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
618 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
619 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
622 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
625 rm -f ${CSTK} ${CSTKO}