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/linux/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)
29 install: all-libs-recursive install-progs-recursive \
30 install-shlibs-libs-recursive install-doc-libs
31 (export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages)
33 install-libs: install-libs-recursive
35 TAGS clean-recursive distclean-recursive \
36 mostlyclean-recursive realclean-recursive install-recursive:
37 for subdir in $(SUBDIRS); do \
38 if test -d $$subdir ; then \
39 target=`echo $@|$(SED) 's/-recursive//'`; \
40 echo making $$target in $$subdir; \
41 (cd $$subdir && $(MAKE) $$target) || exit 1; \
45 all-progs-recursive install-progs-recursive:
46 for subdir in $(PROG_SUBDIRS); do \
47 if test -d $$subdir ; then \
48 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
49 echo making $$target in $$subdir; \
50 (cd $$subdir && $(MAKE) $$target) || exit 1; \
54 all-libs-recursive install-libs-recursive install-shlibs-libs-recursive:
55 for subdir in $(LIB_SUBDIRS); do \
56 if test -d $$subdir ; then \
57 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
58 echo making $$target in $$subdir; \
59 (cd $$subdir && $(MAKE) $$target) || exit 1; \
63 mostlyclean: mostlyclean-recursive mostlyclean-local
65 clean: clean-recursive clean-local
68 distclean: distclean-recursive distclean-local
70 realclean: realclean-recursive realclean-local
72 include/linux/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/linux/types.h.in
73 $(SUBSTITUTE) $(srcdir)/include/linux/types.h.in \
74 > include/linux/types.h
77 $(RM) -f \#* *~ core MAKELOG
78 clean-local: mostlyclean-local
79 distclean-local: clean-local
80 $(RM) -f include/linux/types.h $(SUBSTITUTE)
81 $(RM) -f config.status config.log config.cache MCONFIG Makefile
82 realclean-local: distclean-local
86 (cd tests; make check)
88 distribution_tar_file:
90 make DESTDIR=/tmp/dest install
92 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
93 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
94 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
95 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
97 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
98 -e 's/pre-//' -e 's/-PLUS//'`
100 $(srcdir)/.exclude-file:
102 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
103 -o -name CVS -o -name \*.rej \) -print) \
104 | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
105 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
106 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
107 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
108 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
109 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
110 >> $(srcdir)/.exclude-file
112 source_tar_file: $(srcdir)/.exclude-file
113 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
114 $(TAR) -c -h -v -f - \
115 -X $$a/.exclude-file $$a | \
116 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
117 rm -f $(srcdir)/.exclude-file