Whamcloud - gitweb
LU-1199 build: Untangle the ldiskfs build system from lustre
[fs/lustre-release.git] / ldiskfs / build / autoMakefile.am.toplevel
1 # -*- Makefile -*-
2 # This file is included by each package's toplevel autoMakefile[.am],
3 # which must define SUBDIRS as a minimum.
4
5 AUTOMAKE_OPTIONS = foreign
6
7 FIND_TAG_FILES_CMD = find $(top_srcdir) \
8                      -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage \
9                      -prune -false -o -type f -name '*.[hc]'
10
11 # these empty rules are needed so that automake doesn't add its own
12 # recursive rules
13 etags-recursive:
14
15 ctags-recursive:
16
17 tags-recursive:
18
19 TAGS: etags
20
21 tags: ctags etags
22
23 etags:
24         $(RM) $(top_srcdir)/TAGS
25         ETAGSF=`etags --version | grep -iq exuberant && \
26                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
27         $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
28
29 ctags:
30         $(RM) $(top_srcdir)/tags
31         CTAGSF=`ctags --version | grep -iq exuberant && \
32                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
33         $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
34
35 cscope-recursive:
36
37 cscope:
38         $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
39         $(FIND_TAG_FILES_CMD) > cscope.files
40         cscope -bRq
41
42 mkid:
43         $(FIND_TAG_FILES_CMD) | xargs mkid
44
45
46 doxygen:  doxygen-api doxygen-ref
47
48 doxygen-%: build/doxyfile.%
49            doxygen $<
50
51 if MODULES
52 sources: all-sources
53
54 all-sources: $(MODULE_SYMVERS_DEPS)
55         for dir in $(SOURCES_SUBDIRS) ; do \
56                 $(MAKE) sources -C $$dir || exit $$? ; \
57         done
58
59 if LINUX
60 all-am: modules
61
62 modules: $(DEP) all-sources
63         $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ)                \
64         -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
65         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)' \
66         $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
67         include/config/MARKER $@
68 endif # LINUX
69
70 endif # MODULES
71
72 dist-hook:
73         find $(distdir) -name .deps -o \
74                         -name .git -o \
75                         -name .#* | xargs rm -rf
76         $(MAKE) $(AM_MAKEFLAGS) \
77           top_distdir="$(top_distdir)" distdir="$(distdir)" \
78           module-dist-hook
79
80 EXTRA_DIST = @PACKAGE_TARNAME@.spec                                     \
81         build/Makefile build/autoMakefile.am.toplevel                   \
82         build/Rules.in                                                  \
83         build/autoconf/ldiskfs-build-linux.m4                           \
84         build/autoconf/ldiskfs-build.m4                                 \
85         build/autoconf/ldiskfs.m4
86
87 rpms: @PACKAGE_TARNAME@.spec dist Makefile
88         CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | \
89                 sed -re 's/--(en|dis)able-tests//'); \
90         if [ -n "@LINUX@" ]; then \
91                 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
92                         sed -re 's/--with-linux=[^ ][^ ]*//'); \
93                 RPMARGS="--define \"kdir @LINUX@\""; \
94                 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
95                         sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
96                 if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
97                         RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
98                 fi; \
99         fi; \
100         CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | \
101                 sed -re 's/--with-release=[^ ][^ ]*//'); \
102         RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
103         echo "Building ldiskfs RPM with $$RPMARGS"; \
104         eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
105
106 srpm: @PACKAGE_TARNAME@.spec dist Makefile
107         eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz