1 SUBDIRS := @LDISKFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
2 DIST_SUBDIRS := @LDISKFS_DIST_SUBDIR@ @SNMP_DIST_SUBDIR@ libsysio lustre-iokit @LIBCFS_SUBDIR@ lnet lustre config contrib
3 SOURCES_SUBDIRS := @LIBCFS_SUBDIR@ lnet lustre
4 RPM_SUBDIRS := @LDISKFS_SUBDIR@ @LUSTREIOKIT_SUBDIR@
5 MODULE_SYMVERS_DEPS = module-symvers
7 @TESTS_TRUE@BUILD_TESTS = true
8 @TESTS_FALSE@BUILD_TESTS = false
9 @SERVER_TRUE@BUILD_SERVER = true
10 @SERVER_FALSE@BUILD_SERVER = false
11 @CLIENT_TRUE@BUILD_CLIENT = true
12 @CLIENT_FALSE@BUILD_CLIENT = false
13 @LDISKFS_ENABLED_TRUE@BUILD_OSD_LDISKFS = true
14 @LDISKFS_ENABLED_FALSE@BUILD_OSD_LDISKFS = false
15 @ZFS_ENABLED_TRUE@BUILD_OSD_ZFS = true
16 @ZFS_ENABLED_FALSE@BUILD_OSD_ZFS = false
18 AUTOMAKE_OPTIONS = foreign
20 FIND_TAG_FILES_CMD = find $(top_srcdir) \
21 -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage \
22 -prune -false -o -type f -name '*.[hc]'
25 for subdir in $(RPM_SUBDIRS) ; do \
26 echo "Making $@ in $$subdir" ; \
28 $(MAKE) $(AM_MAKEFLAGS) $@ ; \
30 echo "Finished $@ in $$subdir" ; \
33 # these empty rules are needed so that automake doesn't add its own
46 $(RM) $(top_srcdir)/TAGS
47 ETAGSF=`etags --version | grep -iq exuberant && \
48 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
49 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
52 $(RM) $(top_srcdir)/tags
53 CTAGSF=`ctags --version | grep -iq exuberant && \
54 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
55 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
60 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
61 $(FIND_TAG_FILES_CMD) > cscope.files
65 $(FIND_TAG_FILES_CMD) | xargs mkid
68 doxygen: doxygen-api doxygen-ref
70 doxygen-%: build/doxyfile.%
76 all-sources: $(MODULE_SYMVERS_DEPS)
77 for dir in $(SOURCES_SUBDIRS) ; do \
78 $(MAKE) sources -C $$dir || exit $$? ; \
84 modules: $(DEP) all-sources
85 $(MAKE) CC="$(CC)" $(CROSS_VARS) -C $(LINUX_OBJ) \
86 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
87 LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(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)' \
88 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
89 include/config/MARKER $@
95 $(RM) $(distdir)/ldiskfs/*.spec
96 $(RM) $(distdir)/lustre-iokit/*.spec
97 find $(distdir) -name .deps -o \
101 -name .#* | xargs rm -rf
102 $(MAKE) $(AM_MAKEFLAGS) \
103 top_distdir="$(top_distdir)" distdir="$(distdir)" \
106 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
111 EXTRA_DIST += build/gen_filelist.sh
114 rpms-real: @PACKAGE_TARNAME@.spec dist Makefile
115 CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | \
116 sed -re 's/--(en|dis)able-tests//'); \
117 if [ -n "@LINUX@" ]; then \
118 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
119 sed -re 's/--with-linux=[^ ][^ ]*//'); \
120 RPMARGS="--define \"kdir @LINUX@\""; \
121 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
122 sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
123 if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
124 RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
127 if [ -n "@CROSS_PATH@" ]; then \
128 if [[ "X$(BUILD_SERVER)" = Xtrue ]]; then \
130 "*** Don't support cross compilation for the Intel(R) Xeon Phi(TM) card.\n"; \
133 CROSS_SUFFIX="-mic"; \
134 RPMARGS="$$RPMARGS --define \"post_script build/gen_filelist.sh\""; \
135 RPMARGS="$$RPMARGS --define \"cross_path @CROSS_PATH@\""; \
136 RPMARGS="$$RPMARGS --define \"rootdir %{cross_path}\""; \
137 RPMARGS="$$RPMARGS --define \"_prefix %{cross_path}/usr\""; \
138 RPMARGS="$$RPMARGS --define \"_mandir %{_prefix}/share/man\""; \
139 RPMARGS="$$RPMARGS --define \"_sysconfdir %{cross_path}/etc\""; \
140 RPMARGS="$$RPMARGS --define \"make_args @CROSS_VARS@\""; \
141 if [ -s @LINUX@/../../.ver.build ]; then \
142 MPSS_VERSION=$$(sed -ne 's/DRIVERS_\(.*\)-.*/\1/p' @LINUX@/../../.ver.build); \
143 if [ -n "$$MPSS_VERSION" ]; then \
144 RPMARGS="$$RPMARGS --define \"cross_requires intel-mic-gpl = 2.1.$$MPSS_VERSION\""; \
148 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
149 sed -re 's/--with-release=[^ ][^ ]*//'); \
150 RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
151 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
152 RPMARGS="$$RPMARGS --define \"build_lustre_tests 0\""; \
154 if [[ "X$(BUILD_SERVER)" = Xfalse ]]; then \
155 RPMARGS="$$RPMARGS --define \"lustre_name lustre-client$$CROSS_SUFFIX\""; \
157 if [[ "X$(BUILD_OSD_LDISKFS)" = Xtrue ]]; then \
158 RPMARGS="$$RPMARGS --define \"build_lustre_osd_ldiskfs 1\""; \
160 if [[ "X$(BUILD_OSD_ZFS)" = Xtrue ]]; then \
161 RPMARGS="$$RPMARGS --define \"build_lustre_osd_zfs 1\""; \
163 echo "Building Lustre RPM with $$RPMARGS"; \
164 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
166 srpm-real: @PACKAGE_TARNAME@.spec dist Makefile
167 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
168 RPMARGS="--define \"build_lustre_tests 0\""; \
170 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
174 $(MAKE) $(AM_MAKEFLAGS) rpms-real
178 $(MAKE) $(AM_MAKEFLAGS) srpm-real
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 m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
218 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
220 mv ../liblustre_$${VER}_*.deb ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes ../lustre_$${VER%-[0-9]*}.orig.tar.gz ../lustre_$${VER}.diff.gz ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
222 EXTRA_DIST += config.h.in
225 EXTRA_DIST += debian/*
228 module-symvers-ldiskfs:
230 @if [ -f @LDISKFS_DIR@/@SYMVERFILE@ ]; then \
231 cat @LDISKFS_DIR@/@SYMVERFILE@ >>@SYMVERFILE@; \
232 elif [ -f @LDISKFS_DIR@/ldiskfs/@SYMVERFILE@ ]; then \
233 cat @LDISKFS_DIR@/ldiskfs/@SYMVERFILE@ >>@SYMVERFILE@; \
236 "*** Missing ldiskfs symbols. Ensure you have built ldiskfs:\n"\
237 "*** - @LDISKFS_OBJ@/ldiskfs/@SYMVERFILE@\n"; \
240 endif # LDISKFS_ENABLED
244 @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
245 cat @SPL_OBJ@/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
246 elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
247 cat @SPL_OBJ@/module/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
250 "*** Missing spl symbols. Ensure you have built spl:\n" \
251 "*** - @SPL_OBJ@/@SYMVERFILE@\n"; \
254 @if [ -f @ZFS_OBJ@/@ZFS_SYMBOLS@ ]; then \
255 cat @ZFS_OBJ@/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
256 elif [ -f @ZFS_OBJ@/module/@ZFS_SYMBOLS@ ]; then \
257 cat @ZFS_OBJ@/module/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
260 "*** Missing zfs symbols. Ensure you have built zfs:\n" \
261 "*** - @ZFS_OBJ@/@SYMVERFILE@\n"; \
266 module-symvers: module-symvers-ldiskfs module-symvers-zfs
269 CSTKO=/tmp/checkstack.orig
272 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
273 { for MOD in $$(find . -name "*.ko"); do \
274 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
275 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
276 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
279 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
282 rm -f ${CSTK} ${CSTKO}
285 if [ -d CVS -o -d .git ]; then \
286 perl lustre/scripts/make_META.pl > $(distdir)/META; \
287 elif [ -f META ]; then \
288 cp META $(distdir)/META; \
290 echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \
294 if [ -f $(distdir)/META -a -d $(distdir)/ldiskfs ]; then \
295 cp $(distdir)/META $(distdir)/ldiskfs/META; \