blob: 42468f0a7296b09c7b2c7b9299d7d674a0cadba8 [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'odb653a82001-02-08 02:18:52 +000014LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/ext2fs lib/uuid # lib/finddev
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'o797f5ef2001-06-01 23:49:46 +000018SUBS= lib/ext2fs/ext2_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000019
Theodore Ts'o21c84b71997-04-29 16:15:03 +000020TAR=tar
21
Theodore Ts'o6928adc2000-05-25 23:28:50 +000022all:: $(SUBS)
23 $(MAKE) libs
24 $(MAKE) progs
25 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000026
27progs: $(SUBS) all-progs-recursive
28libs: $(SUBS) all-libs-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +000029
Theodore Ts'o21c84b71997-04-29 16:15:03 +000030docs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000031 cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000032
33install-doc-libs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000034 cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000035
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000036uninstall-doc-libs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000037 cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000038
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000039clean-doc:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000040 cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000041
42distclean-doc:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000043 cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000044
Theodore Ts'o65794882001-06-14 00:24:42 +000045install: $(SUBS) all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000046 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o286a31a2000-04-03 13:17:59 +000047# export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
Theodore Ts'o50e1e101997-04-26 13:58:21 +000048
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000049uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
50
Theodore Ts'o50e1e101997-04-26 13:58:21 +000051install-libs: install-libs-recursive
52
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000053uninstall-libs: uninstall-libs-recursive
54
Theodore Ts'o3e377db2000-12-09 02:37:33 +000055TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000056 mostlyclean-recursive realclean-recursive install-recursive:
57 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000058 if test -d $$subdir ; then \
59 target=`echo $@|$(SED) 's/-recursive//'`; \
60 echo making $$target in $$subdir; \
61 (cd $$subdir && $(MAKE) $$target) || exit 1; \
62 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000063 done
64
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000065all-progs-recursive install-progs-recursive uninstall-progs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000066 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000067 if test -d $$subdir ; then \
68 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
69 echo making $$target in $$subdir; \
70 (cd $$subdir && $(MAKE) $$target) || exit 1; \
71 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000072 done
73
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000074all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000075 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000076 if test -d $$subdir ; then \
77 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
78 echo making $$target in $$subdir; \
79 (cd $$subdir && $(MAKE) $$target) || exit 1; \
80 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000081 done
82
83mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000084
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000085clean: clean-recursive clean-local clean-doc
Theodore Ts'oa4d09611997-04-29 14:28:00 +000086 $(RM) -f $(SUBS)
87
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000088distclean: distclean-doc distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000089
Theodore Ts'o50e1e101997-04-26 13:58:21 +000090realclean: realclean-recursive realclean-local
91
Theodore Ts'o9d564f71999-07-03 20:25:58 +000092depend:: depend-recursive
93
Theodore Ts'o797f5ef2001-06-01 23:49:46 +000094lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in
95 $(SUBSTITUTE) $(srcdir)/lib/ext2fs/ext2_types.h.in \
96 > lib/ext2fs/ext2_types.h
Theodore Ts'oa4d09611997-04-29 14:28:00 +000097
Theodore Ts'o50e1e101997-04-26 13:58:21 +000098mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -060099 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000100
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000101clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000102
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000103distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600104 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000105 config.status config.log config.cache MCONFIG Makefile \
106 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
107
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000108realclean-local: distclean-local
109 $(RM) -f configure
110
Andreas Dilger83d0b972001-08-04 01:02:34 -0600111check:: $(SUBS) check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000112
Theodore Ts'o74becf31997-04-26 14:37:06 +0000113distribution_tar_file:
Theodore Ts'o66763261999-07-19 15:52:58 +0000114 $(RM) -rf /tmp/dest
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000115 $(MAKE) DESTDIR=/tmp/dest install
Theodore Ts'o74becf31997-04-26 14:37:06 +0000116 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
Theodore Ts'o66763261999-07-19 15:52:58 +0000117 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
Theodore Ts'o74becf31997-04-26 14:37:06 +0000118 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000119 (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000120 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
121
Theodore Ts'o24757fa1997-04-29 17:39:27 +0000122SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +0000123 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +0000124
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000125$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000126 a=$(SRCROOT); \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000127 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000128 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
Theodore Ts'o990d96a2001-06-22 20:47:24 -0400129 -o -name TAGS -o -name \*.old -o -name \*.gmo -o -name SCCS \
Theodore Ts'o90f33eb2001-05-25 17:18:43 +0000130 -o -name changed-files -o -name .#\* \) \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000131 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'o990d96a2001-06-22 20:47:24 -0400132 echo "$(SRCROOT)/BitKeeper" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000133 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000134 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o90f33eb2001-05-25 17:18:43 +0000135 echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000136 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000137 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
Theodore Ts'o19178752000-02-11 15:55:07 +0000138 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
139 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000140 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
141 >> $(srcdir)/.exclude-file
Theodore Ts'obf2602b1998-03-30 01:11:44 +0000142
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000143source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000144 cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000145 $(TAR) -c -h -v -f - \
146 -X $$a/.exclude-file $$a | \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000147 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000148 rm -f $(srcdir)/.exclude-file