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
34 FIND_TAG_FILES_CMD = find $(top_srcdir) \
35 -path $(top_srcdir)/ldiskfs/linux-stage \
36 -prune -false -o -type f -name '*.[hc]'
39 @echo 'Cleaning targets:'
40 @echo ' clean - Remove generated object files but keep the files'
41 @echo ' generated by autotools; use `git clean -xdf` to'
42 @echo ' purge all files not tracked by git'
44 @echo 'Generic targets:'
45 @echo ' all - Build all modules and utilities enabled by'
47 @echo ' utils - Build only userspace utilities'
48 @echo ' checkpatch - Run checkpatch.pl on latest commit'
49 @echo ' checkstack - Run checkstack.pl'
50 @echo ' checkstack-update - Update checkstack.pl'
51 @echo ' checkstack-clean - Remove checkstack.pl artifacts'
53 @echo 'Packaging targets:'
54 @echo ' rpms - Create RPM packages'
55 @echo ' srpm - Create source RPM packages'
56 @echo ' dkms-rpm - Create DKMS RPM packages'
57 @echo ' dkms-srpm - Create source DKMS RPM packages'
58 @echo ' debs - Create Debian packages'
59 @echo ' dkms-debs - Create DKMS Debian packages'
62 @git diff HEAD~1 | ./contrib/scripts/checkpatch.pl
65 $(MAKE) -C libcfs/libcfs/util
67 $(MAKE) -C lustre/utils
69 # these empty rules are needed so that automake doesn't add its own
82 $(RM) $(top_srcdir)/TAGS
83 ETAGSF=`etags --version | grep -iq exuberant && \
84 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
85 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
88 $(RM) $(top_srcdir)/tags
89 CTAGSF=`ctags --version | grep -iq exuberant && \
90 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
91 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
96 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
97 $(FIND_TAG_FILES_CMD) > cscope.files
101 $(FIND_TAG_FILES_CMD) | xargs mkid
105 .PHONY: ldiskfs-sources
109 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
112 $(MAKE) sources -C lnet/klnds/in-kernel-o2iblnd || exit $$?
118 modules: undef.h ldiskfs-sources
119 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
120 KBUILD_EXTRA_SYMBOLS="@INT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
121 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
122 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
123 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)' \
124 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
125 include/config/MARKER $@
127 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) BUILD_EXT_O2IB=yes \
128 KBUILD_EXTRA_SYMBOLS="$(PWD)/Module.symvers @EXT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
129 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
130 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
131 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)' \
132 $(MODULE_TARGET)=$(PWD)/lnet/klnds/o2iblnd -o tmp_include_depends -o scripts -o \
133 include/config/MARKER $@
134 endif # EXTERNAL_KO2IBLND
141 # compiler plugins should be built as soon as possible,
142 # so they can be available to the rest of the build
146 $(MAKE) all -C cc-plugins
150 grep -v config.h.in config.h.in > $@
153 find $(distdir) -name .deps -o \
157 -name .#* -exec rm -rf {} \;
159 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
163 lustre-dkms_pre-build.sh \
164 lustre-dkms_post-build.sh \
166 LUSTRE-VERSION-FILE \
170 config/lustre-version.m4
172 # contrib is a directory. Putting a directory in EXTRA_DIST
173 # recursively includes the entire directory contents in the
174 # distribution tarball (the tarball created with "make dist").
175 EXTRA_DIST += contrib
179 @(if test -z "$(RPMBUILD)"; then \
181 "*** Required util 'rpmbuild' missing. Please install the\n" \
182 "*** package for your distribution which provides 'rpmbuild',\n" \
183 "*** re-run configure, and try again.\n"; \
186 $(MKDIR_P) $(rpmbuilddir)/TMP && \
187 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
188 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
189 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
190 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
191 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
194 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
195 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
196 $(MAKE) $(AM_MAKEFLAGS) \
197 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
199 --define "_tmppath $$rpmbuilddir/TMP" \
200 --define "_topdir $$rpmbuilddir" \
201 --define "_sourcedir $(top_srcdir)" \
202 --with servers --with zfs -without ldiskfs \
203 --bs $(PACKAGE)-dkms.spec || exit 1; \
205 --define "_tmppath $$rpmbuilddir/TMP" \
206 --define "_topdir $$rpmbuilddir" \
207 --define "_sourcedir $(top_srcdir)" \
208 --with servers --without zfs --with ldiskfs \
209 --bs $(PACKAGE)-dkms.spec || exit 1; \
211 --define "_tmppath $$rpmbuilddir/TMP" \
212 --define "_topdir $$rpmbuilddir" \
213 --define "_sourcedir $(top_srcdir)" \
214 --with servers --with zfs --with ldiskfs \
215 --bs $(PACKAGE)-dkms.spec || exit 1; \
216 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
220 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
222 --define "_tmppath $$rpmbuilddir/TMP" \
223 --define "_topdir $$rpmbuilddir" \
224 @RPMBUILD_BINARY_ARGS@ \
225 --with servers --with zfs --without ldiskfs \
226 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
228 --define "_tmppath $$rpmbuilddir/TMP" \
229 --define "_topdir $$rpmbuilddir" \
230 @RPMBUILD_BINARY_ARGS@ \
231 --with servers --without zfs --with ldiskfs \
232 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
234 --define "_tmppath $$rpmbuilddir/TMP" \
235 --define "_topdir $$rpmbuilddir" \
236 @RPMBUILD_BINARY_ARGS@ \
237 --with servers --with zfs --with ldiskfs \
238 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
239 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
243 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
244 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
245 $(MAKE) $(AM_MAKEFLAGS) \
246 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
248 --define "_tmppath $$rpmbuilddir/TMP" \
249 --define "_topdir $$rpmbuilddir" \
250 --define "_sourcedir $(top_srcdir)" \
252 --bs $(PACKAGE)-dkms.spec || exit 1; \
253 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
257 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
259 --define "_tmppath $$rpmbuilddir/TMP" \
260 --define "_topdir $$rpmbuilddir" \
261 @RPMBUILD_BINARY_ARGS@ \
263 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
264 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
269 dkms-srpms: dkms-srpm
274 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
275 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
276 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
278 $(MAKE) $(AM_MAKEFLAGS) \
279 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
281 --define "_tmppath $$rpmbuilddir/TMP" \
282 --define "_topdir $$rpmbuilddir" \
283 @RPMBUILD_BINARY_ARGS@ \
284 --rebuild $(distdir)-*.src.rpm || exit 1; \
285 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
288 srpm: @PACKAGE_TARNAME@.spec dist Makefile
289 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
290 $(MAKE) $(AM_MAKEFLAGS) \
291 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
292 cp $(top_srcdir)/rpm/* $(top_srcdir); \
294 --define "_tmppath $$rpmbuilddir/TMP" \
295 --define "_topdir $$rpmbuilddir" \
296 --define "dist %{nil}" \
297 -ts $(distdir).tar.gz || exit 1; \
298 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
302 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
303 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
304 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
305 echo "************************************************************" ; \
306 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
307 echo "************************************************************" ; \
310 # In the debs target, first make sure what's in the changelog reflects
311 # the software version.
312 debs: undef.h debs_common
313 cp -v debian/changelog.in debian/changelog ; \
314 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
315 lversion=$$(echo @VERSION@ | tr '_' '-'); \
316 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
317 if [ "$$lversion" != "$$cversion" ]; then \
318 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; \
321 if test "x@ENABLE_SERVER@" = "xyes"; then \
322 DEB_BUILD_PROFILES="server"; \
324 DEB_BUILD_PROFILES="client"; \
326 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
327 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
329 if test "x@ENABLE_ZFS@" = "xyes"; then \
330 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
331 export SPL_SRC="@SPL@"; \
332 export ZFS_SRC="@ZFS@"; \
333 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
334 echo "SPL: $${SPL_SRC}"; \
335 echo "ZFS: $${ZFS_SRC}"; \
337 if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \
338 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} multiple-lnds"; \
340 if test "x@ENABLE_GNI@" = "xyes"; then \
341 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gnilnd"; \
343 if test "x@KFILND@" = "xkfilnd"; then \
344 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} kfilnd"; \
346 if test "x@DPKG_EXT_O2IB@" != "x"; then \
347 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ext_o2ib"; \
348 export O2IB_SRC="@EXT_O2IBPATH@"; \
350 if test "x@DPKG_INT_O2IB@" != "x"; then \
351 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} int_o2ib"; \
353 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
354 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
356 if test "x@ENABLE_GSS@" = "xyes"; then \
357 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
358 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
359 cp debian/control.main $$debiantmp/control.main.bkp ; \
360 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
361 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
362 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 ; \
363 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
364 elif test "x@ENABLE_GSS@" = "xno"; then \
365 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
367 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
368 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
369 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
370 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
372 if test "x@systemdsystemunitdir@" != "x"; then \
373 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
375 if test "x@ENABLE_PINGER@" = "xyes"; then \
376 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
377 elif test "x@ENABLE_PINGER@" = "xno"; then \
378 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
380 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
381 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
382 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
383 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
385 if test "x@ENABLE_FLOCK@" = "xyes"; then \
386 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
387 elif test "x@ENABLE_FLOCK@" = "xno"; then \
388 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
390 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
391 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
392 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
393 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
395 if test "x@ENABLE_MINDF@" = "xyes"; then \
396 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
397 elif test "x@ENABLE_MINDF@" = "xno"; then \
398 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
400 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
401 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
402 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
403 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
405 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
406 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
407 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
408 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
410 if test "x@ENABLE_LU_REF@" = "xyes"; then \
411 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
412 elif test "x@ENABLE_LU_REF@" = "xno"; then \
413 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
415 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
416 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
417 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
418 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
420 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
421 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
422 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
423 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
425 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
426 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
427 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
428 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
430 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
431 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
432 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
433 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
435 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
436 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
437 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
438 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
440 if test "x@ENABLE_READLINE@" = "xyes"; then \
441 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
442 elif test "x@ENABLE_READLINE@" = "xno"; then \
443 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
445 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
446 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
447 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
448 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
450 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
451 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
452 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
453 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
455 if test "x@ENABLE_EFENCE@" = "xyes"; then \
456 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
457 elif test "x@ENABLE_EFENCE@" = "xno"; then \
458 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
460 export KERNEL_OBJ="$(LINUX_OBJ)"; \
461 export KERNEL_SRC="$(LINUX)"; \
462 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
463 echo "Kernel Source: $${KERNEL_SRC}"; \
464 echo "Kernel Object: $${KERNEL_OBJ}"; \
465 if test "x@ENABLEO2IB@" = "xno"; then \
466 export IB_OPTIONS="--with-o2ib=no"; \
468 if test "x@ENABLEO2IB@" != "xyes" && \
469 test -n "@O2IBPATH@"; then \
470 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
472 export IB_OPTIONS="--with-o2ib=yes"; \
475 cp -v debian/control.main debian/control ; \
476 sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \
477 > debian/lustre-tests.install; \
478 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
479 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
480 rc=$${PIPESTATUS[0]}; \
481 cp $$debiantmp/control.main.bkp debian/control.main || true && \
482 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
483 [ $${rc} -gt 1 ] && exit $${rc}; \
486 cp $$debiantmp/control.main.bkp debian/control.main || true && \
487 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
488 cp -v debian/control.main debian/control || true ; \
489 export KPKG_DEST_DIR="$$(pwd)/.." && \
490 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
491 rm -rf debian/tmp/modules-deb && \
492 mkdir debian/tmp/modules-deb && \
493 pushd debian/tmp/modules-deb && \
494 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
496 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
497 chmod 755 usr_src/modules/lustre/debian/rules && \
498 mkdir -p usr_share_modass && \
499 ln -s /usr/share/modass/include/ usr_share_modass/ && \
500 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
501 echo "lustre" > usr_share_modass/compliant.list && \
502 export MA_DIR=$$(pwd)/usr_share_modass && \
503 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
504 export KSRC_TREE=$(LINUX) && \
505 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
506 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
507 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
509 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
510 if test "x@ENABLE_SERVER@" = "xyes"; then \
511 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
514 if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \
515 debian/repackage-multiple-lnds.sh $${KVERS} $${VER} ../lustre-*-modules-$${KVERS}_$${VER}_*.deb ; \
516 MULTILNDPKGS="../lustre-lnet-module-*-$${KVERS}_$${VER}_*.deb"; \
519 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
520 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
521 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} $${MULTILNDPKGS} \
522 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
523 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
524 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
527 dkms-debs: undef.h debs_common
528 cp -v debian/changelog.in debian/changelog ; \
529 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
530 lversion=$$(echo @VERSION@ | tr '_' '-'); \
531 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
532 if [ "$$lversion" != "$$cversion" ]; then \
533 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; \
536 export DEB_BUILD_PROFILES="client"; \
537 export KERNEL_OBJ="$(LINUX_OBJ)"; \
538 export KERNEL_SRC="$(LINUX)"; \
539 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
540 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
541 echo "Kernel Source: $${KERNEL_SRC}"; \
542 echo "Kernel Object: $${KERNEL_OBJ}"; \
543 export BUILD_DKMS="true" && \
544 cp -v debian/control.main debian/control ; \
545 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
546 rc=$${PIPESTATUS[0]}; \
547 [ $${rc} -gt 1 ] && exit $${rc}; \
550 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
552 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
553 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
554 ../lustre-*-utils_$${VER}_*.deb \
555 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
556 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
557 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
560 EXTRA_DIST += debian/*
563 CSTKO=/tmp/checkstack.orig
566 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
567 { for MOD in $$(find . -name "*.ko"); do \
568 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
569 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
570 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
573 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
576 rm -f ${CSTK} ${CSTKO}