2 top_srcdir = @top_srcdir@
10 @RESIZER_CMT@RESIZE_DIR= resize
11 @DEBUGFS_CMT@DEBUGFS_DIR= debugfs
12 @LINUX_CMT@EVMS_DIR= lib/evms
14 LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid # lib/finddev
15 PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs $(EVMS_DIR)
16 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
18 SUBS= lib/ext2fs/ext2_types.h
27 progs: $(SUBS) all-progs-recursive
28 libs: $(SUBS) all-libs-recursive
31 cd doc && $(MAKE) libext2fs.info
34 cd doc && $(MAKE) install-doc-libs
37 cd doc && $(MAKE) uninstall-doc-libs
40 cd doc && $(MAKE) clean
43 cd doc && $(MAKE) distclean
45 install: $(SUBS) all-libs-recursive install-progs-recursive \
46 install-shlibs-libs-recursive install-doc-libs
47 # export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
49 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
51 install-libs: install-libs-recursive
53 uninstall-libs: uninstall-libs-recursive
55 TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
56 mostlyclean-recursive realclean-recursive install-recursive:
57 for subdir in $(SUBDIRS); do \
58 if test -d $$subdir ; then \
59 target=`echo $@|$(SED) 's/-recursive//'`; \
60 echo making $$target in $$subdir; \
61 (cd $$subdir && $(MAKE) $$target) || exit 1; \
65 all-progs-recursive install-progs-recursive uninstall-progs-recursive:
66 for subdir in $(PROG_SUBDIRS); do \
67 if test -d $$subdir ; then \
68 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
69 echo making $$target in $$subdir; \
70 (cd $$subdir && $(MAKE) $$target) || exit 1; \
74 all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
75 for subdir in $(LIB_SUBDIRS); do \
76 if test -d $$subdir ; then \
77 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
78 echo making $$target in $$subdir; \
79 (cd $$subdir && $(MAKE) $$target) || exit 1; \
83 mostlyclean: mostlyclean-recursive mostlyclean-local
85 clean: clean-recursive clean-local clean-doc
88 distclean: distclean-doc distclean-recursive distclean-local
90 realclean: realclean-recursive realclean-local
92 depend:: depend-recursive
94 lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in
95 $(SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in \
96 > lib/ext2fs/ext2_types.h
99 $(RM) -f \#* *~ *.orig core MAKELOG
101 clean-local: mostlyclean-local
103 distclean-local: clean-local
104 $(RM) -f $(SUBS) $(SUBST_CONF) \
105 config.status config.log config.cache MCONFIG Makefile \
106 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
108 realclean-local: distclean-local
111 check:: $(SUBS) check-recursive
113 distribution_tar_file:
115 $(MAKE) DESTDIR=/tmp/dest install
116 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
117 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
118 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
119 (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
120 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
122 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
123 -e 's/pre-//' -e 's/-PLUS//'`
125 $(srcdir)/.exclude-file:
127 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
128 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
129 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
130 -o -name changed-files -o -name .#\* \) \
131 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
132 echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file
133 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
134 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
135 echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
136 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
137 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
138 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
139 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
140 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
141 >> $(srcdir)/.exclude-file
143 source_tar_file: $(srcdir)/.exclude-file
144 cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
145 $(TAR) -c -h -v -f - \
146 -X $$a/.exclude-file $$a | \
147 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
148 rm -f $(srcdir)/.exclude-file