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 $$?
108 modules: undef.h ldiskfs-sources
109 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
110 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
111 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
112 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)' \
113 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
114 include/config/MARKER $@
121 # compiler plugins should be built as soon as possible,
122 # so they can be available to the rest of the build
126 $(MAKE) all -C cc-plugins
130 grep -v config.h.in config.h.in > $@
133 find $(distdir) -name .deps -o \
137 -name .#* -exec rm -rf {} \;
139 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
143 lustre-dkms_pre-build.sh \
144 lustre-dkms_post-build.sh \
146 LUSTRE-VERSION-FILE \
150 config/lustre-version.m4
152 # contrib is a directory. Putting a directory in EXTRA_DIST
153 # recursively includes the entire directory contents in the
154 # distribution tarball (the tarball created with "make dist").
155 EXTRA_DIST += contrib
159 @(if test -z "$(RPMBUILD)"; then \
161 "*** Required util 'rpmbuild' missing. Please install the\n" \
162 "*** package for your distribution which provides 'rpmbuild',\n" \
163 "*** re-run configure, and try again.\n"; \
166 $(MKDIR_P) $(rpmbuilddir)/TMP && \
167 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
168 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
169 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
170 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
171 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
174 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
175 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
176 $(MAKE) $(AM_MAKEFLAGS) \
177 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
179 --define "_tmppath $$rpmbuilddir/TMP" \
180 --define "_topdir $$rpmbuilddir" \
181 --define "_sourcedir $(top_srcdir)" \
182 --with servers --with zfs -without ldiskfs \
183 --bs $(PACKAGE)-dkms.spec || exit 1; \
185 --define "_tmppath $$rpmbuilddir/TMP" \
186 --define "_topdir $$rpmbuilddir" \
187 --define "_sourcedir $(top_srcdir)" \
188 --with servers --without zfs --with ldiskfs \
189 --bs $(PACKAGE)-dkms.spec || exit 1; \
191 --define "_tmppath $$rpmbuilddir/TMP" \
192 --define "_topdir $$rpmbuilddir" \
193 --define "_sourcedir $(top_srcdir)" \
194 --with servers --with zfs --with ldiskfs \
195 --bs $(PACKAGE)-dkms.spec || exit 1; \
196 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
200 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
202 --define "_tmppath $$rpmbuilddir/TMP" \
203 --define "_topdir $$rpmbuilddir" \
204 @RPMBUILD_BINARY_ARGS@ \
205 --with servers --with zfs --without ldiskfs \
206 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
208 --define "_tmppath $$rpmbuilddir/TMP" \
209 --define "_topdir $$rpmbuilddir" \
210 @RPMBUILD_BINARY_ARGS@ \
211 --with servers --without zfs --with ldiskfs \
212 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
214 --define "_tmppath $$rpmbuilddir/TMP" \
215 --define "_topdir $$rpmbuilddir" \
216 @RPMBUILD_BINARY_ARGS@ \
217 --with servers --with zfs --with ldiskfs \
218 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
219 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
223 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
224 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
225 $(MAKE) $(AM_MAKEFLAGS) \
226 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
228 --define "_tmppath $$rpmbuilddir/TMP" \
229 --define "_topdir $$rpmbuilddir" \
230 --define "_sourcedir $(top_srcdir)" \
232 --bs $(PACKAGE)-dkms.spec || exit 1; \
233 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
237 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
239 --define "_tmppath $$rpmbuilddir/TMP" \
240 --define "_topdir $$rpmbuilddir" \
241 @RPMBUILD_BINARY_ARGS@ \
243 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
244 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
249 dkms-srpms: dkms-srpm
254 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
255 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
256 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
258 $(MAKE) $(AM_MAKEFLAGS) \
259 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
261 --define "_tmppath $$rpmbuilddir/TMP" \
262 --define "_topdir $$rpmbuilddir" \
263 @RPMBUILD_BINARY_ARGS@ \
264 --rebuild $(distdir)-*.src.rpm || exit 1; \
265 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
268 srpm: @PACKAGE_TARNAME@.spec dist Makefile
269 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
270 $(MAKE) $(AM_MAKEFLAGS) \
271 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
272 cp $(top_srcdir)/rpm/* $(top_srcdir); \
274 --define "_tmppath $$rpmbuilddir/TMP" \
275 --define "_topdir $$rpmbuilddir" \
276 --define "dist %{nil}" \
277 -ts $(distdir).tar.gz || exit 1; \
278 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
282 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
283 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
284 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
285 echo "************************************************************" ; \
286 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
287 echo "************************************************************" ; \
290 # In the debs target, first make sure what's in the changelog reflects
291 # the software version.
292 debs: undef.h debs_common
293 cp -v debian/changelog.in debian/changelog ; \
294 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
295 lversion=$$(echo @VERSION@ | tr '_' '-'); \
296 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
297 if [ "$$lversion" != "$$cversion" ]; then \
298 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; \
301 if test "x@ENABLE_SERVER@" = "xyes"; then \
302 DEB_BUILD_PROFILES="server"; \
304 DEB_BUILD_PROFILES="client"; \
306 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
307 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
309 if test "x@ENABLE_ZFS@" = "xyes"; then \
310 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
311 export SPL_SRC="@SPL@"; \
312 export ZFS_SRC="@ZFS@"; \
313 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
314 echo "SPL: $${SPL_SRC}"; \
315 echo "ZFS: $${ZFS_SRC}"; \
317 if test "x@ENABLEO2IB@" != "xno"; then \
318 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
319 export O2IB_SRC="@O2IBPATH@"; \
321 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
322 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
324 if test "x@ENABLE_GSS@" = "xyes"; then \
325 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
326 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
327 cp debian/control $$debiantmp/control.bkp ; \
328 cp debian/control.main $$debiantmp/control.main.bkp ; \
329 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
330 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
331 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 ; \
332 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
333 elif test "x@ENABLE_GSS@" = "xno"; then \
334 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
336 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
337 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
338 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
339 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
341 if test "x@systemdsystemunitdir@" != "x"; then \
342 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
344 if test "x@ENABLE_PINGER@" = "xyes"; then \
345 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
346 elif test "x@ENABLE_PINGER@" = "xno"; then \
347 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
349 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
350 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
351 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
352 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
354 if test "x@ENABLE_FLOCK@" = "xyes"; then \
355 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
356 elif test "x@ENABLE_FLOCK@" = "xno"; then \
357 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
359 if test "x@ENABLE_HEALTH_WRITE@" = "xyes"; then \
360 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} health_write"; \
361 elif test "x@ENABLE_HEALTH_WRITE@" = "xno"; then \
362 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nohealth_write"; \
364 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
365 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
366 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
367 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
369 if test "x@ENABLE_MINDF@" = "xyes"; then \
370 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
371 elif test "x@ENABLE_MINDF@" = "xno"; then \
372 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
374 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
375 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
376 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
377 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
379 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
380 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
381 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
382 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
384 if test "x@ENABLE_LU_REF@" = "xyes"; then \
385 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
386 elif test "x@ENABLE_LU_REF@" = "xno"; then \
387 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
389 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
390 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
391 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
392 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
394 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
395 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
396 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
397 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
399 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
400 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
401 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
402 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
404 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
405 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
406 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
407 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
409 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
410 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
411 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
412 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
414 if test "x@ENABLE_READLINE@" = "xyes"; then \
415 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
416 elif test "x@ENABLE_READLINE@" = "xno"; then \
417 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
419 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
420 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
421 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
422 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
424 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
425 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
426 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
427 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
429 if test "x@ENABLE_GNI@" = "xyes"; then \
430 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gni"; \
431 elif test "x@ENABLE_GNI@" = "xno"; then \
432 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogni"; \
434 if test "x@ENABLE_EFENCE@" = "xyes"; then \
435 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
436 elif test "x@ENABLE_EFENCE@" = "xno"; then \
437 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
439 export KERNEL_OBJ="$(LINUX_OBJ)"; \
440 export KERNEL_SRC="$(LINUX)"; \
441 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
442 echo "Kernel Source: $${KERNEL_SRC}"; \
443 echo "Kernel Object: $${KERNEL_OBJ}"; \
444 if test "x@ENABLEO2IB@" = "xno"; then \
445 export IB_OPTIONS="--with-o2ib=no"; \
447 if test "x@ENABLEO2IB@" != "xyes" && \
448 test -n "@O2IBPATH@"; then \
449 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
451 export IB_OPTIONS="--with-o2ib=yes"; \
454 sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \
455 > debian/lustre-tests.install; \
456 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
457 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
458 rc=$${PIPESTATUS[0]}; \
459 cp $$debiantmp/control.bkp debian/control || true && \
460 cp $$debiantmp/control.main.bkp debian/control.main || true && \
461 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
462 [ $${rc} -gt 1 ] && exit $${rc}; \
465 cp $$debiantmp/control.bkp debian/control || true && \
466 cp $$debiantmp/control.main.bkp debian/control.main || true && \
467 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
468 export KPKG_DEST_DIR="$$(pwd)/.." && \
469 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
470 rm -rf debian/tmp/modules-deb && \
471 mkdir debian/tmp/modules-deb && \
472 pushd debian/tmp/modules-deb && \
473 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
475 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
476 chmod 755 usr_src/modules/lustre/debian/rules && \
477 mkdir -p usr_share_modass && \
478 ln -s /usr/share/modass/include/ usr_share_modass/ && \
479 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
480 echo "lustre" > usr_share_modass/compliant.list && \
481 export MA_DIR=$$(pwd)/usr_share_modass && \
482 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
483 export KSRC_TREE=$(LINUX) && \
484 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
485 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
486 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
488 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
489 if test "x@ENABLE_SERVER@" = "xyes"; then \
490 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
493 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
494 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
495 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \
496 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
497 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
500 dkms-debs: undef.h debs_common
501 cp -v debian/changelog.in debian/changelog ; \
502 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
503 lversion=$$(echo @VERSION@ | tr '_' '-'); \
504 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
505 if [ "$$lversion" != "$$cversion" ]; then \
506 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; \
509 export DEB_BUILD_PROFILES="client"; \
510 export KERNEL_OBJ="$(LINUX_OBJ)"; \
511 export KERNEL_SRC="$(LINUX)"; \
512 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
513 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
514 echo "Kernel Source: $${KERNEL_SRC}"; \
515 echo "Kernel Object: $${KERNEL_OBJ}"; \
516 export BUILD_DKMS="true" && \
517 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
518 rc=$${PIPESTATUS[0]}; \
519 [ $${rc} -gt 1 ] && exit $${rc}; \
522 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
524 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
525 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
526 ../lustre-*-utils_$${VER}_*.deb \
527 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
528 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
531 EXTRA_DIST += debian/*
534 CSTKO=/tmp/checkstack.orig
537 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
538 { for MOD in $$(find . -name "*.ko"); do \
539 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
540 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
541 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
544 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
547 rm -f ${CSTK} ${CSTKO}