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)
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 \
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 include/linux/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/linux/types.h.in
80 $(SUBSTITUTE) $(srcdir)/include/linux/types.h.in \
81 > include/linux/types.h
84 $(RM) -f \#* *~ core MAKELOG
85 clean-local: mostlyclean-local
86 distclean-local: clean-local
87 $(RM) -f include/linux/types.h $(SUBSTITUTE)
88 $(RM) -f config.status config.log config.cache MCONFIG Makefile
89 realclean-local: distclean-local
93 (cd tests; make check)
95 distribution_tar_file:
97 make DESTDIR=/tmp/dest install
99 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
100 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
101 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
102 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
104 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
105 -e 's/pre-//' -e 's/-PLUS//'`
107 $(srcdir)/.exclude-file:
109 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
110 -o -name CVS -o -name \*.rej -o -name Makefile.pq \) -print) \
111 | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
112 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
113 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
114 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
115 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
116 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
117 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
118 >> $(srcdir)/.exclude-file
120 source_tar_file: $(srcdir)/.exclude-file
121 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
122 $(TAR) -c -h -v -f - \
123 -X $$a/.exclude-file $$a | \
124 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
125 rm -f $(srcdir)/.exclude-file