blob: 17c1294380ad2af9ab280eaadf30a67b2447cbca [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
18all:: $(SUBS) libs progs docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000019
20progs: $(SUBS) all-progs-recursive
21libs: $(SUBS) all-libs-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +000022
Theodore Ts'o21c84b71997-04-29 16:15:03 +000023docs:
Theodore Ts'obf2602b1998-03-30 01:11:44 +000024 (cd doc && make libext2fs.info)
Theodore Ts'o21c84b71997-04-29 16:15:03 +000025
26install-doc-libs:
Theodore Ts'obf2602b1998-03-30 01:11:44 +000027 (cd doc && make install-doc-libs)
Theodore Ts'o21c84b71997-04-29 16:15:03 +000028
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000029uninstall-doc-libs:
30 (cd doc && make uninstall-doc-libs)
31
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000032clean-doc:
33 (cd doc && make clean)
34
35distclean-doc:
36 (cd doc && make distclean)
37
Theodore Ts'o50e1e101997-04-26 13:58:21 +000038install: all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000039 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'obf2602b1998-03-30 01:11:44 +000040# (export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000041
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000042uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
43
Theodore Ts'o50e1e101997-04-26 13:58:21 +000044install-libs: install-libs-recursive
45
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000046uninstall-libs: uninstall-libs-recursive
47
Theodore Ts'o9d564f71999-07-03 20:25:58 +000048TAGS clean-recursive distclean-recursive depend-recursive \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000049 mostlyclean-recursive realclean-recursive install-recursive:
50 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000051 if test -d $$subdir ; then \
52 target=`echo $@|$(SED) 's/-recursive//'`; \
53 echo making $$target in $$subdir; \
54 (cd $$subdir && $(MAKE) $$target) || exit 1; \
55 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000056 done
57
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000058all-progs-recursive install-progs-recursive uninstall-progs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000059 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000060 if test -d $$subdir ; then \
61 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
62 echo making $$target in $$subdir; \
63 (cd $$subdir && $(MAKE) $$target) || exit 1; \
64 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000065 done
66
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000067all-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000068 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000069 if test -d $$subdir ; then \
70 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
71 echo making $$target in $$subdir; \
72 (cd $$subdir && $(MAKE) $$target) || exit 1; \
73 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000074 done
75
76mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000077
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000078clean: clean-recursive clean-local clean-doc
Theodore Ts'oa4d09611997-04-29 14:28:00 +000079 $(RM) -f $(SUBS)
80
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000081distclean: distclean-doc distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000082
Theodore Ts'o50e1e101997-04-26 13:58:21 +000083realclean: realclean-recursive realclean-local
84
Theodore Ts'o9d564f71999-07-03 20:25:58 +000085depend:: depend-recursive
86
Theodore Ts'odefde781999-01-04 07:39:19 +000087include/asm/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/asm/types.h.in
88 $(SUBSTITUTE) $(srcdir)/include/asm/types.h.in \
89 > include/asm/types.h
Theodore Ts'oa4d09611997-04-29 14:28:00 +000090
Theodore Ts'o50e1e101997-04-26 13:58:21 +000091mostlyclean-local:
92 $(RM) -f \#* *~ core MAKELOG
93clean-local: mostlyclean-local
94distclean-local: clean-local
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000095 $(RM) -f include/asm/types.h $(SUBST_CONF)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000096 $(RM) -f config.status config.log config.cache MCONFIG Makefile
97realclean-local: distclean-local
98 $(RM) -f configure
99
100check:
101 (cd tests; make check)
102
Theodore Ts'o74becf31997-04-26 14:37:06 +0000103distribution_tar_file:
Theodore Ts'o66763261999-07-19 15:52:58 +0000104 $(RM) -rf /tmp/dest
Theodore Ts'o74becf31997-04-26 14:37:06 +0000105 make DESTDIR=/tmp/dest install
106 cd ..
107 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
Theodore Ts'o66763261999-07-19 15:52:58 +0000108 $(RM) -rf /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
Theodore Ts'o74becf31997-04-26 14:37:06 +0000109 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000110 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000111 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
112
Theodore Ts'o24757fa1997-04-29 17:39:27 +0000113SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +0000114 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +0000115
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000116$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000117 a=$(SRCROOT); \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000118 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000119 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
120 -o -name TODO -o -name changed-files -o -name .#\* \) \
121 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000122 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000123 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000124 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000125 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000126 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
127 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
128 >> $(srcdir)/.exclude-file
Theodore Ts'obf2602b1998-03-30 01:11:44 +0000129
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000130source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000131 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
132 $(TAR) -c -h -v -f - \
133 -X $$a/.exclude-file $$a | \
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000134 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
135 rm -f $(srcdir)/.exclude-file