blob: 11c92c69aee93e9a060c351df616bcbce0d42a89 [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'oa4d09611997-04-29 14:28:00 +000014SUBS= include/linux/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:
24 (cd doc; make libext2fs.info)
25
26install-doc-libs:
27 (cd doc; make install-doc-libs)
28
Theodore Ts'o50e1e101997-04-26 13:58:21 +000029install: all-libs-recursive install-progs-recursive \
Theodore Ts'o21c84b71997-04-29 16:15:03 +000030 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000031 (export MANPATH=$(DESTDIR)$(mandir); $(srcdir)/install-utils/compile_manpages)
32
33install-libs: install-libs-recursive
34
35TAGS clean-recursive distclean-recursive \
36 mostlyclean-recursive realclean-recursive install-recursive:
37 for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000038 if test -d $$subdir ; then \
39 target=`echo $@|$(SED) 's/-recursive//'`; \
40 echo making $$target in $$subdir; \
41 (cd $$subdir && $(MAKE) $$target) || exit 1; \
42 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000043 done
44
45all-progs-recursive install-progs-recursive:
46 for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000047 if test -d $$subdir ; then \
48 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
49 echo making $$target in $$subdir; \
50 (cd $$subdir && $(MAKE) $$target) || exit 1; \
51 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000052 done
53
54all-libs-recursive install-libs-recursive install-shlibs-libs-recursive:
55 for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000056 if test -d $$subdir ; then \
57 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
58 echo making $$target in $$subdir; \
59 (cd $$subdir && $(MAKE) $$target) || exit 1; \
60 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000061 done
62
63mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000064
Theodore Ts'o50e1e101997-04-26 13:58:21 +000065clean: clean-recursive clean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000066 $(RM) -f $(SUBS)
67
Theodore Ts'o50e1e101997-04-26 13:58:21 +000068distclean: distclean-recursive distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +000069
Theodore Ts'o50e1e101997-04-26 13:58:21 +000070realclean: realclean-recursive realclean-local
71
Theodore Ts'o44339bd1997-10-15 02:47:20 +000072include/linux/types.h: $(DEP_SUBSTITUTE) $(srcdir)/include/linux/types.h.in
Theodore Ts'oa4d09611997-04-29 14:28:00 +000073 $(SUBSTITUTE) $(srcdir)/include/linux/types.h.in \
Theodore Ts'o44339bd1997-10-15 02:47:20 +000074 > include/linux/types.h
Theodore Ts'oa4d09611997-04-29 14:28:00 +000075
Theodore Ts'o50e1e101997-04-26 13:58:21 +000076mostlyclean-local:
77 $(RM) -f \#* *~ core MAKELOG
78clean-local: mostlyclean-local
79distclean-local: clean-local
Theodore Ts'o21c84b71997-04-29 16:15:03 +000080 $(RM) -f include/linux/types.h $(SUBSTITUTE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000081 $(RM) -f config.status config.log config.cache MCONFIG Makefile
82realclean-local: distclean-local
83 $(RM) -f configure
84
85check:
86 (cd tests; make check)
87
Theodore Ts'o74becf31997-04-26 14:37:06 +000088distribution_tar_file:
89 rm -rf /tmp/dest
90 make DESTDIR=/tmp/dest install
91 cd ..
92 cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
93 cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
Theodore Ts'o21c84b71997-04-29 16:15:03 +000094 (cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
Theodore Ts'o74becf31997-04-26 14:37:06 +000095 > e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
96
Theodore Ts'o24757fa1997-04-29 17:39:27 +000097SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
Theodore Ts'o05e112a1997-06-14 07:28:44 +000098 -e 's/pre-//' -e 's/-PLUS//'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000099
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000100$(srcdir)/.exclude-file:
Theodore Ts'obc210071997-06-17 05:41:36 +0000101 a=$(SRCROOT); \
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000102 (cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o5be8dc21997-12-01 18:24:10 +0000103 -o -name CVS -o -name \*.rej -o -name Makefile.pq \) -print) \
Theodore Ts'obc210071997-06-17 05:41:36 +0000104 | sed -e "s/e2fsprogs/$$a/" > $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000105 echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
Theodore Ts'o21c84b71997-04-29 16:15:03 +0000106 echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000107 echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
Theodore Ts'o7668d9b1997-10-20 01:23:07 +0000108 echo "$(SRCROOT)/powerquest" >> $(srcdir)/.exclude-file
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000109 echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
110 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
111 >> $(srcdir)/.exclude-file
112
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000113source_tar_file: $(srcdir)/.exclude-file
Theodore Ts'o9559ea31997-05-09 02:43:38 +0000114 (cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
115 $(TAR) -c -h -v -f - \
116 -X $$a/.exclude-file $$a | \
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000117 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
118 rm -f $(srcdir)/.exclude-file