Whamcloud - gitweb
Add "*.orig" to "make clean" target, change explicit listing of
[tools/e2fsprogs.git] / Makefile.in
1 srcdir = @srcdir@
2 top_srcdir = @top_srcdir@
3 VPATH = @srcdir@
4 top_builddir = .
5 my_dir = .
6 INSTALL = @INSTALL@
7
8 @MCONFIG@
9
10 @RESIZER_CMT@RESIZE_DIR= resize
11 @DEBUGFS_CMT@DEBUGFS_DIR= debugfs
12
13 LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid # lib/finddev
14 PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs 
15 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
16
17 SUBS= lib/ext2fs/ext2_types.h
18
19 TAR=tar
20
21 all:: $(SUBS) 
22         $(MAKE) libs
23         $(MAKE) progs
24         $(MAKE) docs
25
26 progs: $(SUBS) all-progs-recursive
27 libs: $(SUBS) all-libs-recursive
28
29 docs:
30         cd doc && $(MAKE) libext2fs.info
31
32 install-doc-libs:
33         cd doc && $(MAKE) install-doc-libs
34
35 uninstall-doc-libs:
36         cd doc && $(MAKE) uninstall-doc-libs
37
38 clean-doc:
39         cd doc && $(MAKE) clean
40
41 distclean-doc:
42         cd doc && $(MAKE) distclean
43
44 install: $(SUBS) all-libs-recursive install-progs-recursive \
45         install-shlibs-libs-recursive install-doc-libs
46 #       export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
47
48 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
49
50 install-libs: install-libs-recursive
51
52 uninstall-libs: uninstall-libs-recursive
53
54 TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
55             mostlyclean-recursive realclean-recursive install-recursive:
56         for subdir in $(SUBDIRS); do \
57           if test -d $$subdir ; then \
58             target=`echo $@|$(SED) 's/-recursive//'`; \
59             echo making $$target in $$subdir; \
60             (cd $$subdir && $(MAKE) $$target) || exit 1; \
61           fi ; \
62         done
63
64 all-progs-recursive install-progs-recursive uninstall-progs-recursive:
65         for subdir in $(PROG_SUBDIRS); do \
66           if test -d $$subdir ; then \
67             target=`echo $@|$(SED) 's/-progs-recursive//'`; \
68             echo making $$target in $$subdir; \
69             (cd $$subdir && $(MAKE) $$target) || exit 1; \
70           fi ; \
71         done
72
73 all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
74         for subdir in $(LIB_SUBDIRS); do \
75           if test -d $$subdir ; then \
76             target=`echo $@|$(SED) 's/-libs-recursive//'`; \
77             echo making $$target in $$subdir; \
78             (cd $$subdir && $(MAKE) $$target) || exit 1; \
79           fi ; \
80         done
81
82 mostlyclean: mostlyclean-recursive mostlyclean-local
83
84 clean: clean-recursive clean-local clean-doc
85         $(RM) -f $(SUBS)
86
87 distclean: distclean-doc distclean-recursive distclean-local 
88
89 realclean: realclean-recursive realclean-local
90
91 depend:: depend-recursive
92
93 lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in
94         $(SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in \
95         > lib/ext2fs/ext2_types.h
96
97 mostlyclean-local:
98         $(RM) -f \#* *~ *.orig core MAKELOG 
99
100 clean-local: mostlyclean-local
101
102 distclean-local: clean-local
103         $(RM) -f $(SUBS) $(SUBST_CONF) \
104                 config.status config.log config.cache MCONFIG Makefile \
105                 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
106
107 realclean-local: distclean-local
108         $(RM) -f configure
109
110 check:: $(SUBS) check-recursive
111
112 distribution_tar_file:
113         $(RM) -rf /tmp/dest
114         $(MAKE) DESTDIR=/tmp/dest install
115         cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
116         $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
117         cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
118         (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
119                 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
120
121 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
122                         -e 's/pre-//' -e 's/-PLUS//'`
123
124 $(srcdir)/.exclude-file:
125         a=$(SRCROOT); \
126         (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
127                 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
128                 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
129                 -o -name changed-files -o -name .#\* \) \
130                 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
131         echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file
132         echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
133         echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
134         echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
135         echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
136         echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
137         echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
138         echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
139         echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
140                 >> $(srcdir)/.exclude-file
141
142 source_tar_file: $(srcdir)/.exclude-file
143         cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
144                 $(TAR) -c -h -v -f - \
145                         -X $$a/.exclude-file $$a | \
146                 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
147         rm -f $(srcdir)/.exclude-file