2 top_srcdir = @top_srcdir@
12 @RESIZER_CMT@RESIZE_DIR= resize
13 @DEBUGFS_CMT@DEBUGFS_DIR= debugfs
14 @UUID_CMT@UUID_LIB_SUBDIR= lib/uuid
15 @BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
16 @QUOTA_CMT@QUOTA_LIB_SUBDIR= lib/quota
17 @E2SCAN_CMT@E2SCAN_DIR= e2scan
19 LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) intl
20 PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) $(E2SCAN_DIR) tests/progs po
21 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
23 SUBS= util/subst.conf lib/config.h lib/dirpaths.h \
24 lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
33 subs: $(DEP_SUBSTITUTE)
34 @for i in $(SUBS) ; do if test -d `dirname $$i` ; \
35 then $(MAKE) $$i || exit $$? ; fi ; done
36 @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
37 @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
39 progs: all-progs-recursive
40 libs: all-libs-recursive
41 all-progs-recursive all-libs-recursive: subs
43 e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
44 cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
46 e2fsprogs-RHEL-6.spec: $(DEP_SUBSTITUTE) e2fsprogs-RHEL-6.spec.in
47 cd $(top_builddir); CONFIG_FILES=./e2fsprogs-RHEL-6.spec ./config.status
49 e2fsprogs-SUSE_LINUX-11.spec: $(DEP_SUBSTITUTE) e2fsprogs-SUSE_LINUX-11.spec.in
50 cd $(top_builddir); CONFIG_FILES=./e2fsprogs-SUSE_LINUX-11.spec ./config.status
52 rpm: e2fsprogs.spec e2fsprogs-RHEL-6.spec e2fsprogs-SUSE_LINUX-11.spec
56 -@test -d doc && cd doc && $(MAKE) libext2fs.info
59 -@test -d doc && cd doc && $(MAKE) install-doc-libs
62 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
65 -@test -d doc && cd doc && $(MAKE) clean
68 -test -d doc && cd doc && $(MAKE) distclean
70 install: subs all-libs-recursive install-progs-recursive \
71 install-shlibs-libs-recursive install-doc-libs
72 if test ! -d e2fsck && test ! -d debugfs && test ! -d e2scan && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi
74 install-strip: subs all-libs-recursive install-strip-progs-recursive \
75 install-shlibs-strip-libs-recursive install-doc-libs
77 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
79 install-libs: install-libs-recursive
81 uninstall-libs: uninstall-libs-recursive
85 TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
86 mostlyclean-recursive realclean-recursive:
87 @for subdir in $(SUBDIRS); do \
88 if test -d $$subdir ; then \
89 target=`echo $@|$(SED) 's/-recursive//'`; \
90 echo making $$target in $$subdir; \
91 (cd $$subdir && $(MAKE) $$target) || exit 1; \
95 all-progs-recursive install-progs-recursive install-strip-progs-recursive \
96 uninstall-progs-recursive: all-libs-recursive
97 @for subdir in $(PROG_SUBDIRS); do \
98 if test -d $$subdir ; then \
99 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
100 echo making $$target in $$subdir; \
101 (cd $$subdir && $(MAKE) $$target) || exit 1; \
105 all-libs-recursive install-libs-recursive install-strip-libs-recursive \
106 uninstall-libs-recursive install-shlibs-libs-recursive \
107 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
108 @for subdir in $(LIB_SUBDIRS); do \
109 if test -d $$subdir ; then \
110 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
111 echo making $$target in $$subdir; \
112 (cd $$subdir && $(MAKE) $$target) || exit 1; \
116 mostlyclean: mostlyclean-recursive mostlyclean-local
118 clean: clean-recursive clean-local clean-doc
121 distclean: distclean-doc distclean-recursive
122 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
123 $(MAKE) distclean-local
125 realclean: realclean-recursive realclean-local
127 depend:: depend-recursive
129 lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
130 $(srcdir)/lib/ext2fs/ext2_types.h.in
131 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
133 lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
134 $(srcdir)/lib/blkid/blkid_types.h.in
135 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
137 lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
138 $(srcdir)/lib/uuid/uuid_types.h.in
139 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
142 $(RM) -f \#* *~ *.orig core MAKELOG
144 clean-local: mostlyclean-local
146 distclean-local: clean-local
147 $(RM) -f $(SUBS) $(SUBST_CONF) \
148 config.status config.log config.cache MCONFIG Makefile \
149 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
151 realclean-local: distclean-local
154 check:: all check-recursive