blob: e03fcddc84d69d8c17727f9acd21aeb7d0de4e7a [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
12
Theodore Ts'odb653a82001-02-08 02:18:52 +000013LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid # lib/finddev
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000014PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000015SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000016
Theodore Ts'o797f5ef2001-06-01 23:49:46 +000017SUBS= lib/ext2fs/ext2_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000018
Theodore Ts'o21c84b71997-04-29 16:15:03 +000019TAR=tar
20
Theodore Ts'o6928adc2000-05-25 23:28:50 +000021all:: $(SUBS)
22 $(MAKE) libs
23 $(MAKE) progs
24 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000025
26progs: $(SUBS) all-progs-recursive
27libs: $(SUBS) all-libs-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +000028
Theodore Ts'o21c84b71997-04-29 16:15:03 +000029docs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000030 cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000031
32install-doc-libs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000033 cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000034
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000035uninstall-doc-libs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000036 cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000037
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000038clean-doc:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000039 cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000040
41distclean-doc:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000042 cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000043
Theodore Ts'o65794882001-06-14 00:24:42 +000044install: $(SUBS) all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000045 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o286a31a2000-04-03 13:17:59 +000046# export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
Theodore Ts'o50e1e101997-04-26 13:58:21 +000047
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000048uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
49
Theodore Ts'o50e1e101997-04-26 13:58:21 +000050install-libs: install-libs-recursive
51
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000052uninstall-libs: uninstall-libs-recursive
53
Theodore Ts'o3e377db2000-12-09 02:37:33 +000054TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000055 mostlyclean-recursive realclean-recursive install-recursive:
56 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000057 if test -d $$subdir ; then \
58 target=`echo $@|$(SED) 's/-recursive//'`; \
59 echo making $$target in $$subdir; \
60 (cd $$subdir && $(MAKE) $$target) || exit 1; \
61 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000062 done
63
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000064all-progs-recursive install-progs-recursive uninstall-progs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000065 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000066 if test -d $$subdir ; then \
67 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
68 echo making $$target in $$subdir; \
69 (cd $$subdir && $(MAKE) $$target) || exit 1; \
70 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000071 done
72
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000073all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000074 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000075 if test -d $$subdir ; then \
76 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
77 echo making $$target in $$subdir; \
78 (cd $$subdir && $(MAKE) $$target) || exit 1; \
79 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000080 done
81
82mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000083
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000084clean: clean-recursive clean-local clean-doc
Theodore Ts'oa4d09611997-04-29 14:28:00 +000085 $(RM) -f $(SUBS)
86
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000087distclean: distclean-doc distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000088
Theodore Ts'o50e1e101997-04-26 13:58:21 +000089realclean: realclean-recursive realclean-local
90
Theodore Ts'o9d564f71999-07-03 20:25:58 +000091depend:: depend-recursive
92
Theodore Ts'o797f5ef2001-06-01 23:49:46 +000093lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in
94 $(SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in \
95 > lib/ext2fs/ext2_types.h
Theodore Ts'oa4d09611997-04-29 14:28:00 +000096
Theodore Ts'o50e1e101997-04-26 13:58:21 +000097mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -060098 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +000099
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000100clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000101
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000102distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600103 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000104 config.status config.log config.cache MCONFIG Makefile \
105 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
106
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000107realclean-local: distclean-local
108 $(RM) -f configure
109
Andreas Dilger83d0b972001-08-04 01:02:34 -0600110check:: $(SUBS) check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000111
Theodore Ts'o74becf31997-04-26 14:37:06 +0000112distribution_tar_file:
Theodore Ts'o66763261999-07-19 15:52:58 +0000113 $(RM) -rf /tmp/dest
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000114 $(MAKE) DESTDIR=/tmp/dest install
Theodore Ts'o74becf31997-04-26 14:37:06 +0000115 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
Theodore Ts'o66763261999-07-19 15:52:58 +0000116 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
Theodore Ts'o74becf31997-04-26 14:37:06 +0000117 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000118 (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000119 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
120
Theodore Ts'o24757fa1997-04-29 17:39:27 +0000121SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +0000122 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +0000123
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000124$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000125 a=$(SRCROOT); \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000126 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000127 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
Theodore Ts'o990d96a2001-06-22 20:47:24 -0400128 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
Theodore Ts'o90f33eb2001-05-25 17:18:43 +0000129 -o -name changed-files -o -name .#\* \) \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000130 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'o990d96a2001-06-22 20:47:24 -0400131 echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000132 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000133 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o90f33eb2001-05-25 17:18:43 +0000134 echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000135 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000136 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
Theodore Ts'o19178752000-02-11 15:55:07 +0000137 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
138 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000139 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
140 >> $(srcdir)/.exclude-file
Theodore Ts'obf2602b1998-03-30 01:11:44 +0000141
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000142source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000143 cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000144 $(TAR) -c -h -v -f - \
145 -X $$a/.exclude-file $$a | \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000146 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000147 rm -f $(srcdir)/.exclude-file