blob: edf08053ea34b45f57132299457c1e7b876d0c42 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001srcdir = @srcdir@
2top_srcdir = @top_srcdir@
3VPATH = @srcdir@
4top_builddir = .
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00005my_dir = .
Theodore Ts'o50e1e101997-04-26 13:58:21 +00006INSTALL = @INSTALL@
7
8@MCONFIG@
9
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000010@RESIZER_CMT@RESIZE_DIR= resize
11@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -040012@LINUX_CMT@EVMS_DIR= lib/evms
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000013
Theodore Ts'oe12f2ae2003-01-23 16:45:16 -050014LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid lib/blkid
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -040015PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs $(EVMS_DIR)
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000016SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000017
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050018SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000019
Theodore Ts'o21c84b71997-04-29 16:15:03 +000020TAR=tar
21
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050022all::
Theodore Ts'o6928adc2000-05-25 23:28:50 +000023 $(MAKE) libs
24 $(MAKE) progs
25 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000026
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050027subs:
28 for i in $(SUBS) ; do if test -d `dirname $$i` ; then make $$i ; fi ; done
29
30progs: subs all-progs-recursive
31libs: subs all-libs-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +000032
Theodore Ts'o21c84b71997-04-29 16:15:03 +000033docs:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050034 -test -d doc && cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000035
36install-doc-libs:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050037 -test -d doc && cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000038
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000039uninstall-doc-libs:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050040 -test -d doc && cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000041
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000042clean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050043 -test -d doc && cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000044
45distclean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050046 -test -d doc && cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000047
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050048install: subs all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000049 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o286a31a2000-04-03 13:17:59 +000050# export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050051 if test ! -d e2fsck -a ! -d debugfs -a ! -d misc -a ! -d ext2ed ; then $(MAKE) install-libs ; fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +000052
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000053uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
54
Theodore Ts'o50e1e101997-04-26 13:58:21 +000055install-libs: install-libs-recursive
56
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000057uninstall-libs: uninstall-libs-recursive
58
Theodore Ts'o3e377db2000-12-09 02:37:33 +000059TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000060 mostlyclean-recursive realclean-recursive install-recursive:
61 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000062 if test -d $$subdir ; then \
63 target=`echo $@|$(SED) 's/-recursive//'`; \
64 echo making $$target in $$subdir; \
65 (cd $$subdir && $(MAKE) $$target) || exit 1; \
66 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000067 done
68
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000069all-progs-recursive install-progs-recursive uninstall-progs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000070 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000071 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; \
75 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000076 done
77
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000078all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000079 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000080 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; \
84 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000085 done
86
87mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000088
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000089clean: clean-recursive clean-local clean-doc
Theodore Ts'oa4d09611997-04-29 14:28:00 +000090 $(RM) -f $(SUBS)
91
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000092distclean: distclean-doc distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000093
Theodore Ts'o50e1e101997-04-26 13:58:21 +000094realclean: realclean-recursive realclean-local
95
Theodore Ts'o9d564f71999-07-03 20:25:58 +000096depend:: depend-recursive
97
Theodore Ts'o797f5ef2001-06-01 23:49:46 +000098lib/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
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000101
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500102lib/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
105
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500106lib/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
109
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000110mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600111 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000112
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000113clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000114
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000115distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600116 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000117 config.status config.log config.cache MCONFIG Makefile \
118 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
119
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000120realclean-local: distclean-local
121 $(RM) -f configure
122
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500123check:: subs check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000124
Theodore Ts'o74becf31997-04-26 14:37:06 +0000125distribution_tar_file:
Theodore Ts'o66763261999-07-19 15:52:58 +0000126 $(RM) -rf /tmp/dest
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000127 $(MAKE) DESTDIR=/tmp/dest install
Theodore Ts'o74becf31997-04-26 14:37:06 +0000128 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
Theodore Ts'o66763261999-07-19 15:52:58 +0000129 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
Theodore Ts'o74becf31997-04-26 14:37:06 +0000130 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000131 (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000132 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
133
Theodore Ts'o24757fa1997-04-29 17:39:27 +0000134SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +0000135 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +0000136
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500137SSROOT = `echo e2fsprogs-libs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
138 -e 's/pre-//' -e 's/-PLUS//'`
139
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000140$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000141 a=$(SRCROOT); \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000142 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000143 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
Theodore Ts'o990d96a2001-06-22 20:47:24 -0400144 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
Theodore Ts'o90f33eb2001-05-25 17:18:43 +0000145 -o -name changed-files -o -name .#\* \) \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000146 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'o990d96a2001-06-22 20:47:24 -0400147 echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500148 echo "$(SRCROOT)/README.subset" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000149 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000150 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o90f33eb2001-05-25 17:18:43 +0000151 echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000152 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000153 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
Theodore Ts'o19178752000-02-11 15:55:07 +0000154 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
155 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000156 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
157 >> $(srcdir)/.exclude-file
Theodore Ts'obf2602b1998-03-30 01:11:44 +0000158
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500159$(srcdir)/.exclude-subset:
160 a=$(SSROOT); \
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)/doc" >> $(srcdir)/.exclude-subset
183 echo "$(SSROOT)/contrib" >> $(srcdir)/.exclude-subset
184 echo "$(SSROOT)/po" >> $(srcdir)/.exclude-subset
185 echo "$(SSROOT)/include" >> $(srcdir)/.exclude-subset
186 echo "$(SSROOT)/debian" >> $(srcdir)/.exclude-subset
187 echo "$(SSROOT)/lib/e2p" >> $(srcdir)/.exclude-subset
188 echo "$(SSROOT)/lib/evms" >> $(srcdir)/.exclude-subset
189 echo "$(SSROOT)/lib/ext2fs" >> $(srcdir)/.exclude-subset
190 echo "$(SSROOT)/ABOUT-NLS" >> $(srcdir)/.exclude-subset
191 echo "$(SSROOT)/README" >> $(srcdir)/.exclude-subset
192 echo "$(SSROOT)/INSTALL" >> $(srcdir)/.exclude-subset
193 echo "$(SSROOT)/INSTALL.dllbin" >> $(srcdir)/.exclude-subset
194 echo "$(SSROOT)/INSTALL.elfbin" >> $(srcdir)/.exclude-subset
195 echo "$(SSROOT)/RELEASE-NOTES" >> $(srcdir)/.exclude-subset
196 echo "$(SSROOT)/e2fsprogs.lsm" >> $(srcdir)/.exclude-subset
197 echo "$(SSROOT)/e2fsprogs.spec" >> $(srcdir)/.exclude-subset
198
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000199source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000200 cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000201 $(TAR) -c -h -v -f - \
202 -X $$a/.exclude-file $$a | \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000203 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000204 rm -f $(srcdir)/.exclude-file
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500205
206subset_tar_file: $(srcdir)/.exclude-subset
207 cd $(srcdir)/.. && a=$(SSROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
208 $(TAR) -c -h -v -f - \
209 -X $$a/.exclude-subset $$a | \
210 gzip -9 > e2fsprogs-libs-@E2FSPROGS_VERSION@.tar.gz
211 rm -f $(srcdir)/.exclude-file $(srcdir)/.exclude-subset
212
213