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 ' checkpatch - Run checkpatch.pl on latest commit'
48 @echo ' checkstack - Run checkstack.pl'
49 @echo ' checkstack-update - Update checkstack.pl'
50 @echo ' checkstack-clean - Remove checkstack.pl artifacts'
52 @echo 'Packaging targets:'
53 @echo ' rpms - Create RPM packages'
54 @echo ' srpm - Create source RPM packages'
55 @echo ' dkms-rpm - Create DKMS RPM packages'
56 @echo ' dkms-srpm - Create source DKMS RPM packages'
57 @echo ' debs - Create Debian packages'
58 @echo ' dkms-debs - Create DKMS Debian packages'
61 @git diff HEAD~1 | ./contrib/scripts/checkpatch.pl
63 # these empty rules are needed so that automake doesn't add its own
76 $(RM) $(top_srcdir)/TAGS
77 ETAGSF=`etags --version | grep -iq exuberant && \
78 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
79 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
82 $(RM) $(top_srcdir)/tags
83 CTAGSF=`ctags --version | grep -iq exuberant && \
84 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
85 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
90 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
91 $(FIND_TAG_FILES_CMD) > cscope.files
95 $(FIND_TAG_FILES_CMD) | xargs mkid
99 .PHONY: ldiskfs-sources
103 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
106 $(MAKE) sources -C lnet/klnds/in-kernel-o2iblnd || exit $$?
112 modules: undef.h ldiskfs-sources
113 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) \
114 KBUILD_EXTRA_SYMBOLS="@INT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
115 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
116 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
117 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)' \
118 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
119 include/config/MARKER $@
121 $(MAKE) DEQUOTE_CC_VERSION_TEXT=$(DEQUOTE) BUILD_EXT_O2IB=yes \
122 KBUILD_EXTRA_SYMBOLS="$(PWD)/Module.symvers @EXT_O2IB_SYMBOLS@ @EXTRA_SYMBOLS@" \
123 LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
124 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
125 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)' \
126 $(MODULE_TARGET)=$(PWD)/lnet/klnds/o2iblnd -o tmp_include_depends -o scripts -o \
127 include/config/MARKER $@
128 endif # EXTERNAL_KO2IBLND
135 # compiler plugins should be built as soon as possible,
136 # so they can be available to the rest of the build
140 $(MAKE) all -C cc-plugins
144 grep -v config.h.in config.h.in > $@
147 find $(distdir) -name .deps -o \
151 -name .#* -exec rm -rf {} \;
153 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
157 lustre-dkms_pre-build.sh \
158 lustre-dkms_post-build.sh \
160 LUSTRE-VERSION-FILE \
164 config/lustre-version.m4
166 # contrib is a directory. Putting a directory in EXTRA_DIST
167 # recursively includes the entire directory contents in the
168 # distribution tarball (the tarball created with "make dist").
169 EXTRA_DIST += contrib
173 @(if test -z "$(RPMBUILD)"; then \
175 "*** Required util 'rpmbuild' missing. Please install the\n" \
176 "*** package for your distribution which provides 'rpmbuild',\n" \
177 "*** re-run configure, and try again.\n"; \
180 $(MKDIR_P) $(rpmbuilddir)/TMP && \
181 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
182 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
183 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
184 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
185 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
188 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
189 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
190 $(MAKE) $(AM_MAKEFLAGS) \
191 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
193 --define "_tmppath $$rpmbuilddir/TMP" \
194 --define "_topdir $$rpmbuilddir" \
195 --define "_sourcedir $(top_srcdir)" \
196 --with servers --with zfs -without ldiskfs \
197 --bs $(PACKAGE)-dkms.spec || exit 1; \
199 --define "_tmppath $$rpmbuilddir/TMP" \
200 --define "_topdir $$rpmbuilddir" \
201 --define "_sourcedir $(top_srcdir)" \
202 --with servers --without zfs --with 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 --with zfs --with ldiskfs \
209 --bs $(PACKAGE)-dkms.spec || exit 1; \
210 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
214 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
216 --define "_tmppath $$rpmbuilddir/TMP" \
217 --define "_topdir $$rpmbuilddir" \
218 @RPMBUILD_BINARY_ARGS@ \
219 --with servers --with zfs --without ldiskfs \
220 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
222 --define "_tmppath $$rpmbuilddir/TMP" \
223 --define "_topdir $$rpmbuilddir" \
224 @RPMBUILD_BINARY_ARGS@ \
225 --with servers --without zfs --with ldiskfs \
226 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
228 --define "_tmppath $$rpmbuilddir/TMP" \
229 --define "_topdir $$rpmbuilddir" \
230 @RPMBUILD_BINARY_ARGS@ \
231 --with servers --with zfs --with ldiskfs \
232 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
233 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
237 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
238 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
239 $(MAKE) $(AM_MAKEFLAGS) \
240 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
242 --define "_tmppath $$rpmbuilddir/TMP" \
243 --define "_topdir $$rpmbuilddir" \
244 --define "_sourcedir $(top_srcdir)" \
246 --bs $(PACKAGE)-dkms.spec || exit 1; \
247 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
251 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
253 --define "_tmppath $$rpmbuilddir/TMP" \
254 --define "_topdir $$rpmbuilddir" \
255 @RPMBUILD_BINARY_ARGS@ \
257 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
258 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
263 dkms-srpms: dkms-srpm
268 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
269 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
270 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
272 $(MAKE) $(AM_MAKEFLAGS) \
273 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
275 --define "_tmppath $$rpmbuilddir/TMP" \
276 --define "_topdir $$rpmbuilddir" \
277 @RPMBUILD_BINARY_ARGS@ \
278 --rebuild $(distdir)-*.src.rpm || exit 1; \
279 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
282 srpm: @PACKAGE_TARNAME@.spec dist Makefile
283 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
284 $(MAKE) $(AM_MAKEFLAGS) \
285 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
286 cp $(top_srcdir)/rpm/* $(top_srcdir); \
288 --define "_tmppath $$rpmbuilddir/TMP" \
289 --define "_topdir $$rpmbuilddir" \
290 --define "dist %{nil}" \
291 -ts $(distdir).tar.gz || exit 1; \
292 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
296 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
297 rm -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; \
298 if test -f /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2; then \
299 echo "************************************************************" ; \
300 echo "WARNING: move or remove /usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2" ; \
301 echo "************************************************************" ; \
304 # In the debs target, first make sure what's in the changelog reflects
305 # the software version.
306 debs: undef.h debs_common
307 cp -v debian/changelog.in debian/changelog ; \
308 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
309 lversion=$$(echo @VERSION@ | tr '_' '-'); \
310 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
311 if [ "$$lversion" != "$$cversion" ]; then \
312 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; \
315 if test "x@ENABLE_SERVER@" = "xyes"; then \
316 DEB_BUILD_PROFILES="server"; \
318 DEB_BUILD_PROFILES="client"; \
320 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
321 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
323 if test "x@ENABLE_ZFS@" = "xyes"; then \
324 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
325 export SPL_SRC="@SPL@"; \
326 export ZFS_SRC="@ZFS@"; \
327 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
328 echo "SPL: $${SPL_SRC}"; \
329 echo "ZFS: $${ZFS_SRC}"; \
331 if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \
332 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} multiple-lnds"; \
334 if test "x@ENABLE_GNI@" = "xyes"; then \
335 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gnilnd"; \
337 if test "x@KFILND@" = "xkfilnd"; then \
338 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} kfilnd"; \
340 if test "x@DPKG_EXT_O2IB@" != "x"; then \
341 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ext_o2ib"; \
342 export O2IB_SRC="@EXT_O2IBPATH@"; \
344 if test "x@DPKG_INT_O2IB@" != "x"; then \
345 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} int_o2ib"; \
347 if test "x@CONFIG_CACHE_FILE@" != "x"; then \
348 export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \
350 if test "x@ENABLE_GSS@" = "xyes"; then \
351 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
352 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
353 cp debian/control.main $$debiantmp/control.main.bkp ; \
354 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
355 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
356 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 ; \
357 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
358 elif test "x@ENABLE_GSS@" = "xno"; then \
359 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
361 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
362 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
363 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
364 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
366 if test "x@systemdsystemunitdir@" != "x"; then \
367 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
369 if test "x@ENABLE_PINGER@" = "xyes"; then \
370 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
371 elif test "x@ENABLE_PINGER@" = "xno"; then \
372 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \
374 if test "x@ENABLE_CHECKSUM@" = "xyes"; then \
375 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \
376 elif test "x@ENABLE_CHECKSUM@" = "xno"; then \
377 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \
379 if test "x@ENABLE_FLOCK@" = "xyes"; then \
380 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \
381 elif test "x@ENABLE_FLOCK@" = "xno"; then \
382 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \
384 if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \
385 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \
386 elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \
387 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \
389 if test "x@ENABLE_MINDF@" = "xyes"; then \
390 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \
391 elif test "x@ENABLE_MINDF@" = "xno"; then \
392 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \
394 if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \
395 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \
396 elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \
397 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \
399 if test "x@ENABLE_INVARIANTS@" = "xyes"; then \
400 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \
401 elif test "x@ENABLE_INVARIANTS@" = "xno"; then \
402 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \
404 if test "x@ENABLE_LU_REF@" = "xyes"; then \
405 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \
406 elif test "x@ENABLE_LU_REF@" = "xno"; then \
407 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \
409 if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \
410 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \
411 elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \
412 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \
414 if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \
415 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \
416 elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \
417 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \
419 if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \
420 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \
421 elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \
422 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \
424 if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \
425 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \
426 elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \
427 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \
429 if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \
430 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \
431 elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \
432 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \
434 if test "x@ENABLE_READLINE@" = "xyes"; then \
435 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \
436 elif test "x@ENABLE_READLINE@" = "xno"; then \
437 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \
439 if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \
440 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \
441 elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \
442 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \
444 if test "x@ENABLE_BACKOFF@" = "xyes"; then \
445 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \
446 elif test "x@ENABLE_BACKOFF@" = "xno"; then \
447 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \
449 if test "x@ENABLE_EFENCE@" = "xyes"; then \
450 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \
451 elif test "x@ENABLE_EFENCE@" = "xno"; then \
452 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \
454 export KERNEL_OBJ="$(LINUX_OBJ)"; \
455 export KERNEL_SRC="$(LINUX)"; \
456 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
457 echo "Kernel Source: $${KERNEL_SRC}"; \
458 echo "Kernel Object: $${KERNEL_OBJ}"; \
459 if test "x@ENABLEO2IB@" = "xno"; then \
460 export IB_OPTIONS="--with-o2ib=no"; \
462 if test "x@ENABLEO2IB@" != "xyes" && \
463 test -n "@O2IBPATH@"; then \
464 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
466 export IB_OPTIONS="--with-o2ib=yes"; \
469 cp -v debian/control.main debian/control ; \
470 sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \
471 > debian/lustre-tests.install; \
472 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
473 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
474 rc=$${PIPESTATUS[0]}; \
475 cp $$debiantmp/control.main.bkp debian/control.main || true && \
476 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
477 [ $${rc} -gt 1 ] && exit $${rc}; \
480 cp $$debiantmp/control.main.bkp debian/control.main || true && \
481 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
482 cp -v debian/control.main debian/control || true ; \
483 export KPKG_DEST_DIR="$$(pwd)/.." && \
484 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
485 rm -rf debian/tmp/modules-deb && \
486 mkdir debian/tmp/modules-deb && \
487 pushd debian/tmp/modules-deb && \
488 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
490 tar -C usr_src/ -xjf usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2 && \
491 chmod 755 usr_src/modules/lustre/debian/rules && \
492 mkdir -p usr_share_modass && \
493 ln -s /usr/share/modass/include/ usr_share_modass/ && \
494 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
495 echo "lustre" > usr_share_modass/compliant.list && \
496 export MA_DIR=$$(pwd)/usr_share_modass && \
497 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
498 export KSRC_TREE=$(LINUX) && \
499 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
500 TARBALL=$$(realpath usr/src/lustre-$${SRC_GIT_HASH}.tar.bz2) \
501 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
503 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
504 if test "x@ENABLE_SERVER@" = "xyes"; then \
505 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
508 if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \
509 debian/repackage-multiple-lnds.sh $${KVERS} $${VER} ../lustre-*-modules-$${KVERS}_$${VER}_*.deb ; \
510 MULTILNDPKGS="../lustre-lnet-module-*-$${KVERS}_$${VER}_*.deb"; \
513 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
514 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
515 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} $${MULTILNDPKGS} \
516 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
517 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
518 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
521 dkms-debs: undef.h debs_common
522 cp -v debian/changelog.in debian/changelog ; \
523 export SRC_GIT_HASH=$$(git log --oneline | head -1 | cut -d' ' -f1); \
524 lversion=$$(echo @VERSION@ | tr '_' '-'); \
525 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
526 if [ "$$lversion" != "$$cversion" ]; then \
527 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; \
530 export DEB_BUILD_PROFILES="client"; \
531 export KERNEL_OBJ="$(LINUX_OBJ)"; \
532 export KERNEL_SRC="$(LINUX)"; \
533 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
534 tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
535 echo "Kernel Source: $${KERNEL_SRC}"; \
536 echo "Kernel Object: $${KERNEL_OBJ}"; \
537 export BUILD_DKMS="true" && \
538 cp -v debian/control.main debian/control ; \
539 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \
540 rc=$${PIPESTATUS[0]}; \
541 [ $${rc} -gt 1 ] && exit $${rc}; \
544 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
546 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
547 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
548 ../lustre-*-utils_$${VER}_*.deb \
549 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
550 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
551 ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \
554 EXTRA_DIST += debian/*
557 CSTKO=/tmp/checkstack.orig
560 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
561 { for MOD in $$(find . -name "*.ko"); do \
562 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
563 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
564 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
567 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
570 rm -f ${CSTK} ${CSTKO}