2 # This file is included by each package's toplevel autoMakefile[.am],
3 # which must define SUBDIRS as a minimum.
5 AUTOMAKE_OPTIONS = foreign
7 FIND_TAG_FILES_CMD = find $(top_srcdir) \
8 -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage -prune -false -o\
12 for subdir in $(RPM_SUBDIRS) ; do \
13 echo "Making $@ in $$subdir" ; \
15 $(MAKE) $(AM_MAKEFLAGS) $@ ; \
17 echo "Finished $@ in $$subdir" ; \
20 # these empty rules are needed so that automake doesn't add its own
33 $(RM) $(top_srcdir)/TAGS
34 ETAGSF=`etags --version | grep -iq exuberant && \
35 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
36 $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
39 $(RM) $(top_srcdir)/tags
40 CTAGSF=`ctags --version | grep -iq exuberant && \
41 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
42 $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
47 $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
48 $(FIND_TAG_FILES_CMD) > cscope.files
52 $(FIND_TAG_FILES_CMD) | xargs mkid
55 doxygen: doxygen-api doxygen-ref
57 doxygen-%: build/doxyfile.%
63 all-sources: $(MODULE_SYMVERS_DEPS)
64 for dir in $(SOURCES_SUBDIRS) ; do \
65 $(MAKE) sources -C $$dir || exit $$? ; \
76 $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \
77 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
78 -o scripts -o include/config/MARKER _sfdep_$(PWD) \
79 _FASTDEP_ALL_SUB_DIRS="$(PWD)"
84 modules: $(DEP) all-sources
85 $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \
86 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
87 LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include include/$(AUTOCONF_HDIR)/autoconf.h' \
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 \
107 build/Makefile build/autoMakefile.am.toplevel build/lbuild* \
109 build/update_oldconfig \
110 build/autoconf/lustre-build-linux.m4 \
111 build/autoconf/lustre-build-darwin.m4 \
112 build/autoconf/lustre-build-ldiskfs.m4 \
113 build/autoconf/lustre-build.m4 build/rdac_spec \
114 build/mptlinux.spec.patch build/patches \
115 build/funcs.sh build/find_linux_rpms build/exit_traps.sh
117 rpms-real: @PACKAGE_TARNAME@.spec dist Makefile
118 CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | \
119 sed -re 's/--(en|dis)able-tests//'); \
120 if [ -n "@LINUX@" ]; then \
121 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
122 sed -re 's/--with-linux=[^ ][^ ]*//'); \
123 RPMARGS="--define \"kdir @LINUX@\""; \
124 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
125 sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
126 if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
127 RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
130 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
131 sed -re 's/--with-release=[^ ][^ ]*//'); \
132 RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
133 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
134 RPMARGS="$$RPMARGS --define \"build_lustre_tests 0\""; \
136 if [[ "X$(BUILD_SERVER)" = Xfalse ]]; then \
137 RPMARGS="$$RPMARGS --define \"lustre_name lustre-client\""; \
139 echo "Building Lustre RPM with $$RPMARGS"; \
140 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
142 srpm-real: @PACKAGE_TARNAME@.spec dist Makefile
143 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
144 RPMARGS="--define \"build_lustre_tests 0\""; \
146 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
150 $(MAKE) $(AM_MAKEFLAGS) rpms-real
154 $(MAKE) $(AM_MAKEFLAGS) srpm-real
156 # In the debs target, first make sure what's in the changelog reflects
157 # the software version. Here's how we could dig the version out of the
158 # autoconf version file directly:
159 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
160 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
162 # However, one cannot really run "make debs" without having done a
163 # configure first, so we could use the easier method of digging the
164 # version out of the config.h file.
166 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
167 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
168 if [ "$$lversion" != "$$cversion" ]; then \
169 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; \
172 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
173 rc=$${PIPESTATUS[0]}; \
174 [ $${rc} -gt 1 ] && exit $${rc}; \
177 export KPKG_DEST_DIR="$$(pwd)/.." && \
178 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
179 rm -rf debian/tmp/modules-deb && \
180 mkdir debian/tmp/modules-deb && \
181 pushd debian/tmp/modules-deb && \
182 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
184 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
185 chmod 755 usr_src/modules/lustre/debian/rules && \
186 mkdir -p usr_share_modass && \
187 ln -s /usr/share/modass/include/ usr_share_modass/ && \
188 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
189 echo "lustre" > usr_share_modass/compliant.list && \
190 export MA_DIR=$$(pwd)/usr_share_modass && \
191 KVERS=$${KVERS:-$(LINUXRELEASE)}; \
192 m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
194 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
196 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/