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/blkid
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 lib/blkid/blkid_types.h lib/uuid/uuid_types.h
28 for i in $(SUBS) ; do if test -d `dirname $$i` ; then make $$i ; fi ; done
30 progs: subs all-progs-recursive
31 libs: subs all-libs-recursive
34 -test -d doc && cd doc && $(MAKE) libext2fs.info
37 -test -d doc && cd doc && $(MAKE) install-doc-libs
40 -test -d doc && cd doc && $(MAKE) uninstall-doc-libs
43 -test -d doc && cd doc && $(MAKE) clean
46 -test -d doc && cd doc && $(MAKE) distclean
48 install: subs all-libs-recursive install-progs-recursive \
49 install-shlibs-libs-recursive install-doc-libs
50 # export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
51 if test ! -d e2fsck -a ! -d debugfs -a ! -d misc -a ! -d ext2ed ; then $(MAKE) install-libs ; fi
53 uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
55 install-libs: install-libs-recursive
57 uninstall-libs: uninstall-libs-recursive
59 TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
60 mostlyclean-recursive realclean-recursive install-recursive:
61 for subdir in $(SUBDIRS); do \
62 if test -d $$subdir ; then \
63 target=`echo $@|$(SED) 's/-recursive//'`; \
64 echo making $$target in $$subdir; \
65 (cd $$subdir && $(MAKE) $$target) || exit 1; \
69 all-progs-recursive install-progs-recursive uninstall-progs-recursive:
70 for subdir in $(PROG_SUBDIRS); do \
71 if test -d $$subdir ; then \
72 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
73 echo making $$target in $$subdir; \
74 (cd $$subdir && $(MAKE) $$target) || exit 1; \
78 all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
79 for subdir in $(LIB_SUBDIRS); do \
80 if test -d $$subdir ; then \
81 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
82 echo making $$target in $$subdir; \
83 (cd $$subdir && $(MAKE) $$target) || exit 1; \
87 mostlyclean: mostlyclean-recursive mostlyclean-local
89 clean: clean-recursive clean-local clean-doc
92 distclean: distclean-doc distclean-recursive distclean-local
94 realclean: realclean-recursive realclean-local
96 depend:: depend-recursive
98 lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in
99 $(SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in \
100 > lib/ext2fs/ext2_types.h
102 lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/blkid/blkid_types.h.in
103 $(SUBSTITUTE) $(srcdir)/lib/blkid/blkid_types.h.in \
104 > lib/blkid/blkid_types.h
106 lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/uuid/uuid_types.h.in
107 $(SUBSTITUTE) $(srcdir)/lib/uuid/uuid_types.h.in \
108 > lib/uuid/uuid_types.h
111 $(RM) -f \#* *~ *.orig core MAKELOG
113 clean-local: mostlyclean-local
115 distclean-local: clean-local
116 $(RM) -f $(SUBS) $(SUBST_CONF) \
117 config.status config.log config.cache MCONFIG Makefile \
118 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
120 realclean-local: distclean-local
123 check:: subs check-recursive
125 distribution_tar_file:
127 $(MAKE) DESTDIR=/tmp/dest install
128 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
129 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
130 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
131 (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
132 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
134 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
135 -e 's/pre-//' -e 's/-PLUS//'`
137 SSROOT = `echo e2fsprogs-libs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
138 -e 's/pre-//' -e 's/-PLUS//'`
140 $(srcdir)/.exclude-file:
142 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
143 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
144 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
145 -o -name changed-files -o -name .#\* \) \
146 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
147 echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file
148 echo "$(SRCROOT)/README.subset" >> $(srcdir)/.exclude-file
149 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
150 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
151 echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
152 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
153 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
154 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
155 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
156 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
157 >> $(srcdir)/.exclude-file
159 $(srcdir)/.exclude-subset:
161 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
162 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
163 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
164 -o -name changed-files -o -name .#\* \) \
165 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-subset
166 echo "$(SSROOT)/BitKeeper" >> $(srcdir)/.exclude-subset
167 echo "$(SSROOT)/build" >> $(srcdir)/.exclude-subset
168 echo "$(SSROOT)/rpm.log" >> $(srcdir)/.exclude-subset
169 echo "$(SSROOT)/TODO" >> $(srcdir)/.exclude-subset
170 echo "$(SSROOT)/powerquest" >> $(srcdir)/.exclude-subset
171 echo "$(SSROOT)/.exclude-subset" >> $(srcdir)/.exclude-subset
172 echo "$(SSROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-subset
173 echo "$(SSROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-subset
174 echo $(SSROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
175 >> $(srcdir)/.exclude-subset
176 echo "$(SSROOT)/e2fsck" >> $(srcdir)/.exclude-subset
177 echo "$(SSROOT)/ext2ed" >> $(srcdir)/.exclude-subset
178 echo "$(SSROOT)/debugfs" >> $(srcdir)/.exclude-subset
179 echo "$(SSROOT)/misc" >> $(srcdir)/.exclude-subset
180 echo "$(SSROOT)/tests" >> $(srcdir)/.exclude-subset
181 echo "$(SSROOT)/resize" >> $(srcdir)/.exclude-subset
182 echo "$(SSROOT)/contrib" >> $(srcdir)/.exclude-subset
183 echo "$(SSROOT)/po" >> $(srcdir)/.exclude-subset
184 echo "$(SSROOT)/include" >> $(srcdir)/.exclude-subset
185 echo "$(SSROOT)/debian" >> $(srcdir)/.exclude-subset
186 echo "$(SSROOT)/lib/e2p" >> $(srcdir)/.exclude-subset
187 echo "$(SSROOT)/lib/evms" >> $(srcdir)/.exclude-subset
188 echo "$(SSROOT)/lib/ext2fs" >> $(srcdir)/.exclude-subset
189 echo "$(SSROOT)/ABOUT-NLS" >> $(srcdir)/.exclude-subset
190 echo "$(SSROOT)/README" >> $(srcdir)/.exclude-subset
191 echo "$(SSROOT)/INSTALL" >> $(srcdir)/.exclude-subset
192 echo "$(SSROOT)/INSTALL.dllbin" >> $(srcdir)/.exclude-subset
193 echo "$(SSROOT)/INSTALL.elfbin" >> $(srcdir)/.exclude-subset
194 echo "$(SSROOT)/RELEASE-NOTES" >> $(srcdir)/.exclude-subset
195 echo "$(SSROOT)/e2fsprogs.lsm" >> $(srcdir)/.exclude-subset
196 echo "$(SSROOT)/e2fsprogs.spec" >> $(srcdir)/.exclude-subset
198 source_tar_file: $(srcdir)/.exclude-file
199 cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
200 $(TAR) -c -h -v -f - \
201 -X $$a/.exclude-file $$a | \
202 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
203 rm -f $(srcdir)/.exclude-file
205 subset_tar_file: $(srcdir)/.exclude-subset
206 cd $(srcdir)/.. && a=$(SSROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
207 $(TAR) -c -h -v -f - \
208 -X $$a/.exclude-subset $$a | \
209 gzip -9 > e2fsprogs-libs-@E2FSPROGS_VERSION@.tar.gz
210 rm -f $(srcdir)/.exclude-file $(srcdir)/.exclude-subset