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 \
152 config/lustre-version.m4
154 # contrib is a directory. Putting a directory in EXTRA_DIST
155 # recursively includes the entire directory contents in the
156 # distribution tarball (the tarball created with "make dist").
157 EXTRA_DIST += contrib
161 @(if test -z "$(RPMBUILD)"; then \
163 "*** Required util 'rpmbuild' missing. Please install the\n" \
164 "*** package for your distribution which provides 'rpmbuild',\n" \
165 "*** re-run configure, and try again.\n"; \
168 $(MKDIR_P) $(rpmbuilddir)/TMP && \
169 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
170 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
171 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
172 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
173 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
176 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
177 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
178 $(MAKE) $(AM_MAKEFLAGS) \
179 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
181 --define "_tmppath $$rpmbuilddir/TMP" \
182 --define "_topdir $$rpmbuilddir" \
183 --define "_sourcedir $(top_srcdir)" \
184 --with servers --with zfs -without ldiskfs \
185 --bs $(PACKAGE)-dkms.spec || exit 1; \
187 --define "_tmppath $$rpmbuilddir/TMP" \
188 --define "_topdir $$rpmbuilddir" \
189 --define "_sourcedir $(top_srcdir)" \
190 --with servers --without zfs --with ldiskfs \
191 --bs $(PACKAGE)-dkms.spec || exit 1; \
193 --define "_tmppath $$rpmbuilddir/TMP" \
194 --define "_topdir $$rpmbuilddir" \
195 --define "_sourcedir $(top_srcdir)" \
196 --with servers --with zfs --with ldiskfs \
197 --bs $(PACKAGE)-dkms.spec || exit 1; \
198 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
202 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
204 --define "_tmppath $$rpmbuilddir/TMP" \
205 --define "_topdir $$rpmbuilddir" \
206 @RPMBUILD_BINARY_ARGS@ \
207 --with servers --with zfs --without ldiskfs \
208 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
210 --define "_tmppath $$rpmbuilddir/TMP" \
211 --define "_topdir $$rpmbuilddir" \
212 @RPMBUILD_BINARY_ARGS@ \
213 --with servers --without zfs --with ldiskfs \
214 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
216 --define "_tmppath $$rpmbuilddir/TMP" \
217 --define "_topdir $$rpmbuilddir" \
218 @RPMBUILD_BINARY_ARGS@ \
219 --with servers --with zfs --with ldiskfs \
220 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
221 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
225 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
226 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
227 $(MAKE) $(AM_MAKEFLAGS) \
228 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
230 --define "_tmppath $$rpmbuilddir/TMP" \
231 --define "_topdir $$rpmbuilddir" \
232 --define "_sourcedir $(top_srcdir)" \
234 --bs $(PACKAGE)-dkms.spec || exit 1; \
235 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
239 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
241 --define "_tmppath $$rpmbuilddir/TMP" \
242 --define "_topdir $$rpmbuilddir" \
243 @RPMBUILD_BINARY_ARGS@ \
245 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
246 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
251 dkms-srpms: dkms-srpm
256 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
257 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
258 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
260 $(MAKE) $(AM_MAKEFLAGS) \
261 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
263 --define "_tmppath $$rpmbuilddir/TMP" \
264 --define "_topdir $$rpmbuilddir" \
265 @RPMBUILD_BINARY_ARGS@ \
266 --rebuild $(distdir)-*.src.rpm || exit 1; \
267 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
270 srpm: @PACKAGE_TARNAME@.spec dist Makefile
271 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
272 $(MAKE) $(AM_MAKEFLAGS) \
273 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
274 cp $(top_srcdir)/rpm/* $(top_srcdir); \
276 --define "_tmppath $$rpmbuilddir/TMP" \
277 --define "_topdir $$rpmbuilddir" \
278 --define "dist %{nil}" \
279 -ts $(distdir).tar.gz || exit 1; \
280 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
284 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
285 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
286 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
287 echo "************************************************************" ; \
288 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
289 echo "************************************************************" ; \
292 # In the debs target, first make sure what's in the changelog reflects
293 # the software version.
294 debs: undef.h debs_common
295 cp -v debian/changelog.in debian/changelog ; \
296 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
297 lversion=$$(echo @VERSION@ | tr '_' '-'); \
298 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
299 if [ "$$lversion" != "$$cversion" ]; then \
300 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; \
303 if test "x@ENABLE_SERVER@" = "xyes"; then \
304 DEB_BUILD_PROFILES="server"; \
306 DEB_BUILD_PROFILES="client"; \
308 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
309 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
311 if test "x@ENABLE_ZFS@" = "xyes"; then \
312 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
313 export SPL_SRC="@SPL@"; \
314 export ZFS_SRC="@ZFS@"; \
315 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
316 echo "SPL: $${SPL_SRC}"; \
317 echo "ZFS: $${ZFS_SRC}"; \
319 if test "x@ENABLEO2IB@" != "xno"; then \
320 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
321 export O2IB_SRC="@O2IBPATH@"; \
323 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
324 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
326 if test "x@ENABLE_GSS@" = "xyes"; then \
327 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
328 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
329 cp debian/control $$debiantmp/control.bkp ; \
330 cp debian/control.main $$debiantmp/control.main.bkp ; \
331 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
332 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
333 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 ; \
334 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
335 elif test "x@ENABLE_GSS@" = "xno"; then \
336 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
338 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
339 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
340 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
341 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
343 if test "x@systemdsystemunitdir@" != "x"; then \
344 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
346 if test "x@ENABLE_PINGER@" = "xyes"; then \
347 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
348 elif test "x@ENABLE_PINGER@" = "xno"; then \
349 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
351 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
352 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
353 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
354 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
356 if test "x@ENABLE_FLOCK@" = "xyes"; then \
357 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
358 elif test "x@ENABLE_FLOCK@" = "xno"; then \
359 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
361 if test "x@ENABLE_HEALTH_WRITE@" = "xyes"; then \
362 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} health_write"; \
363 elif test "x@ENABLE_HEALTH_WRITE@" = "xno"; then \
364 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nohealth_write"; \
366 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
367 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
368 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
369 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
371 if test "x@ENABLE_MINDF@" = "xyes"; then \
372 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
373 elif test "x@ENABLE_MINDF@" = "xno"; then \
374 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
376 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
377 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
378 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
379 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
381 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
382 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
383 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
384 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
386 if test "x@ENABLE_LU_REF@" = "xyes"; then \
387 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
388 elif test "x@ENABLE_LU_REF@" = "xno"; then \
389 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
391 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
392 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
393 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
394 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
396 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
397 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
398 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
399 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
401 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
402 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
403 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
404 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
406 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
407 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
408 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
409 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
411 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
412 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
413 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
414 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
416 if test "x@ENABLE_READLINE@" = "xyes"; then \
417 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
418 elif test "x@ENABLE_READLINE@" = "xno"; then \
419 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
421 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
422 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
423 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
424 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
426 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
427 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
428 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
429 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
431 if test "x@ENABLE_GNI@" = "xyes"; then \
432 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gni"; \
433 elif test "x@ENABLE_GNI@" = "xno"; then \
434 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogni"; \
436 if test "x@ENABLE_EFENCE@" = "xyes"; then \
437 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
438 elif test "x@ENABLE_EFENCE@" = "xno"; then \
439 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
441 export KERNEL_OBJ="$(LINUX_OBJ)"; \
442 export KERNEL_SRC="$(LINUX)"; \
443 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
444 echo "Kernel Source: $${KERNEL_SRC}"; \
445 echo "Kernel Object: $${KERNEL_OBJ}"; \
446 if test "x@ENABLEO2IB@" = "xno"; then \
447 export IB_OPTIONS="--with-o2ib=no"; \
449 if test "x@ENABLEO2IB@" != "xyes" && \
450 test -n "@O2IBPATH@"; then \
451 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
453 export IB_OPTIONS="--with-o2ib=yes"; \
456 sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \
457 > debian/lustre-tests.install; \
458 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
459 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
460 rc=$${PIPESTATUS[0]}; \
461 cp $$debiantmp/control.bkp debian/control || true && \
462 cp $$debiantmp/control.main.bkp debian/control.main || true && \
463 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
464 [ $${rc} -gt 1 ] && exit $${rc}; \
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 export KPKG_DEST_DIR="$$(pwd)/.." && \
471 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
472 rm -rf debian/tmp/modules-deb && \
473 mkdir debian/tmp/modules-deb && \
474 pushd debian/tmp/modules-deb && \
475 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
477 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
478 chmod 755 usr_src/modules/lustre/debian/rules && \
479 mkdir -p usr_share_modass && \
480 ln -s /usr/share/modass/include/ usr_share_modass/ && \
481 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
482 echo "lustre" > usr_share_modass/compliant.list && \
483 export MA_DIR=$$(pwd)/usr_share_modass && \
484 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
485 export KSRC_TREE=$(LINUX) && \
486 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
487 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
488 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
490 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
491 if test "x@ENABLE_SERVER@" = "xyes"; then \
492 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
495 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
496 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
497 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \
498 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
499 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
502 dkms-debs: undef.h debs_common
503 cp -v debian/changelog.in debian/changelog ; \
504 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
505 lversion=$$(echo @VERSION@ | tr '_' '-'); \
506 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
507 if [ "$$lversion" != "$$cversion" ]; then \
508 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; \
511 export DEB_BUILD_PROFILES="client"; \
512 export KERNEL_OBJ="$(LINUX_OBJ)"; \
513 export KERNEL_SRC="$(LINUX)"; \
514 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
515 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
516 echo "Kernel Source: $${KERNEL_SRC}"; \
517 echo "Kernel Object: $${KERNEL_OBJ}"; \
518 export BUILD_DKMS="true" && \
519 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
520 rc=$${PIPESTATUS[0]}; \
521 [ $${rc} -gt 1 ] && exit $${rc}; \
524 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
526 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
527 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
528 ../lustre-*-utils_$${VER}_*.deb \
529 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
530 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
533 EXTRA_DIST += debian/*
536 CSTKO=/tmp/checkstack.orig
539 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
540 { for MOD in $$(find . -name "*.ko"); do \
541 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
542 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
543 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
546 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
549 rm -f ${CSTK} ${CSTKO}