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 \
9 -prune -false -o -type f -name '*.[hc]'
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 $$? ; \
71 modules: $(DEP) all-sources
72 $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \
73 -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
74 LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -I$$(srctree)/arch/$$(SRCARCH)/include/generated -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include $(CONFIG_INCLUDE)' \
75 $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
76 include/config/MARKER $@
82 $(RM) $(distdir)/ldiskfs/*.spec
83 $(RM) $(distdir)/lustre-iokit/*.spec
84 find $(distdir) -name .deps -o \
88 -name .#* | xargs rm -rf
89 $(MAKE) $(AM_MAKEFLAGS) \
90 top_distdir="$(top_distdir)" distdir="$(distdir)" \
93 EXTRA_DIST = @PACKAGE_TARNAME@.spec \
94 build/Makefile build/autoMakefile.am.toplevel build/lbuild* \
96 build/update_oldconfig \
97 build/autoconf/lustre-build-linux.m4 \
98 build/autoconf/lustre-build-darwin.m4 \
99 build/autoconf/lustre-build-ldiskfs.m4 \
100 build/autoconf/lustre-build.m4 build/rdac_spec \
101 build/mptlinux.spec.patch build/patches \
102 build/funcs.sh build/find_linux_rpms build/exit_traps.sh
104 rpms-real: @PACKAGE_TARNAME@.spec dist Makefile
105 CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | \
106 sed -re 's/--(en|dis)able-tests//'); \
107 if [ -n "@LINUX@" ]; then \
108 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
109 sed -re 's/--with-linux=[^ ][^ ]*//'); \
110 RPMARGS="--define \"kdir @LINUX@\""; \
111 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
112 sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
113 if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
114 RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
117 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
118 sed -re 's/--with-release=[^ ][^ ]*//'); \
119 RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
120 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
121 RPMARGS="$$RPMARGS --define \"build_lustre_tests 0\""; \
123 if [[ "X$(BUILD_SERVER)" = Xfalse ]]; then \
124 RPMARGS="$$RPMARGS --define \"lustre_name lustre-client\""; \
126 echo "Building Lustre RPM with $$RPMARGS"; \
127 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
129 srpm-real: @PACKAGE_TARNAME@.spec dist Makefile
130 if [[ "X$(BUILD_TESTS)" = Xfalse ]]; then \
131 RPMARGS="--define \"build_lustre_tests 0\""; \
133 eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
137 $(MAKE) $(AM_MAKEFLAGS) rpms-real
141 $(MAKE) $(AM_MAKEFLAGS) srpm-real
143 # In the debs target, first make sure what's in the changelog reflects
144 # the software version. Here's how we could dig the version out of the
145 # autoconf version file directly:
146 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
147 # lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
149 # However, one cannot really run "make debs" without having done a
150 # configure first, so we could use the easier method of digging the
151 # version out of the config.h file.
153 lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
154 cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
155 if [ "$$lversion" != "$$cversion" ]; then \
156 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; \
159 dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
160 rc=$${PIPESTATUS[0]}; \
161 [ $${rc} -gt 1 ] && exit $${rc}; \
164 export KPKG_DEST_DIR="$$(pwd)/.." && \
165 version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
166 rm -rf debian/tmp/modules-deb && \
167 mkdir debian/tmp/modules-deb && \
168 pushd debian/tmp/modules-deb && \
169 dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
171 tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
172 chmod 755 usr_src/modules/lustre/debian/rules && \
173 mkdir -p usr_share_modass && \
174 ln -s /usr/share/modass/include/ usr_share_modass/ && \
175 ln -s /usr/share/modass/packages/ usr_share_modass/ && \
176 echo "lustre" > usr_share_modass/compliant.list && \
177 export MA_DIR=$$(pwd)/usr_share_modass && \
178 KVERS=$${KVERS:-$(LINUXRELEASE)}; \
179 m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
181 VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
183 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/