Whamcloud - gitweb
LU-1221 ldiskfs: Replace sysname with nodename in MMP
[fs/lustre-release.git] / build / autoMakefile.am.toplevel
1 # This file is included by each package's toplevel autoMakefile[.am],
2 # which must define SUBDIRS as a minimum.
3
4 AUTOMAKE_OPTIONS = foreign
5
6 FIND_TAG_FILES_CMD = find $(top_srcdir) \
7                      -path $(top_srcdir)/ldiskfs/ldiskfs/linux-stage -prune -false -o\
8                      -type f -name '*.[hc]'
9
10 # these empty rules are needed so that automake doesn't add its own
11 # recursive rules
12 etags-recursive:
13
14 ctags-recursive:
15
16 tags-recursive:
17
18 TAGS: etags
19
20 tags: ctags etags
21
22 etags:
23         $(RM) $(top_srcdir)/TAGS
24         ETAGSF=`etags --version | grep -iq exuberant && \
25                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
26         $(FIND_TAG_FILES_CMD) | xargs etags $$ETAGSF -a
27
28 ctags:
29         $(RM) $(top_srcdir)/tags
30         CTAGSF=`ctags --version | grep -iq exuberant && \
31                 echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \
32         $(FIND_TAG_FILES_CMD) | xargs ctags $$CTAGSF -a
33
34 cscope-recursive:
35
36 cscope:
37         $(RM) $(top_srcdir)/cscope*.out $(top_srcdir)/cscope.files
38         $(FIND_TAG_FILES_CMD) > cscope.files
39         cscope -bRq
40
41 mkid:
42         $(FIND_TAG_FILES_CMD) | xargs mkid
43
44
45 doxygen:  doxygen-api doxygen-ref
46
47 doxygen-%: build/doxyfile.%
48            doxygen $<
49
50 if MODULES
51 sources: all-sources
52
53 all-sources: $(EXTRA_SOURCES)
54         for dir in $(SOURCES_SUBDIRS) ; do \
55                 $(MAKE) sources -C $$dir || exit $$? ; \
56         done
57
58 if LINUX
59 all-am: modules
60
61 if !LINUX25
62 DEP = dep
63 dep: .depend
64
65 .depend: all-sources
66         $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ)                \
67         -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
68         -o scripts -o include/config/MARKER _sfdep_$(PWD)            \
69         _FASTDEP_ALL_SUB_DIRS="$(PWD)"
70
71 CLEANFILES = .depend
72 endif # !LINUX25
73
74 modules: $(DEP) all-sources
75         $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ)                \
76         -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \
77         LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include include/linux/autoconf.h' \
78         $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \
79         include/config/MARKER $@
80 endif # LINUX
81
82 endif # MODULES
83
84 dist-hook:
85         $(RM) $(distdir)/ldiskfs/*.spec
86         $(RM) $(distdir)/lustre-iokit/*.spec
87         find $(distdir) -name .deps -o \
88                         -name CVS -o \
89                         -name .svn -o \
90                         -name .git -o \
91                         -name .#* | xargs rm -rf
92         $(MAKE) $(AM_MAKEFLAGS) \
93           top_distdir="$(top_distdir)" distdir="$(distdir)" \
94           module-dist-hook
95
96 EXTRA_DIST = @PACKAGE_TARNAME@.spec                                     \
97         build/Makefile build/autoMakefile.am.toplevel build/lbuild*     \
98         build/linux-merge-config.awk build/linux-merge-modules.awk      \
99         build/linux-rhconfig.h build/lmake build/Rules.in               \
100         build/lustre-kernel-2.4.spec.in build/suse-functions.sh         \
101         build/suse-post.sh build/suse-postun.sh                         \
102         build/suse-trigger-script.sh.in build/README.kernel-source      \
103         build/sles8-post.sh build/sles8-postun.sh build/sles8-pre.sh    \
104         build/sles8-update_INITRD_MODULES.sh                            \
105         build/sles8-update_rcfile_setting.sh build/update_oldconfig     \
106         build/autoconf/lustre-build-linux.m4                            \
107         build/autoconf/lustre-build-darwin.m4                           \
108         build/autoconf/lustre-build.m4 build/rdac_spec                  \
109         build/mptlinux.spec.patch build/patches                         \
110         build/funcs.sh build/find_linux_rpms build/exit_traps.sh        \
111         build/extract_patches build/checkpatch.pl build/commit-msg      \
112         build/prepare-commit-msg build/commit.* build/test-commit-msg.sh
113
114 rpms-real: @PACKAGE_TARNAME@.spec dist Makefile
115         CONFIGURE_ARGS=$$(echo $$(eval echo $(ac_configure_args)) | sed -re 's/--(en|dis)able-tests//'); \
116         if [ -n "@LINUX@" ]; then \
117                 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | sed -re 's/--with-linux=[^ ][^ ]*//'); \
118                 RPMARGS="--define \"kdir @LINUX@\""; \
119                 CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | sed -re 's/--with-linux-obj=[^ ][^ ]*//'); \
120                 if [ -n "@LINUX_OBJ@" -a "@LINUX_OBJ@" != "@LINUX@" ]; then \
121                         RPMARGS="$$RPMARGS --define \"kobjdir @LINUX_OBJ@\""; \
122                 fi; \
123         fi; \
124         CONFIGURE_ARGS=$$(echo $$(eval echo $$CONFIGURE_ARGS) | sed -re 's/--with-release=[^ ][^ ]*//'); \
125         RPMARGS="$$RPMARGS --define \"configure_args $$CONFIGURE_ARGS\""; \
126         if ! $(BUILD_TESTS); then \
127                 RPMARGS="$$RPMARGS --define \"build_lustre_tests 0\""; \
128         fi; \
129         if ! $(BUILD_SERVER); then \
130                 RPMARGS="$$RPMARGS --define \"lustre_name lustre-client\""; \
131         fi; \
132         echo "Building Lustre RPM with $$RPMARGS"; \
133         eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
134
135 srpm-real: @PACKAGE_TARNAME@.spec dist Makefile
136         if ! $(BUILD_TESTS); then \
137                 RPMARGS="--define \"build_lustre_tests 0\""; \
138         fi; \
139         eval rpmbuild $$RPMARGS -ta $(distdir).tar.gz
140
141 rpms:
142         for subdir in $(RPM_SUBDIRS) ; do                               \
143                 echo "Making rpms in $$subdir";                         \
144                 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) rpms);          \
145                 echo "Finished rpms in $$subdir";                       \
146         done;                                                           \
147         $(MAKE) $(AM_MAKEFLAGS) rpms-real
148
149 srpm:
150         for subdir in $(RPM_SUBDIRS) ; do                               \
151                 echo "Making srpm in $$subdir";                         \
152                 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) srpm);          \
153                 echo "Finished srpms in $$subdir";                      \
154         done;                                                           \
155         $(MAKE) $(AM_MAKEFLAGS) srpm-real
156
157 # In the debs target, first make sure what's in the changelog reflects
158 # the software version.  Here's how we could dig the version out of the
159 # autoconf version file directly:
160 # lversion=$$(sed -ne 's/m4_define(\[LUSTRE_[A-Z][A-Z]*\],\[\([0-9][0-9]*\)\])$$/\1/p'
161 #       lustre/autoconf/lustre-version.ac | tr '\n' '.' | sed -e 's/.$//');
162 #
163 # However, one cannot really run "make debs" without having done a
164 # configure first, so we could use the easier method of digging the
165 # version out of the config.h file.
166 debs:
167         lversion=$$(sed -ne 's/^#define VERSION "\(.*\)"$$/\1/p' config.h); \
168         cversion=$$(sed -ne '1s/^lustre (\(.*\)-[0-9][0-9]*).*$$/\1/p' debian/changelog); \
169         if [ "$$lversion" != "$$cversion" ]; then \
170                 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; \
171         fi; \
172         if [ -d .git ]; then \
173                 build/extract_patches .; \
174         fi
175         cat debian/patches/* | sed -ne '/^diff --git/h' -e '/^deleted file/{G;s/^.* b\/\(.*\)/\1/p;}' | xargs rm -f; \
176         rm -rf debs
177         dpkg-buildpackage -I.git -I\*.out[0-9]\* -I\*.swp || { \
178                 rc=$${PIPESTATUS[0]}; \
179                 [ $${rc} -gt 1 ] && exit $${rc}; \
180                 exit 0; \
181         }
182         export KPKG_DEST_DIR="$$(pwd)/.." && \
183         version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \
184         rm -rf debian/tmp/modules-deb && \
185         mkdir debian/tmp/modules-deb && \
186         pushd debian/tmp/modules-deb && \
187         dpkg -x ../../../../lustre-source_$${version}_all.deb $$(pwd) && \
188         mkdir usr_src/ && \
189         tar -C usr_src/ -xjf usr/src/lustre.tar.bz2 && \
190         chmod 755 usr_src/modules/lustre/debian/rules && \
191         mkdir -p usr_share_modass && \
192         ln -s /usr/share/modass/include/ usr_share_modass/ && \
193         ln -s /usr/share/modass/packages/ usr_share_modass/ && \
194         echo "lustre" > usr_share_modass/compliant.list && \
195         export MA_DIR=$$(pwd)/usr_share_modass && \
196         KVERS=$${KVERS:-$(LINUXRELEASE)}; \
197         m-a build $${KVERS:+-l $$KVERS} -i -u $$(pwd) lustre && \
198         popd && \
199         VER=$$(sed -ne '1s/^lustre (\(.*-[0-9][0-9]*\)).*$$/\1/p' debian/changelog); \
200         mkdir -p debs && \
201         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/