1 SUBDIRS := @LDISKFS_SUBDIR@ \
9 DIST_SUBDIRS := ldiskfs \
17 AUTOMAKE_OPTIONS = foreign
19 FIND_TAG_FILES_CMD = find $(top_srcdir) \
20 -path $(top_srcdir)/ldiskfs/linux-stage \
21 -prune -false -o -type f -name '*.[hc]'
23 # these empty rules are needed so that automake doesn't add its own
36 $(RM) $(top_srcdir)/TAGS
37 ETAGSF=`etags --version | grep -iq exuberant && \
38 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
39 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
42 $(RM) $(top_srcdir)/tags
43 CTAGSF=`ctags --version | grep -iq exuberant && \
44 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
45 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
50 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
51 $(FIND_TAG_FILES_CMD) > cscope.files
55 $(FIND_TAG_FILES_CMD) | xargs mkid
58 doxygen: doxygen-api doxygen-ref
60 doxygen-%: build/doxyfile.%
64 .PHONY: ldiskfs-sources
68 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
74 modules: undef.h ldiskfs-sources
75 $(MAKE) LDFLAGS= CC="$(CC)" -C $(LINUX_OBJ) \
76 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
77 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)' \
78 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
79 include/config/MARKER $@
87 grep -v config.h.in config.h.in > $@
90 find $(distdir) -name .deps -o \
94 -name .#* -exec rm -rf {} \;
96 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
100 lustre-dkms_pre-build.sh \
101 lustre-dkms_post-build.sh \
103 LUSTRE-VERSION-FILE \
106 # contrib is a directory. Putting a directory in EXTRA_DIST
107 # recursively includes the entire directory contents in the
108 # distribution tarball (the tarball created with "make dist").
109 EXTRA_DIST += contrib
113 @(if test -z "$(RPMBUILD)"; then \
115 "*** Required util 'rpmbuild' missing. Please install the\n" \
116 "*** package for your distribution which provides 'rpmbuild',\n" \
117 "*** re-run configure, and try again.\n"; \
120 $(MKDIR_P) $(rpmbuilddir)/TMP && \
121 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
122 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
123 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
124 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
125 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
128 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
129 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
130 $(MAKE) $(AM_MAKEFLAGS) \
131 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
133 --define "_tmppath $$rpmbuilddir/TMP" \
134 --define "_topdir $$rpmbuilddir" \
135 --define "_sourcedir $(top_srcdir)" \
136 --with servers --with zfs -without ldiskfs \
137 --bs $(PACKAGE)-dkms.spec || exit 1; \
139 --define "_tmppath $$rpmbuilddir/TMP" \
140 --define "_topdir $$rpmbuilddir" \
141 --define "_sourcedir $(top_srcdir)" \
142 --with servers --without zfs --with ldiskfs \
143 --bs $(PACKAGE)-dkms.spec || exit 1; \
145 --define "_tmppath $$rpmbuilddir/TMP" \
146 --define "_topdir $$rpmbuilddir" \
147 --define "_sourcedir $(top_srcdir)" \
148 --with servers --with zfs --with ldiskfs \
149 --bs $(PACKAGE)-dkms.spec || exit 1; \
150 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
154 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
156 --define "_tmppath $$rpmbuilddir/TMP" \
157 --define "_topdir $$rpmbuilddir" \
158 @RPMBUILD_BINARY_ARGS@ \
159 --with servers --with zfs --without ldiskfs \
160 --rebuild $(PACKAGE)-zfs-dkms-*.src.rpm || exit 1; \
162 --define "_tmppath $$rpmbuilddir/TMP" \
163 --define "_topdir $$rpmbuilddir" \
164 @RPMBUILD_BINARY_ARGS@ \
165 --with servers --without zfs --with ldiskfs \
166 --rebuild $(PACKAGE)-ldiskfs-dkms-*.src.rpm || exit 1; \
168 --define "_tmppath $$rpmbuilddir/TMP" \
169 --define "_topdir $$rpmbuilddir" \
170 @RPMBUILD_BINARY_ARGS@ \
171 --with servers --with zfs --with ldiskfs \
172 --rebuild $(PACKAGE)-all-dkms-*.src.rpm || exit 1; \
173 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
177 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
178 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
179 $(MAKE) $(AM_MAKEFLAGS) \
180 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
182 --define "_tmppath $$rpmbuilddir/TMP" \
183 --define "_topdir $$rpmbuilddir" \
184 --define "_sourcedir $(top_srcdir)" \
186 --bs $(PACKAGE)-dkms.spec || exit 1; \
187 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
191 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
193 --define "_tmppath $$rpmbuilddir/TMP" \
194 --define "_topdir $$rpmbuilddir" \
195 @RPMBUILD_BINARY_ARGS@ \
197 --rebuild $(PACKAGE)-client-dkms-*.src.rpm || exit 1; \
198 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
203 dkms-srpms: dkms-srpm
208 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
209 $(MAKE) $(AM_MAKEFLAGS) \
210 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
212 --define "_tmppath $$rpmbuilddir/TMP" \
213 --define "_topdir $$rpmbuilddir" \
214 @RPMBUILD_BINARY_ARGS@ \
215 --rebuild $(distdir)-*.src.rpm || exit 1; \
216 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
219 srpm: @PACKAGE_TARNAME@.spec dist Makefile
220 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
221 $(MAKE) $(AM_MAKEFLAGS) \
222 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
223 cp $(top_srcdir)/rpm/* $(top_srcdir); \
225 --define "_tmppath $$rpmbuilddir/TMP" \
226 --define "_topdir $$rpmbuilddir" \
227 --define "dist %{nil}" \
228 -ts $(distdir).tar.gz || exit 1; \
229 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
232 # In the debs target, first make sure what's in the changelog reflects
233 # the software version.
235 lversion=$$(echo @VERSION@ | tr '_' '-'); \
236 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
237 if [ "$$lversion" != "$$cversion" ]; then \
238 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; \
241 if test "x@ENABLE_SERVER@" = "xyes"; then \
242 DEB_BUILD_PROFILES="server"; \
244 DEB_BUILD_PROFILES="client"; \
246 if test "x@ENABLE_LDISKFS@" = "xyes"; then \
247 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \
249 if test "x@ENABLE_ZFS@" = "xyes"; then \
250 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \
251 export SPL_SRC="@SPL@"; \
252 export ZFS_SRC="@ZFS@"; \
253 echo "ZFS support is enabled. Will expect pre-compiled SPL and ZFS sources in:"; \
254 echo "SPL: $${SPL_SRC}"; \
255 echo "ZFS: $${ZFS_SRC}"; \
257 if test "x@ENABLEO2IB@" != "xno"; then \
258 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
259 export O2IB_SRC="@O2IBPATH@"; \
261 if test "x@ENABLE_GSS@" = "xyes"; then \
262 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \
263 debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \
264 cp debian/control $$debiantmp/control.bkp ; \
265 cp debian/control.main $$debiantmp/control.main.bkp ; \
266 cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \
267 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \
268 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"; else print; fi}' debian/control.main > $$debiantmp/control.main && mv $$debiantmp/control.main debian/control.main ; \
269 sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.modules.in ; \
270 elif test "x@ENABLE_GSS@" = "xno"; then \
271 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogss"; \
273 if test "x@ENABLE_CRYPTO@" = "xyes"; then \
274 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} crypto"; \
275 elif test "x@ENABLE_CRYPTO@" = "xno"; then \
276 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nocrypto"; \
278 if test "x@systemdsystemunitdir@" != "x"; then \
279 export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
281 export KERNEL_OBJ="$(LINUX_OBJ)"; \
282 export KERNEL_SRC="$(LINUX)"; \
283 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
284 echo "Kernel Source: $${KERNEL_SRC}"; \
285 echo "Kernel Object: $${KERNEL_OBJ}"; \
286 if test "x@ENABLEO2IB@" = "xno"; then \
287 export IB_OPTIONS="--with-o2ib=no"; \
289 if test "x@ENABLEO2IB@" != "xyes" && \
290 test -n "@O2IBPATH@"; then \
291 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
293 export IB_OPTIONS="--with-o2ib=yes"; \
296 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
297 rc=$${PIPESTATUS[0]}; \
298 cp $$debiantmp/control.bkp debian/control || true && \
299 cp $$debiantmp/control.main.bkp debian/control.main || true && \
300 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
301 [ $${rc} -gt 1 ] && exit $${rc}; \
304 cp $$debiantmp/control.bkp debian/control || true && \
305 cp $$debiantmp/control.main.bkp debian/control.main || true && \
306 cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \
307 export KPKG_DEST_DIR="$$(pwd)/.." && \
308 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
309 rm -rf debian/tmp/modules-deb && \
310 mkdir debian/tmp/modules-deb && \
311 pushd debian/tmp/modules-deb && \
312 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
314 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
315 chmod 755 usr_src/modules/lustre/debian/rules && \
316 mkdir -p usr_share_modass && \
317 ln -s /usr/share/modass/include/ usr_share_modass/ && \
318 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
319 echo "lustre" > usr_share_modass/compliant.list && \
320 export MA_DIR=$$(pwd)/usr_share_modass && \
321 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
322 export KSRC_TREE=$(LINUX) && \
323 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
324 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
326 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
327 if test "x@ENABLE_SERVER@" = "xyes"; then \
328 DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \
331 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
332 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
333 ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \
334 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
335 ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \
339 lversion=$$(echo @VERSION@ | tr '_' '-'); \
340 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
341 if [ "$$lversion" != "$$cversion" ]; then \
342 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; \
345 export DEB_BUILD_PROFILES="client"; \
346 export KERNEL_OBJ="$(LINUX_OBJ)"; \
347 export KERNEL_SRC="$(LINUX)"; \
348 echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
349 echo "Kernel Source: $${KERNEL_SRC}"; \
350 echo "Kernel Object: $${KERNEL_OBJ}"; \
351 export BUILD_DKMS="true" && \
352 dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \
353 rc=$${PIPESTATUS[0]}; \
354 [ $${rc} -gt 1 ] && exit $${rc}; \
357 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
359 mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \
360 ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \
361 ../lustre-*-utils_$${VER}_*.deb \
362 ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \
363 ../lustre_$${VER}.tar.gz ../lustre-*-modules-dkms_$${VER}_*.deb \
366 EXTRA_DIST += debian/*
369 CSTKO=/tmp/checkstack.orig
372 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
373 { for MOD in $$(find . -name "*.ko"); do \
374 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
375 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
376 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
379 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
382 rm -f ${CSTK} ${CSTKO}