Makefile.in revision 05e112a11b6508c2b12d5d4ee0c322171db9b538
1srcdir = @srcdir@
2top_srcdir = @top_srcdir@
3VPATH = @srcdir@
4top_builddir = .
5my_dir = .
6INSTALL = @INSTALL@
7
8@MCONFIG@
9
10LIB_SUBDIRS=lib/et lib/ss lib/ext2fs lib/e2p lib/uuid
11PROG_SUBDIRS=e2fsck debugfs misc resize tests/progs 
12SUBDIRS=$(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
13
14SUBS= include/linux/types.h
15
16TAR=tar
17
18all:: $(SUBS) libs progs docs
19
20progs: $(SUBS) all-progs-recursive
21libs: $(SUBS) all-libs-recursive
22
23docs:
24	(cd doc; make libext2fs.info)
25
26install-doc-libs:
27	(cd doc; make install-doc-libs)
28
29install: all-libs-recursive install-progs-recursive \
30	install-shlibs-libs-recursive install-doc-libs
31	(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 \
38	  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 ; \
43	done
44
45all-progs-recursive install-progs-recursive:
46	for subdir in $(PROG_SUBDIRS); do \
47	  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 ; \
52	done
53
54all-libs-recursive install-libs-recursive install-shlibs-libs-recursive:
55	for subdir in $(LIB_SUBDIRS); do \
56	  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 ; \
61	done
62
63mostlyclean: mostlyclean-recursive mostlyclean-local
64
65clean: clean-recursive clean-local
66	$(RM) -f $(SUBS)
67
68distclean: distclean-recursive distclean-local
69
70realclean: realclean-recursive realclean-local
71
72include/linux/types.h: $(SUBSTITUTE) $(srcdir)/include/linux/types.h.in
73	-chmod +x $(SUBSTITUTE)
74	$(SUBSTITUTE) $(srcdir)/include/linux/types.h.in \
75		include/linux/types.h
76
77mostlyclean-local:
78	$(RM) -f \#* *~ core MAKELOG 
79clean-local: mostlyclean-local
80distclean-local: clean-local
81	$(RM) -f include/linux/types.h $(SUBSTITUTE)
82	$(RM) -f config.status config.log config.cache MCONFIG Makefile
83realclean-local: distclean-local
84	$(RM) -f configure
85
86check:
87	(cd tests; make check)
88
89distribution_tar_file:
90	rm -rf /tmp/dest
91	make DESTDIR=/tmp/dest install
92	cd ..
93	cp -r $(srcdir)/README $(srcdir)/install-utils /tmp/dest
94	cp $(srcdir)/INSTALL.@BINARY_TYPE@ /tmp/dest/INSTALL
95	(cd /tmp/dest; $(TAR) cf - . ) | gzip -9 \
96		> e2fsprogs-@E2FSPROGS_VERSION@-@BINARY_TYPE@.tar.gz
97
98SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
99			-e 's/pre-//' -e 's/-PLUS//'`
100
101$(srcdir)/.exclude-file:
102	(cd $(srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
103		-o -name CVS -o -name \*.rej \) -print \
104		> $(srcdir)/.exclude-file)
105	echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
106	echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
107	echo "$(SRCROOT)/resize" >> $(srcdir)/.exclude-file
108	echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
109	echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
110		>> $(srcdir)/.exclude-file
111	
112source_tar_file: $(srcdir)/.exclude-file
113	(cd $(srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
114		$(TAR) -c -h -v -f - \
115			-X $$a/.exclude-file $$a | \
116		gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
117	rm -f $(srcdir)/.exclude-file
118