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=$(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)
32 install: all-libs-recursive install-progs-recursive \
33 install-shlibs-libs-recursive install-doc-libs
34 # (export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages)
36 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
38 install-libs: install-libs-recursive
40 uninstall-libs: uninstall-libs-recursive
42 TAGS clean-recursive distclean-recursive depend-recursive \
43 mostlyclean-recursive realclean-recursive install-recursive:
44 for subdir in $(SUBDIRS); do \
45 if test -d $$subdir ; then \
46 target=`echo $@|$(SED) 's/-recursive//'`; \
47 echo making $$target in $$subdir; \
48 (cd $$subdir && $(MAKE) $$target) || exit 1; \
52 all-progs-recursive install-progs-recursive uninstall-progs-recursive:
53 for subdir in $(PROG_SUBDIRS); do \
54 if test -d $$subdir ; then \
55 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
56 echo making $$target in $$subdir; \
57 (cd $$subdir && $(MAKE) $$target) || exit 1; \
61 all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
62 for subdir in $(LIB_SUBDIRS); do \
63 if test -d $$subdir ; then \
64 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
65 echo making $$target in $$subdir; \
66 (cd $$subdir && $(MAKE) $$target) || exit 1; \
70 mostlyclean: mostlyclean-recursive mostlyclean-local
72 clean: clean-recursive clean-local
75 distclean: distclean-recursive distclean-local
77 realclean: realclean-recursive realclean-local
79 depend:: depend-recursive
81 include/asm/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/asm/types.h.in
82 $(SUBSTITUTE) $(srcdir)/include/asm/types.h.in \
86 $(RM) -f \#* *~ core MAKELOG
87 clean-local: mostlyclean-local
88 distclean-local: clean-local
89 $(RM) -f include/asm/types.h $(SUBSTITUTE)
90 $(RM) -f config.status config.log config.cache MCONFIG Makefile
91 realclean-local: distclean-local
95 (cd tests; make check)
97 distribution_tar_file:
99 make DESTDIR=/tmp/dest install
101 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
102 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
103 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
104 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
105 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
107 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
108 -e 's/pre-//' -e 's/-PLUS//'`
110 $(srcdir)/.exclude-file:
112 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
113 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
114 -o -name TODO -o -name changed-files -o -name .#\* \) \
115 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
116 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
117 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
118 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
119 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
120 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
121 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
122 >> $(srcdir)/.exclude-file
124 source_tar_file: $(srcdir)/.exclude-file
125 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
126 $(TAR) -c -h -v -f - \
127 -X $$a/.exclude-file $$a | \
128 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
129 rm -f $(srcdir)/.exclude-file