Whamcloud - gitweb
add mgc mgs to Makefile
[fs/lustre-release.git] / lustre / autoMakefile.am
1 # Copyright (C) 2001  Cluster File Systems, Inc.
2 #
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
5
6 AUTOMAKE_OPTIONS = foreign
7
8 ALWAYS_SUBDIRS := include lvfs obdclass ldlm ptlrpc osc lov obdecho \
9         doc utils tests conf scripts autoconf
10
11 SERVER_SUBDIRS := ldiskfs obdfilter ost mds mgc mgs
12
13 CLIENT_SUBDIRS := mgc mdc llite
14
15 LIBLUSTRE_SUBDIRS := liblustre
16
17 SUBDIRS := $(ALWAYS_SUBDIRS)
18
19 if SERVER
20 SUBDIRS += $(SERVER_SUBDIRS)
21 endif
22
23 if CLIENT
24 SUBDIRS += $(CLIENT_SUBDIRS)
25 endif
26
27 # this needs to be after the client subdirs
28 if LIBLUSTRE
29 if !CLIENT
30 SUBDIRS += $(CLIENT_SUBDIRS)
31 endif
32 SUBDIRS += $(LIBLUSTRE_SUBDIRS)
33 endif
34
35 DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS) $(LIBLUSTRE_SUBDIRS)
36
37 EXTRA_DIST = BUGS FDL kernel_patches
38
39 if LDISKFS
40 LDISKFS = ldiskfs-sources
41 ldiskfs-sources:
42         $(MAKE) sources -C ldiskfs
43 endif
44
45 lvfs-sources:
46         $(MAKE) sources -C lvfs
47
48 sources: $(LDISKFS) lvfs-sources lustre_build_version
49
50 all-recursive: lustre_build_version
51
52 lustre_build_version:
53         perl $(top_builddir)/lustre/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver
54         echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver
55         cmp -s $(top_builddir)/lustre/include/linux/lustre_build_version.h tmpver \
56                 2> /dev/null &&                                            \
57                 $(RM) tmpver ||                                            \
58                 mv tmpver $(top_builddir)/lustre/include/linux/lustre_build_version.h
59
60 CSTK=/tmp/checkstack
61 CSTKO=/tmp/checkstack.orig
62
63 checkstack:
64         [ -f ${CSTK} -a ! -s ${CSTKO} ] && mv ${CSTK} ${CSTKO} || true
65         for i in ${SUBDIRS} portals/knals/*; do                              \
66                 MOD=$$i/`basename $$i`.o;                                    \
67                 [ -f $$MOD ] && objdump -d $$MOD | perl tests/checkstack.pl; \
68         done | sort -nr > ${CSTK}
69         [ -f ${CSTKO} ] && ! diff -u ${CSTKO} ${CSTK} || head -30 ${CSTK}
70
71 checkstack-update:
72         [ -f ${CSTK} ] && mv ${CSTK} ${CSTKO}
73
74 checkstack-clean:
75         rm -f ${CSTK} ${CSTKO}