2 top_srcdir = @top_srcdir@
10 LIB_SUBDIRS=lib/et lib/ss lib/ext2fs lib/e2p lib/uuid
11 PROG_SUBDIRS=e2fsck debugfs misc resize tests/progs
12 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
14 SUBS= include/asm/types.h
18 all:: $(SUBS) libs progs docs
20 progs: $(SUBS) all-progs-recursive
21 libs: $(SUBS) all-libs-recursive
24 (cd doc && make libext2fs.info)
27 (cd doc && make install-doc-libs)
30 (cd doc && make uninstall-doc-libs)
33 (cd doc && make clean)
36 (cd doc && make distclean)
38 install: all-libs-recursive install-progs-recursive \
39 install-shlibs-libs-recursive install-doc-libs
40 # (export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages)
42 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
44 install-libs: install-libs-recursive
46 uninstall-libs: uninstall-libs-recursive
48 TAGS clean-recursive distclean-recursive depend-recursive \
49 mostlyclean-recursive realclean-recursive install-recursive:
50 for subdir in $(SUBDIRS); do \
51 if test -d $$subdir ; then \
52 target=`echo $@|$(SED) 's/-recursive//'`; \
53 echo making $$target in $$subdir; \
54 (cd $$subdir && $(MAKE) $$target) || exit 1; \
58 all-progs-recursive install-progs-recursive uninstall-progs-recursive:
59 for subdir in $(PROG_SUBDIRS); do \
60 if test -d $$subdir ; then \
61 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
62 echo making $$target in $$subdir; \
63 (cd $$subdir && $(MAKE) $$target) || exit 1; \
67 all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
68 for subdir in $(LIB_SUBDIRS); do \
69 if test -d $$subdir ; then \
70 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
71 echo making $$target in $$subdir; \
72 (cd $$subdir && $(MAKE) $$target) || exit 1; \
76 mostlyclean: mostlyclean-recursive mostlyclean-local
78 clean: clean-recursive clean-local clean-doc
81 distclean: distclean-doc distclean-recursive distclean-local
83 realclean: realclean-recursive realclean-local
85 depend:: depend-recursive
87 include/asm/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/asm/types.h.in
88 $(SUBSTITUTE) $(srcdir)/include/asm/types.h.in \
92 $(RM) -f \#* *~ core MAKELOG
94 clean-local: mostlyclean-local
96 distclean-local: clean-local
97 $(RM) -f include/asm/types.h $(SUBST_CONF) \
98 config.status config.log config.cache MCONFIG Makefile \
99 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
101 realclean-local: distclean-local
105 (cd tests; make check)
107 distribution_tar_file:
109 make DESTDIR=/tmp/dest install
111 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
112 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
113 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
114 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
115 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
117 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
118 -e 's/pre-//' -e 's/-PLUS//'`
120 $(srcdir)/.exclude-file:
122 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
123 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
124 -o -name TAGS -o -name \*.old -o -name \*.gmo \
125 -o -name TODO -o -name changed-files -o -name .#\* \) \
126 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
127 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
128 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
129 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
130 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
131 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
132 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
133 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
134 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
135 >> $(srcdir)/.exclude-file
137 source_tar_file: $(srcdir)/.exclude-file
138 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
139 $(TAR) -c -h -v -f - \
140 -X $$a/.exclude-file $$a | \
141 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
142 rm -f $(srcdir)/.exclude-file