blob: 866957c2ffc2710a27a82eec2a39a0b8992bf44a [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'o50e1e101997-04-26 13:58:21 +000012SUBDIRS=$(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
13
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'o50e1e101997-04-26 13:58:21 +000032install: all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000033 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'obf2602b1998-03-30 01:11:44 +000034# (export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000035
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000036uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
37
Theodore Ts'o50e1e101997-04-26 13:58:21 +000038install-libs: install-libs-recursive
39
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000040uninstall-libs: uninstall-libs-recursive
41
Theodore Ts'o50e1e101997-04-26 13:58:21 +000042TAGS clean-recursive distclean-recursive \
43 mostlyclean-recursive realclean-recursive install-recursive:
44 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000045 if test -d $$subdir ; then \
46 target=`echo $@|$(SED) 's/-recursive//'`; \
47 echo making $$target in $$subdir; \
48 (cd $$subdir && $(MAKE) $$target) || exit 1; \
49 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000050 done
51
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000052all-progs-recursive install-progs-recursive uninstall-progs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000053 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000054 if test -d $$subdir ; then \
55 target=`echo $@|$(SED) 's/-progs-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-libs-recursive install-libs-recursive uninstall-libs-recursive install-shlibs-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o50e1e101997-04-26 13:58:21 +000062 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000063 if test -d $$subdir ; then \
64 target=`echo $@|$(SED) 's/-libs-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
70mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000071
Theodore Ts'o50e1e101997-04-26 13:58:21 +000072clean: clean-recursive clean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000073 $(RM) -f $(SUBS)
74
Theodore Ts'o50e1e101997-04-26 13:58:21 +000075distclean: distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000076
Theodore Ts'o50e1e101997-04-26 13:58:21 +000077realclean: realclean-recursive realclean-local
78
Theodore Ts'odefde781999-01-04 07:39:19 +000079include/asm/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/asm/types.h.in
80 $(SUBSTITUTE) $(srcdir)/include/asm/types.h.in \
81 > include/asm/types.h
Theodore Ts'oa4d09611997-04-29 14:28:00 +000082
Theodore Ts'o50e1e101997-04-26 13:58:21 +000083mostlyclean-local:
84 $(RM) -f \#* *~ core MAKELOG
85clean-local: mostlyclean-local
86distclean-local: clean-local
Theodore Ts'odefde781999-01-04 07:39:19 +000087 $(RM) -f include/asm/types.h $(SUBSTITUTE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000088 $(RM) -f config.status config.log config.cache MCONFIG Makefile
89realclean-local: distclean-local
90 $(RM) -f configure
91
92check:
93 (cd tests; make check)
94
Theodore Ts'o74becf31997-04-26 14:37:06 +000095distribution_tar_file:
Theodore Ts'o556ad131998-12-19 08:10:58 +000096 $(RM) -r /tmp/dest
Theodore Ts'o74becf31997-04-26 14:37:06 +000097 make DESTDIR=/tmp/dest install
98 cd ..
99 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
Theodore Ts'o556ad131998-12-19 08:10:58 +0000100 $(RM) -r /tmp/dest/install-utils/CVS /tmp/dest/install-utils/ChangeLog
Theodore Ts'o74becf31997-04-26 14:37:06 +0000101 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000102 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000103 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
104
Theodore Ts'o24757fa1997-04-29 17:39:27 +0000105SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +0000106 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +0000107
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000108$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000109 a=$(SRCROOT); \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000110 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o14790ed1999-01-12 23:32:52 +0000111 -o -name CVS -o -name \*.rej -o -name Makefile.pq \
112 -o -name TODO -o -name changed-files -o -name .#\* \) \
113 -print) | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000114 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000115 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000116 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000117 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000118 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
119 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
120 >> $(srcdir)/.exclude-file
Theodore Ts'obf2602b1998-03-30 01:11:44 +0000121
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000122source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000123 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
124 $(TAR) -c -h -v -f - \
125 -X $$a/.exclude-file $$a | \
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000126 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
127 rm -f $(srcdir)/.exclude-file