1srcdir = @srcdir@
2top_srcdir = @top_srcdir@
3VPATH = @srcdir@
4top_builddir = .
5my_dir = .
6INSTALL = @INSTALL@
7
8@MCONFIG@
9
10% : %.sh
11
12@RESIZER_CMT@RESIZE_DIR= resize
13@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
14@UUID_CMT@UUID_LIB_SUBDIR= lib/uuid
15@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
16SUPPORT_LIB_SUBDIR= lib/support
17
18LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) lib/ext2fs intl
19PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
20SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
21
22SUBS= util/subst.conf lib/config.h $(top_builddir)/lib/dirpaths.h \
23	lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
24
25TAR=tar
26
27all:: subs
28	$(MAKE) libs
29	$(MAKE) progs
30	$(MAKE) docs
31
32subs: $(DEP_SUBSTITUTE)
33	@for i in $(SUBS) ; do if test -d `dirname $$i` ; \
34		then $(MAKE) $$i || exit $$? ; fi ; done
35	@(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
36	@(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
37	@(if test -d lib/support ; then cd lib/support && $(MAKE) prof_err.h; fi)
38
39progs: all-progs-recursive
40libs: all-libs-recursive
41all-progs-recursive all-libs-recursive: subs
42
43e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
44	cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
45
46rpm: e2fsprogs.spec
47	sh contrib/build-rpm
48
49docs:
50	-@test -d doc && cd doc && $(MAKE) libext2fs.info
51
52install-doc-libs:
53	-@test -d doc && cd doc && $(MAKE) install-doc-libs
54
55uninstall-doc-libs:
56	-@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
57
58clean-doc:
59	-@test -d doc && cd doc && $(MAKE) clean
60
61distclean-doc:
62	-test -d doc && cd doc && $(MAKE) distclean
63
64install: subs all-libs-recursive install-progs-recursive \
65  install-shlibs-libs-recursive install-doc-libs
66	if test ! -d e2fsck && test ! -d debugfs && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi
67
68install-strip: subs all-libs-recursive install-strip-progs-recursive \
69  install-shlibs-strip-libs-recursive install-doc-libs
70
71uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
72
73install-libs: install-libs-recursive
74
75uninstall-libs: uninstall-libs-recursive
76
77coverage.txt: coverage.txt-recursive
78
79check-recursive: all
80
81TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
82  mostlyclean-recursive realclean-recursive coverage.txt-recursive:
83	@for subdir in $(SUBDIRS); do \
84	  if test -d $$subdir ; then \
85	    target=`echo $@|$(SED) 's/-recursive//'`; \
86	    echo making $$target in $$subdir; \
87	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
88	  fi ; \
89	done
90
91all-progs-recursive install-progs-recursive install-strip-progs-recursive \
92  uninstall-progs-recursive coverage.txt-progs-recursive: all-libs-recursive
93	@for subdir in $(PROG_SUBDIRS); do \
94	  if test -d $$subdir ; then \
95	    target=`echo $@|$(SED) 's/-progs-recursive//'`; \
96	    echo making $$target in $$subdir; \
97	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
98	  fi ; \
99	done
100
101all-libs-recursive install-libs-recursive install-strip-libs-recursive \
102  uninstall-libs-recursive install-shlibs-libs-recursive \
103  install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive \
104  coverage.txt-libs-recursive:
105	@for subdir in $(LIB_SUBDIRS); do \
106	  if test -d $$subdir ; then \
107	    target=`echo $@|$(SED) 's/-libs-recursive//'`; \
108	    echo making $$target in $$subdir; \
109	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
110	  fi ; \
111	done
112
113mostlyclean: mostlyclean-recursive mostlyclean-local
114
115clean:: clean-recursive clean-local clean-doc
116	$(RM) -f $(SUBS)
117
118distclean: distclean-doc distclean-recursive
119	$(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po \
120		asm_types.h config.log public_config.h parse-types.log
121	$(MAKE) distclean-local
122
123realclean: realclean-recursive realclean-local
124
125depend:: depend-recursive
126
127lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
128		$(srcdir)/lib/ext2fs/ext2_types.h.in
129	cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
130
131lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
132		$(srcdir)/lib/blkid/blkid_types.h.in
133	cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
134
135lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
136		$(srcdir)/lib/uuid/uuid_types.h.in
137	cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
138
139mostlyclean-local:
140	$(RM) -f \#* *~ *.orig core MAKELOG
141
142clean-local: mostlyclean-local
143
144distclean-local: clean-local
145	$(RM) -f $(SUBS) $(SUBST_CONF) \
146		config.status config.log config.cache MCONFIG Makefile \
147		$(srcdir)/TAGS $(srcdir)/Makefile.in.old
148
149realclean-local: distclean-local
150	$(RM) -f configure
151
152check::	all check-recursive
153
154