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 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 -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
102 rpms: @PACKAGE_TARNAME@.spec dist Makefile
103 rpmbuild @RPMBUILD_BINARY_ARGS@ -ta $(distdir).tar.gz
105 srpm: @PACKAGE_TARNAME@.spec dist Makefile
106 rpmbuild @RPMBUILD_SOURCE_ARGS@ -ts $(distdir).tar.gz
108 # In the debs target, first make sure what's in the changelog reflects
109 # the software version. Here's how we could dig the version out of the
110 # autoconf version file directly:
111 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
112 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
114 # However, one cannot really run "make debs" without having done a
115 # configure first, so we could use the easier method of digging the
116 # version out of the config.h file.
118 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
119 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
120 if [ "$$lversion" != "$$cversion" ]; then \
121 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; \
124 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
125 rc=$${PIPESTATUS[0]}; \
126 [ $${rc} -gt 1 ] && exit $${rc}; \
129 export KPKG_DEST_DIR="$$(pwd)/.." && \
130 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
131 rm -rf debian/tmp/modules-deb && \
132 mkdir debian/tmp/modules-deb && \
133 pushd debian/tmp/modules-deb && \
134 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
136 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
137 chmod 755 usr_src/modules/lustre/debian/rules && \
138 mkdir -p usr_share_modass && \
139 ln -s /usr/share/modass/include/ usr_share_modass/ && \
140 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
141 echo "lustre" > usr_share_modass/compliant.list && \
142 export MA_DIR=$$(pwd)/usr_share_modass && \
143 KVERS=$${KVERS:-$(LINUXRELEASE)} && \
144 export KSRC_TREE=$(LINUX) && \
145 KSRC=$${KSRC:-$(LINUX_OBJ)} && \
146 m-a build $${KSRC:+-k $$KSRC} $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
148 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog) && \
150 mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb \
151 ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb \
152 ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \
153 ../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \
154 ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/
156 EXTRA_DIST += config.h.in
159 EXTRA_DIST += debian/*
164 @if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
165 cat @SPL_OBJ@/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
166 elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
167 cat @SPL_OBJ@/module/@SPL_SYMBOLS@ >>@SYMVERFILE@; \
170 "*** Missing spl symbols. Ensure you have built spl:\n" \
171 "*** - @SPL_OBJ@/@SYMVERFILE@\n"; \
174 @if [ -f @ZFS_OBJ@/@ZFS_SYMBOLS@ ]; then \
175 cat @ZFS_OBJ@/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
176 elif [ -f @ZFS_OBJ@/module/@ZFS_SYMBOLS@ ]; then \
177 cat @ZFS_OBJ@/module/@ZFS_SYMBOLS@ >>@SYMVERFILE@; \
180 "*** Missing zfs symbols. Ensure you have built zfs:\n" \
181 "*** - @ZFS_OBJ@/@SYMVERFILE@\n"; \
186 module-symvers: module-symvers-zfs
189 CSTKO=/tmp/checkstack.orig
192 [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv -f ${CSTK} ${CSTKO} || true
193 { for MOD in $$(find . -name "*.ko"); do \
194 objdump -d $$MOD | perl contrib/scripts/checkstack.pl; \
195 done } | grep -v " bug " | sort -nr | uniq > ${CSTK}
196 [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -n 30 ${CSTK}
199 [ -f ${CSTK} ] && mv -f ${CSTK} ${CSTKO}
202 rm -f ${CSTK} ${CSTKO}
205 @if [ -d .git ]; then \
206 perl lustre/scripts/version_tag.pl \
207 --make_META > $(distdir)/META; \
208 elif [ -f META ]; then \
209 cp META $(distdir)/META; \
212 "*** I have no idea how to create a META file in $(distdir).\n"\
213 "*** Please file a bug at https://jira.hpdd.intel.com/\n"; \