blob: 6a5bae9e9415e8b988d5f15cd459ce3c9865ae70 [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'ofc6d9d51997-04-29 14:51:31 +000010LIB_SUBDIRS=lib/et lib/ss lib/ext2fs lib/e2p lib/uuid
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000011PROG_SUBDIRS=e2fsck debugfs misc resize tests/progs
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000012SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000013
Theodore Ts'odefde781999-01-04 07:39:19 +000014SUBS= include/asm/types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000015
Theodore Ts'o21c84b71997-04-29 16:15:03 +000016TAR=tar
17
Theodore Ts'o6928adc2000-05-25 23:28:50 +000018all:: $(SUBS)
19 $(MAKE) libs
20 $(MAKE) progs
21 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000022
23progs: $(SUBS) all-progs-recursive
24libs: $(SUBS) all-libs-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +000025
Theodore Ts'o21c84b71997-04-29 16:15:03 +000026docs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000027 cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000028
29install-doc-libs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000030 cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000031
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000032uninstall-doc-libs:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000033 cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000034
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000035clean-doc:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000036 cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000037
38distclean-doc:
Theodore Ts'o6928adc2000-05-25 23:28:50 +000039 cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000040
Theodore Ts'o50e1e101997-04-26 13:58:21 +000041install: all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000042 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o286a31a2000-04-03 13:17:59 +000043# export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages
Theodore Ts'o50e1e101997-04-26 13:58:21 +000044
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000045uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
46
Theodore Ts'o50e1e101997-04-26 13:58:21 +000047install-libs: install-libs-recursive
48
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000049uninstall-libs: uninstall-libs-recursive
50
Theodore Ts'o9d564f71999-07-03 20:25:58 +000051TAGS clean-recursive distclean-recursive depend-recursive \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000052 mostlyclean-recursive realclean-recursive install-recursive:
53 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000054 if test -d $$subdir ; then \
55 target=`echo $@|$(SED) 's/-recursive//'`; \
56 echo making $$target in $$subdir; \
57 (cd $$subdir && $(MAKE) $$target) || exit 1; \
58 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000059 done
60
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000061all-progs-recursive install-progs-recursive uninstall-progs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000062 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000063 if test -d $$subdir ; then \
64 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
65 echo making $$target in $$subdir; \
66 (cd $$subdir && $(MAKE) $$target) || exit 1; \
67 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000068 done
69
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000070all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000071 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000072 if test -d $$subdir ; then \
73 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
74 echo making $$target in $$subdir; \
75 (cd $$subdir && $(MAKE) $$target) || exit 1; \
76 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000077 done
78
79mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000080
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000081clean: clean-recursive clean-local clean-doc
Theodore Ts'oa4d09611997-04-29 14:28:00 +000082 $(RM) -f $(SUBS)
83
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000084distclean: distclean-doc distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000085
Theodore Ts'o50e1e101997-04-26 13:58:21 +000086realclean: realclean-recursive realclean-local
87
Theodore Ts'o9d564f71999-07-03 20:25:58 +000088depend:: depend-recursive
89
Theodore Ts'odefde781999-01-04 07:39:19 +000090include/asm/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/asm/types.h.in
91 $(SUBSTITUTE) $(srcdir)/include/asm/types.h.in \
92 > include/asm/types.h
Theodore Ts'oa4d09611997-04-29 14:28:00 +000093
Theodore Ts'o50e1e101997-04-26 13:58:21 +000094mostlyclean-local:
95 $(RM) -f \#* *~ core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +000096
Theodore Ts'o50e1e101997-04-26 13:58:21 +000097clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +000098
Theodore Ts'o50e1e101997-04-26 13:58:21 +000099distclean-local: clean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000100 $(RM) -f include/asm/types.h $(SUBST_CONF) \
101 config.status config.log config.cache MCONFIG Makefile \
102 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
103
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000104realclean-local: distclean-local
105 $(RM) -f configure
106
107check:
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000108 cd tests && $(MAKE) check
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000109
Theodore Ts'o74becf31997-04-26 14:37:06 +0000110distribution_tar_file:
Theodore Ts'o66763261999-07-19 15:52:58 +0000111 $(RM) -rf /tmp/dest
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000112 $(MAKE) DESTDIR=/tmp/dest install
Theodore Ts'o74becf31997-04-26 14:37:06 +0000113 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
Theodore Ts'o66763261999-07-19 15:52:58 +0000114 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
Theodore Ts'o74becf31997-04-26 14:37:06 +0000115 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000116 (cd /tmp/dest && $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000117 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
118
Theodore Ts'o24757fa1997-04-29 17:39:27 +0000119SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +0000120 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +0000121
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000122$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000123 a=$(SRCROOT); \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000124 (cd $(srcdir)/.. && find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000125 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
Theodore Ts'o19178752000-02-11 15:55:07 +0000126 -o -name TAGS -o -name \*.old -o -name \*.gmo \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000127 -o -name TODO -o -name changed-files -o -name .#\* \) \
128 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000129 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000130 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000131 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000132 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
Theodore Ts'o19178752000-02-11 15:55:07 +0000133 echo "$(SRCROOT)/po/stamp-cat-id" >> $(srcdir)/.exclude-file
134 echo "$(SRCROOT)/po/cat-id-tbl.c" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000135 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
136 >> $(srcdir)/.exclude-file
Theodore Ts'obf2602b1998-03-30 01:11:44 +0000137
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000138source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000139 cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000140 $(TAR) -c -h -v -f - \
141 -X $$a/.exclude-file $$a | \
Theodore Ts'o286a31a2000-04-03 13:17:59 +0000142 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000143 rm -f $(srcdir)/.exclude-file