1 SUBDIRS := @LDISKFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LUSTREIOKIT_SUBDIR@ @LIBCFS_SUBDIR@ lnet lustre
2 DIST_SUBDIRS := ldiskfs @SNMP_DIST_SUBDIR@ libsysio lustre-iokit @LIBCFS_SUBDIR@ lnet lustre config contrib
4 @TESTS_TRUE@BUILD_TESTS = true
5 @TESTS_FALSE@BUILD_TESTS = false
6 @SERVER_TRUE@BUILD_SERVER = true
7 @SERVER_FALSE@BUILD_SERVER = false
8 @CLIENT_TRUE@BUILD_CLIENT = true
9 @CLIENT_FALSE@BUILD_CLIENT = false
10 @LDISKFS_ENABLED_TRUE@BUILD_OSD_LDISKFS = true
11 @LDISKFS_ENABLED_FALSE@BUILD_OSD_LDISKFS = false
12 @ZFS_ENABLED_TRUE@BUILD_OSD_ZFS = true
13 @ZFS_ENABLED_FALSE@BUILD_OSD_ZFS = false
14 @BUILD_LUSTREIOKIT_TRUE@BUILD_LUSTREIOKIT = true
15 @BUILD_LUSTREIOKIT_FALSE@BUILD_LUSTREIOKIT = false
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 module-symvers
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 -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)' \
81 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
82 include/config/MARKER $@
88 find $(distdir) -name .deps -o \
92 -name .#* | xargs rm -rf
93 $(MAKE) $(AM_MAKEFLAGS) \
94 top_distdir="$(top_distdir)" distdir="$(distdir)" \
97 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
100 build/gen_filelist.sh
102 rpms: @PACKAGE_TARNAME@.spec dist Makefile
103 @CONFIGURE_ARGS=""; \
104 for arg in $(ac_configure_args); do \
106 --with-release=* ) ;; \
107 --with-kmp-moddir=* ) ;; \
108 --enable-tests | --disable-tests ) ;; \
109 --with-linux=* | --with-linux-obj=* ) ;; \
110 * ) CONFIGURE_ARGS="$$CONFIGURE_ARGS '$$arg'" ;; \
113 RPMARGS="--define \"configure_args $$CONFIGURE_ARGS\""; \
114 if [ -n "@LINUX@" ]; then \
115 RPMARGS="$$RPMARGS --define \"kdir @LINUX@\""; \
116 if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
117 RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
120 if [ -n "@KMP_MODDIR@" ]; then \
121 RPMARGS="$$RPMARGS --define \"kmoddir @KMP_MODDIR@\""; \
123 if [ -n "@CROSS_PATH@" ]; then \
124 if [[ "X$(BUILD_SERVER)" = Xtrue ]]; then \
126 "*** Don't support cross compilation for the Intel(R) Xeon Phi(TM) card.\n"; \
129 CROSS_SUFFIX="-mic"; \
130 RPMARGS="$$RPMARGS --define \"post_script build/gen_filelist.sh\""; \
131 RPMARGS="$$RPMARGS --define \"cross_path @CROSS_PATH@\""; \
132 RPMARGS="$$RPMARGS --define \"rootdir %{cross_path}\""; \
133 RPMARGS="$$RPMARGS --define \"_prefix %{cross_path}/usr\""; \
134 RPMARGS="$$RPMARGS --define \"_mandir %{_prefix}/share/man\""; \
135 RPMARGS="$$RPMARGS --define \"_sysconfdir %{cross_path}/etc\""; \
136 RPMARGS="$$RPMARGS --define \"make_args @CROSS_VARS@\""; \
137 if [ "@CC_TARGET_ARCH@" = "k1om-mpss-linux" ]; then \
138 RPMARGS="$$RPMARGS --define \"cross_requires mpss-bootimage\""; \
140 RPMARGS="$$RPMARGS --define \"cross_requires intel-mic-gpl\""; \
143 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
144 RPMARGS="$$RPMARGS --without lustre_tests"; \
146 if [[ "X$(BUILD_SERVER)" = Xfalse ]]; then \
147 RPMARGS="$$RPMARGS --without servers"; \
148 if [ -n "$$CROSS_SUFFIX" ]; then \
149 RPMARGS="$$RPMARGS --define \"lustre_name lustre-client$$CROSS_SUFFIX\""; \
152 if [[ "X$(BUILD_OSD_LDISKFS)" = Xtrue ]]; then \
153 RPMARGS="$$RPMARGS --with ldiskfs"; \
155 if [[ "X$(BUILD_OSD_ZFS)" = Xtrue ]]; then \
156 RPMARGS="$$RPMARGS --with zfs"; \
158 if [[ "X$(BUILD_LUSTREIOKIT)" = Xfalse ]]; then \
159 RPMARGS="$$RPMARGS --without lustre_iokit"; \
161 echo "Building Lustre RPM with $$RPMARGS"; \
162 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
164 srpm: @PACKAGE_TARNAME@.spec dist Makefile
165 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
166 RPMARGS="--without lustre_tests"; \
168 if [[ "X$(BUILD_LUSTREIOKIT)" = Xfalse ]]; then \
169 RPMARGS="$$RPMARGS --without lustre_iokit"; \
171 eval rpmbuild $$RPMARGS -ts $(distdir).tar.gz
173 # In the debs target, first make sure what's in the changelog reflects
174 # the software version. Here's how we could dig the version out of the
175 # autoconf version file directly:
176 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
177 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
179 # However, one cannot really run "make debs" without having done a
180 # configure first, so we could use the easier method of digging the
181 # version out of the config.h file.
183 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
184 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
185 if [ "$$lversion" != "$$cversion" ]; then \
186 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; \
189 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
190 rc=$${PIPESTATUS[0]}; \
191 [ $${rc} -gt 1 ] && exit $${rc}; \
194 export KPKG_DEST_DIR="$$(pwd)/.." && \
195 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
196 rm -rf debian/tmp/modules-deb && \
197 mkdir debian/tmp/modules-deb && \
198 pushd debian/tmp/modules-deb && \
199 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
201 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
202 chmod 755 usr_src/modules/lustre/debian/rules && \
203 mkdir -p usr_share_modass && \
204 ln -s /usr/share/modass/include/ usr_share_modass/ && \
205 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
206 echo "lustre" > usr_share_modass/compliant.list && \
207 export MA_DIR=$$(pwd)/usr_share_modass && \
208 KVERS=$${KVERS:-$(LINUXRELEASE)}; \
209 m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
211 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
213 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/
215 EXTRA_DIST += config.h.in
218 EXTRA_DIST += debian/*
223 @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
224 cat @SPL_OBJ@/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
225 elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
226 cat @SPL_OBJ@/module/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
229 "*** Missing spl symbols. Ensure you have built spl:\n" \
230 "*** - @SPL_OBJ@/@SYMVERFILE@\n"; \
233 @if [ -f @ZFS_OBJ@/@ZFS_SYMBOLS@ ]; then \
234 cat @ZFS_OBJ@/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
235 elif [ -f @ZFS_OBJ@/module/@ZFS_SYMBOLS@ ]; then \
236 cat @ZFS_OBJ@/module/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
239 "*** Missing zfs symbols. Ensure you have built zfs:\n" \
240 "*** - @ZFS_OBJ@/@SYMVERFILE@\n"; \
245 module-symvers: module-symvers-zfs
248 CSTKO=/tmp/checkstack.orig
251 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
252 { for MOD in $$(find . -name "*.ko"); do \
253 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
254 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
255 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
258 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
261 rm -f ${CSTK} ${CSTKO}
264 if [ -d .git ]; then \
265 perl lustre/scripts/version_tag.pl --make_META > $(distdir)/META; \
266 elif [ -f META ]; then \
267 cp META $(distdir)/META; \
269 echo -e "I have no idea how to create a META file in $(distdir).\nPlease file a bug at http://bugzilla.lustre.org/"; \