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 lustre-sources
68 $(MAKE) sources -C @LDISKFS_SUBDIR@ || exit $$?
72 $(MAKE) sources -C lustre || exit $$?
77 modules: undef.h ldiskfs-sources lustre-sources
78 $(MAKE) CC="$(CC)" -C $(LINUX_OBJ) \
79 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
80 LINUXINCLUDE='-I$$(srctree)/arch/$$(SRCARCH)/include -Iarch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-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)' \
81 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
82 include/config/MARKER $@
88 grep -v config.h.in config.h.in > $@
91 find $(distdir) -name .deps -o \
95 -name .#* -exec rm -rf {} \;
97 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
102 lustre-dkms_pre-build.sh \
103 lustre-dkms_post-build.sh \
108 @(if test -z "$(RPMBUILD)"; then \
110 "*** Required util 'rpmbuild' missing. Please install the\n" \
111 "*** package for your distribution which provides 'rpmbuild',\n" \
112 "*** re-run configure, and try again.\n"; \
115 $(MKDIR_P) $(rpmbuilddir)/TMP && \
116 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
117 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
118 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
119 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
120 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
123 DKMS_PACKAGE=$(PACKAGE)
124 DKMS_SERVER=--with servers
126 DKMS_PACKAGE=$(PACKAGE)-client
127 DKMS_SERVER=--without servers
130 # Only zfs Lustre DKMS Server is supported, so previous configure command
131 # must use related parameters for success.
132 dkms-srpm: $(PACKAGE)-dkms.spec dist Makefile
133 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
134 $(MAKE) $(AM_MAKEFLAGS) \
135 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
137 --define "_tmppath $$rpmbuilddir/TMP" \
138 --define "_topdir $$rpmbuilddir" \
139 --define "_sourcedir $(top_srcdir)" \
141 --bs $(PACKAGE)-dkms.spec || exit 1; \
142 cp $$rpmbuilddir/SRPMS/*.src.rpm $(top_srcdir) || exit 1; \
146 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
148 --define "_tmppath $$rpmbuilddir/TMP" \
149 --define "_topdir $$rpmbuilddir" \
150 @RPMBUILD_BINARY_ARGS@ \
151 --rebuild $(DKMS_PACKAGE)-dkms-*.src.rpm || exit 1; \
152 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
156 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
157 $(MAKE) $(AM_MAKEFLAGS) \
158 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
160 --define "_tmppath $$rpmbuilddir/TMP" \
161 --define "_topdir $$rpmbuilddir" \
162 @RPMBUILD_BINARY_ARGS@ \
163 --rebuild $(distdir)-*.src.rpm || exit 1; \
164 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
167 srpm: @PACKAGE_TARNAME@.spec dist Makefile
168 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
169 $(MAKE) $(AM_MAKEFLAGS) \
170 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
172 --define "_tmppath $$rpmbuilddir/TMP" \
173 --define "_topdir $$rpmbuilddir" \
174 --define "build_src_rpm 1" \
175 --define "dist %{nil}" \
176 -ts $(distdir).tar.gz || exit 1; \
177 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
180 # In the debs target, first make sure what's in the changelog reflects
181 # the software version. Here's how we could dig the version out of the
182 # autoconf version file directly:
183 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
184 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
186 # However, one cannot really run "make debs" without having done a
187 # configure first, so we could use the easier method of digging the
188 # version out of the config.h file.
190 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
191 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
192 if [ "$$lversion" != "$$cversion" ]; then \
193 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; \
196 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
197 rc=$${PIPESTATUS[0]}; \
198 [ $${rc} -gt 1 ] && exit $${rc}; \
201 export KPKG_DEST_DIR="$$(pwd)/.." && \
202 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
203 rm -rf debian/tmp/modules-deb && \
204 mkdir debian/tmp/modules-deb && \
205 pushd debian/tmp/modules-deb && \
206 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
208 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
209 chmod 755 usr_src/modules/lustre/debian/rules && \
210 mkdir -p usr_share_modass && \
211 ln -s /usr/share/modass/include/ usr_share_modass/ && \
212 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
213 echo "lustre" > usr_share_modass/compliant.list && \
214 export MA_DIR=$$(pwd)/usr_share_modass && \
215 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
216 if test "x@ENABLEO2IB@" = "xno"; then \
217 export IB_OPTIONS="--with-o2ib=no"; \
219 if test -n "@O2IBPATH@"; then \
220 export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
223 export KSRC_TREE=$(LINUX) && \
224 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
225 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
227 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
229 mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb \
230 ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb \
231 ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \
232 ../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \
233 ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
236 EXTRA_DIST += debian/*
240 CSTKO=/tmp/checkstack.orig
243 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
244 { for MOD in $$(find . -name "*.ko"); do \
245 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
246 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
247 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
250 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
253 rm -f ${CSTK} ${CSTKO}