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: ldiskfs-sources lustre-sources
78 $(MAKE) CC="$(CC)" $(CROSS_VARS) -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 find $(distdir) -name .deps -o \
92 -name .#* -exec rm -rf {} \;
93 $(MAKE) $(AM_MAKEFLAGS) \
94 top_distdir="$(top_distdir)" distdir="$(distdir)" \
97 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
100 build/gen_filelist.sh
103 @(if test -z "$(RPMBUILD)"; then \
105 "*** Required util 'rpmbuild' missing. Please install the\n" \
106 "*** package for your distribution which provides 'rpmbuild',\n" \
107 "*** re-run configure, and try again.\n"; \
110 $(MKDIR_P) $(rpmbuilddir)/TMP && \
111 $(MKDIR_P) $(rpmbuilddir)/BUILD && \
112 $(MKDIR_P) $(rpmbuilddir)/RPMS && \
113 $(MKDIR_P) $(rpmbuilddir)/SRPMS && \
114 $(MKDIR_P) $(rpmbuilddir)/SPECS && \
115 $(MKDIR_P) $(rpmbuilddir)/SOURCES)
118 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
119 $(MAKE) $(AM_MAKEFLAGS) \
120 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
122 --define "_tmppath $$rpmbuilddir/TMP" \
123 --define "_topdir $$rpmbuilddir" \
124 @RPMBUILD_BINARY_ARGS@ \
125 --rebuild $(distdir)-*.src.rpm || exit 1; \
126 cp $$rpmbuilddir/RPMS/*/*.rpm $(top_srcdir) || exit 1; \
129 srpm: @PACKAGE_TARNAME@.spec dist Makefile
130 rpmbuilddir=`mktemp -t -d rpmbuild-@PACKAGE@-$$USER-XXXXXXXX`; \
131 $(MAKE) $(AM_MAKEFLAGS) \
132 rpmbuilddir="$$rpmbuilddir" rpm-local || exit 1; \
134 --define "_tmppath $$rpmbuilddir/TMP" \
135 --define "_topdir $$rpmbuilddir" \
136 --define "build_src_rpm 1" \
137 --define "dist %{nil}" \
138 -ts $(distdir).tar.gz || exit 1; \
139 cp $$rpmbuilddir/SRPMS/$(distdir)-*.src.rpm $(top_srcdir) || exit 1; \
142 # In the debs target, first make sure what's in the changelog reflects
143 # the software version. Here's how we could dig the version out of the
144 # autoconf version file directly:
145 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
146 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
148 # However, one cannot really run "make debs" without having done a
149 # configure first, so we could use the easier method of digging the
150 # version out of the config.h file.
152 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
153 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
154 if [ "$$lversion" != "$$cversion" ]; then \
155 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; \
158 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
159 rc=$${PIPESTATUS[0]}; \
160 [ $${rc} -gt 1 ] && exit $${rc}; \
163 export KPKG_DEST_DIR="$$(pwd)/.." && \
164 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
165 rm -rf debian/tmp/modules-deb && \
166 mkdir debian/tmp/modules-deb && \
167 pushd debian/tmp/modules-deb && \
168 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
170 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
171 chmod 755 usr_src/modules/lustre/debian/rules && \
172 mkdir -p usr_share_modass && \
173 ln -s /usr/share/modass/include/ usr_share_modass/ && \
174 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
175 echo "lustre" > usr_share_modass/compliant.list && \
176 export MA_DIR=$$(pwd)/usr_share_modass && \
177 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
178 [ "x@ENABLEO2IB@" != "x" ] && \
179 export IB_OPTIONS="--with-o2ib=@O2IBPATHS@" && \
180 export KSRC_TREE=$(LINUX) && \
181 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
182 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
184 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
186 mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb \
187 ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb \
188 ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \
189 ../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \
190 ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
192 EXTRA_DIST += config.h.in
195 EXTRA_DIST += debian/*
199 CSTKO=/tmp/checkstack.orig
202 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
203 { for MOD in $$(find . -name "*.ko"); do \
204 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
205 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
206 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
209 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
212 rm -f ${CSTK} ${CSTKO}
215 @if [ -d .git ]; then \
216 perl lustre/scripts/version_tag.pl \
217 --make_META > $(distdir)/META; \
218 elif [ -f META ]; then \
219 cp META $(distdir)/META; \
222 "*** I have no idea how to create a META file in $(distdir).\n"\
223 "*** Please file a bug at https://jira.hpdd.intel.com/\n"; \