Whamcloud - gitweb
LU-1199 build: Untangle the ldiskfs build system from lustre
[fs/lustre-release.git] / ldiskfs / build / autoMakefile.am.toplevel
diff --git a/ldiskfs/build/autoMakefile.am.toplevel b/ldiskfs/build/autoMakefile.am.toplevel
new file mode 100644 (file)
index 0000000..daff703
--- /dev/null
@@ -0,0 +1,107 @@
+# -*- Makefile -*-
+# This file is included by each package's toplevel autoMakefile[.am],
+# which must define SUBDIRS as a minimum.
+
+AUTOMAKE_OPTIONS = foreign
+
+FIND_TAG_FILES_CMD = find $(top_srcdir) \
+                    -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage \
+                    -prune -false -o -type f -name '*.[hc]'
+
+# these empty rules are needed so that automake doesn't add its own
+# recursive rules
+etags-recursive:
+
+ctags-recursive:
+
+tags-recursive:
+
+TAGS: etags
+
+tags: ctags etags
+
+etags:
+       $(RM) $(top_srcdir)/TAGS
+       ETAGSF=`etags --version | grep -iq exuberant && \
+               echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
+       $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
+
+ctags:
+       $(RM) $(top_srcdir)/tags
+       CTAGSF=`ctags --version | grep -iq exuberant && \
+               echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
+       $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
+
+cscope-recursive:
+
+cscope:
+       $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
+       $(FIND_TAG_FILES_CMD) > cscope.files
+       cscope -bRq
+
+mkid:
+       $(FIND_TAG_FILES_CMD) | xargs mkid
+
+
+doxygen:  doxygen-api doxygen-ref
+
+doxygen-%: build/doxyfile.%
+          doxygen $<
+
+if MODULES
+sources: all-sources
+
+all-sources: $(MODULE_SYMVERS_DEPS)
+       for dir in $(SOURCES_SUBDIRS) ; do \
+               $(MAKE) sources -C $$dir || exit $$? ; \
+       done
+
+if LINUX
+all-am: modules
+
+modules: $(DEP) all-sources
+       $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ)                \
+       -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
+        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)' \
+       $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
+       include/config/MARKER $@
+endif # LINUX
+
+endif # MODULES
+
+dist-hook:
+       find $(distdir) -name .deps -o \
+                       -name .git -o \
+                       -name .#* | xargs rm -rf
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         module-dist-hook
+
+EXTRA_DIST = @PACKAGE_TARNAME@.spec                                    \
+       build/Makefile build/autoMakefile.am.toplevel                   \
+       build/Rules.in                                                  \
+       build/autoconf/ldiskfs-build-linux.m4                           \
+       build/autoconf/ldiskfs-build.m4                                 \
+       build/autoconf/ldiskfs.m4
+
+rpms: @PACKAGE_TARNAME@.spec dist Makefile
+       CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | \
+               sed -re 's/--(en|dis)able-tests//'); \
+       if [ -n "@LINUX@" ]; then \
+               CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
+                       sed -re 's/--with-linux=[^ ][^ ]*//'); \
+               RPMARGS="--define \"kdir @LINUX@\""; \
+               CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
+                       sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
+               if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
+                       RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
+               fi; \
+       fi; \
+       CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
+               sed -re 's/--with-release=[^ ][^ ]*//'); \
+       RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
+       echo "Building ldiskfs RPM with $$RPMARGS"; \
+       eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
+
+srpm: @PACKAGE_TARNAME@.spec dist Makefile
+       eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz