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@ \
21 DIST_SUBDIRS := ldiskfs \
29 AUTOMAKE_OPTIONS = foreign
31 if DEQUOTE_CC_VERSION_TEXT
35 FIND_TAG_FILES_CMD = find $(top_srcdir) \
36 -path $(top_srcdir)/ldiskfs/linux-stage \
37 -prune -false -o -type f -name '*.[hc]'
40 @echo 'Cleaning targets:'
41 @echo ' clean - Remove generated object files but keep the files'
42 @echo ' generated by autotools; use `git clean -xdf` to'
43 @echo ' purge all files not tracked by git'
45 @echo 'Generic targets:'
46 @echo ' all - Build all modules and utilities enabled by'
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
64 # these empty rules are needed so that automake doesn't add its own
77 $(RM) $(top_srcdir)/TAGS
78 ETAGSF=`etags --version | grep -iq exuberant && \
79 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
80 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
83 $(RM) $(top_srcdir)/tags
84 CTAGSF=`ctags --version | grep -iq exuberant && \
85 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
86 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
91 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
92 $(FIND_TAG_FILES_CMD) > cscope.files
96 $(FIND_TAG_FILES_CMD) | xargs mkid
100 .PHONY: ldiskfs-sources
104 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
110 modules: undef.h ldiskfs-sources
111 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
112 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
113 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
114 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)' \
115 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
116 include/config/MARKER $@
123 # compiler plugins should be built as soon as possible,
124 # so they can be available to the rest of the build
128 $(MAKE) all -C cc-plugins
132 grep -v config.h.in config.h.in > $@
135 find $(distdir) -name .deps -o \
139 -name .#* -exec rm -rf {} \;
141 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
145 lustre-dkms_pre-build.sh \
146 lustre-dkms_post-build.sh \
148 LUSTRE-VERSION-FILE \
151 config/lustre-version.m4
153 # contrib is a directory. Putting a directory in EXTRA_DIST
154 # recursively includes the entire directory contents in the
155 # distribution tarball (the tarball created with "make dist").
156 EXTRA_DIST += contrib
160 @(if test -z "$(RPMBUILD)"; then \
162 "*** Required util 'rpmbuild' missing. Please install the\n" \
163 "*** package for your distribution which provides 'rpmbuild',\n" \
164 "*** re-run configure, and try again.\n"; \
167 $(MKDIR_P) $(rpmbuilddir)/TMP && \
168 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
169 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
170 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
171 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
172 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
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)" \
183 --with servers --with zfs -without ldiskfs \
184 --bs $(PACKAGE)-dkms.spec || exit 1; \
186 --define "_tmppath $$rpmbuilddir/TMP" \
187 --define "_topdir $$rpmbuilddir" \
188 --define "_sourcedir $(top_srcdir)" \
189 --with servers --without zfs --with ldiskfs \
190 --bs $(PACKAGE)-dkms.spec || exit 1; \
192 --define "_tmppath $$rpmbuilddir/TMP" \
193 --define "_topdir $$rpmbuilddir" \
194 --define "_sourcedir $(top_srcdir)" \
195 --with servers --with zfs --with ldiskfs \
196 --bs $(PACKAGE)-dkms.spec || exit 1; \
197 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
201 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
203 --define "_tmppath $$rpmbuilddir/TMP" \
204 --define "_topdir $$rpmbuilddir" \
205 @RPMBUILD_BINARY_ARGS@ \
206 --with servers --with zfs --without ldiskfs \
207 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
209 --define "_tmppath $$rpmbuilddir/TMP" \
210 --define "_topdir $$rpmbuilddir" \
211 @RPMBUILD_BINARY_ARGS@ \
212 --with servers --without zfs --with ldiskfs \
213 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
215 --define "_tmppath $$rpmbuilddir/TMP" \
216 --define "_topdir $$rpmbuilddir" \
217 @RPMBUILD_BINARY_ARGS@ \
218 --with servers --with zfs --with ldiskfs \
219 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
220 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
224 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
225 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
226 $(MAKE) $(AM_MAKEFLAGS) \
227 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
229 --define "_tmppath $$rpmbuilddir/TMP" \
230 --define "_topdir $$rpmbuilddir" \
231 --define "_sourcedir $(top_srcdir)" \
233 --bs $(PACKAGE)-dkms.spec || exit 1; \
234 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
238 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
240 --define "_tmppath $$rpmbuilddir/TMP" \
241 --define "_topdir $$rpmbuilddir" \
242 @RPMBUILD_BINARY_ARGS@ \
244 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
245 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
250 dkms-srpms: dkms-srpm
255 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
256 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
257 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
259 $(MAKE) $(AM_MAKEFLAGS) \
260 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
262 --define "_tmppath $$rpmbuilddir/TMP" \
263 --define "_topdir $$rpmbuilddir" \
264 @RPMBUILD_BINARY_ARGS@ \
265 --rebuild $(distdir)-*.src.rpm || exit 1; \
266 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
269 srpm: @PACKAGE_TARNAME@.spec dist Makefile
270 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
271 $(MAKE) $(AM_MAKEFLAGS) \
272 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
273 cp $(top_srcdir)/rpm/* $(top_srcdir); \
275 --define "_tmppath $$rpmbuilddir/TMP" \
276 --define "_topdir $$rpmbuilddir" \
277 --define "dist %{nil}" \
278 -ts $(distdir).tar.gz || exit 1; \
279 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
283 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
284 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
285 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
286 echo "************************************************************" ; \
287 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
288 echo "************************************************************" ; \
291 # In the debs target, first make sure what's in the changelog reflects
292 # the software version.
293 debs: undef.h debs_common
294 cp -v debian/changelog.in debian/changelog ; \
295 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
296 lversion=$$(echo @VERSION@ | tr '_' '-'); \
297 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
298 if [ "$$lversion" != "$$cversion" ]; then \
299 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; \
302 if test "x@ENABLE_SERVER@" = "xyes"; then \
303 DEB_BUILD_PROFILES="server"; \
305 DEB_BUILD_PROFILES="client"; \
307 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
308 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
310 if test "x@ENABLE_ZFS@" = "xyes"; then \
311 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
312 export SPL_SRC="@SPL@"; \
313 export ZFS_SRC="@ZFS@"; \
314 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
315 echo "SPL: $${SPL_SRC}"; \
316 echo "ZFS: $${ZFS_SRC}"; \
318 if test "x@ENABLEO2IB@" != "xno"; then \
319 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
320 export O2IB_SRC="@O2IBPATH@"; \
322 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
323 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
325 if test "x@ENABLE_GSS@" = "xyes"; then \
326 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
327 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
328 cp debian/control $$debiantmp/control.bkp ; \
329 cp debian/control.main $$debiantmp/control.main.bkp ; \
330 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
331 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
332 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 ; \
333 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
334 elif test "x@ENABLE_GSS@" = "xno"; then \
335 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
337 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
338 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
339 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
340 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
342 if test "x@systemdsystemunitdir@" != "x"; then \
343 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
345 if test "x@ENABLE_PINGER@" = "xyes"; then \
346 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
347 elif test "x@ENABLE_PINGER@" = "xno"; then \
348 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
350 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
351 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
352 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
353 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
355 if test "x@ENABLE_FLOCK@" = "xyes"; then \
356 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
357 elif test "x@ENABLE_FLOCK@" = "xno"; then \
358 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
360 if test "x@ENABLE_HEALTH_WRITE@" = "xyes"; then \
361 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} health_write"; \
362 elif test "x@ENABLE_HEALTH_WRITE@" = "xno"; then \
363 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nohealth_write"; \
365 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
366 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
367 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
368 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
370 if test "x@ENABLE_MINDF@" = "xyes"; then \
371 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
372 elif test "x@ENABLE_MINDF@" = "xno"; then \
373 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
375 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
376 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
377 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
378 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
380 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
381 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
382 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
383 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
385 if test "x@ENABLE_LU_REF@" = "xyes"; then \
386 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
387 elif test "x@ENABLE_LU_REF@" = "xno"; then \
388 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
390 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
391 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
392 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
393 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
395 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
396 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
397 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
398 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
400 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
401 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
402 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
403 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
405 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
406 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
407 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
408 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
410 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
411 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
412 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
413 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
415 if test "x@ENABLE_READLINE@" = "xyes"; then \
416 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
417 elif test "x@ENABLE_READLINE@" = "xno"; then \
418 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
420 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
421 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
422 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
423 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
425 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
426 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
427 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
428 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
430 if test "x@ENABLE_GNI@" = "xyes"; then \
431 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gni"; \
432 elif test "x@ENABLE_GNI@" = "xno"; then \
433 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogni"; \
435 if test "x@ENABLE_EFENCE@" = "xyes"; then \
436 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
437 elif test "x@ENABLE_EFENCE@" = "xno"; then \
438 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
440 export KERNEL_OBJ="$(LINUX_OBJ)"; \
441 export KERNEL_SRC="$(LINUX)"; \
442 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
443 echo "Kernel Source: $${KERNEL_SRC}"; \
444 echo "Kernel Object: $${KERNEL_OBJ}"; \
445 if test "x@ENABLEO2IB@" = "xno"; then \
446 export IB_OPTIONS="--with-o2ib=no"; \
448 if test "x@ENABLEO2IB@" != "xyes" && \
449 test -n "@O2IBPATH@"; then \
450 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
452 export IB_OPTIONS="--with-o2ib=yes"; \
455 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
456 rc=$${PIPESTATUS[0]}; \
457 cp $$debiantmp/control.bkp debian/control || true && \
458 cp $$debiantmp/control.main.bkp debian/control.main || true && \
459 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
460 [ $${rc} -gt 1 ] && exit $${rc}; \
463 cp $$debiantmp/control.bkp debian/control || true && \
464 cp $$debiantmp/control.main.bkp debian/control.main || true && \
465 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
466 export KPKG_DEST_DIR="$$(pwd)/.." && \
467 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
468 rm -rf debian/tmp/modules-deb && \
469 mkdir debian/tmp/modules-deb && \
470 pushd debian/tmp/modules-deb && \
471 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
473 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
474 chmod 755 usr_src/modules/lustre/debian/rules && \
475 mkdir -p usr_share_modass && \
476 ln -s /usr/share/modass/include/ usr_share_modass/ && \
477 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
478 echo "lustre" > usr_share_modass/compliant.list && \
479 export MA_DIR=$$(pwd)/usr_share_modass && \
480 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
481 export KSRC_TREE=$(LINUX) && \
482 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
483 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
484 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
486 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
487 if test "x@ENABLE_SERVER@" = "xyes"; then \
488 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
491 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
492 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
493 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \
494 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
495 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
498 dkms-debs: undef.h debs_common
499 cp -v debian/changelog.in debian/changelog ; \
500 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
501 lversion=$$(echo @VERSION@ | tr '_' '-'); \
502 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
503 if [ "$$lversion" != "$$cversion" ]; then \
504 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; \
507 export DEB_BUILD_PROFILES="client"; \
508 export KERNEL_OBJ="$(LINUX_OBJ)"; \
509 export KERNEL_SRC="$(LINUX)"; \
510 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
511 echo "Kernel Source: $${KERNEL_SRC}"; \
512 echo "Kernel Object: $${KERNEL_OBJ}"; \
513 export BUILD_DKMS="true" && \
514 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
515 rc=$${PIPESTATUS[0]}; \
516 [ $${rc} -gt 1 ] && exit $${rc}; \
519 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
521 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
522 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
523 ../lustre-*-utils_$${VER}_*.deb \
524 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
525 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
528 EXTRA_DIST += debian/*
531 CSTKO=/tmp/checkstack.orig
534 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
535 { for MOD in $$(find . -name "*.ko"); do \
536 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
537 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
538 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
541 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
544 rm -f ${CSTK} ${CSTKO}