2 top_srcdir = @top_srcdir@
12 @RESIZER_CMT@RESIZE_DIR= resize
13 @DEBUGFS_CMT@DEBUGFS_DIR= debugfs
15 LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs lib/blkid intl
16 PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
17 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
19 SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
29 @for i in $(SUBS) ; do if test -d `dirname $$i` ; then $(MAKE) $$i ; fi ; done
30 @(test -d lib/et && cd lib/et && $(MAKE) compile_et)
31 @(test -d lib/ext2fs && cd lib/ext2fs && $(MAKE) ext2_err.h)
33 progs: subs all-progs-recursive
34 libs: subs all-libs-recursive
36 e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
37 cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
43 -@test -d doc && cd doc && $(MAKE) libext2fs.info
46 -@test -d doc && cd doc && $(MAKE) install-doc-libs
49 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
52 -@test -d doc && cd doc && $(MAKE) clean
55 -test -d doc && cd doc && $(MAKE) distclean
57 install: subs all-libs-recursive install-progs-recursive \
58 install-shlibs-libs-recursive install-doc-libs
59 if test ! -d e2fsck && test ! -d debugfs && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi
61 install-strip: subs all-libs-recursive install-strip-progs-recursive \
62 install-shlibs-strip-libs-recursive install-doc-libs
64 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
66 install-libs: install-libs-recursive
68 uninstall-libs: uninstall-libs-recursive
70 TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
71 mostlyclean-recursive realclean-recursive:
72 @for subdir in $(SUBDIRS); do \
73 if test -d $$subdir ; then \
74 target=`echo $@|$(SED) 's/-recursive//'`; \
75 echo making $$target in $$subdir; \
76 (cd $$subdir && $(MAKE) $$target) || exit 1; \
80 all-progs-recursive install-progs-recursive install-strip-progs-recursive \
81 uninstall-progs-recursive: all-libs-recursive
82 @for subdir in $(PROG_SUBDIRS); do \
83 if test -d $$subdir ; then \
84 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
85 echo making $$target in $$subdir; \
86 (cd $$subdir && $(MAKE) $$target) || exit 1; \
90 all-libs-recursive install-libs-recursive install-strip-libs-recursive \
91 uninstall-libs-recursive install-shlibs-libs-recursive \
92 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
93 @for subdir in $(LIB_SUBDIRS); do \
94 if test -d $$subdir ; then \
95 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
96 echo making $$target in $$subdir; \
97 (cd $$subdir && $(MAKE) $$target) || exit 1; \
101 mostlyclean: mostlyclean-recursive mostlyclean-local
103 clean: clean-recursive clean-local clean-doc
106 distclean: distclean-doc distclean-recursive
107 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
108 $(MAKE) distclean-local
110 realclean: realclean-recursive realclean-local
112 depend:: depend-recursive
114 lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
115 $(srcdir)/lib/ext2fs/ext2_types.h.in
116 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
118 lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
119 $(srcdir)/lib/blkid/blkid_types.h.in
120 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
122 lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
123 $(srcdir)/lib/uuid/uuid_types.h.in
124 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
127 $(RM) -f \#* *~ *.orig core MAKELOG
129 clean-local: mostlyclean-local
131 distclean-local: clean-local
132 $(RM) -f $(SUBS) $(SUBST_CONF) \
133 config.status config.log config.cache MCONFIG Makefile \
134 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
136 realclean-local: distclean-local
139 check:: subs check-recursive