blob: d412dfbce2111d448e3c522822915e224cefa4b8 [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@
Theodore Ts'o3ab2fd42020-10-04 23:05:01 -04007MKDIR_P = @MKDIR_P@
Theodore Ts'o50e1e101997-04-26 13:58:21 +00008
9@MCONFIG@
10
Theodore Ts'o24c9b552008-07-14 22:38:01 -040011% : %.sh
12
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000013@RESIZER_CMT@RESIZE_DIR= resize
14@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
Scott James Remnant39fd3d42009-05-14 13:03:25 +010015@UUID_CMT@UUID_LIB_SUBDIR= lib/uuid
Theodore Ts'o14b596d2009-04-22 09:18:30 -040016@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
Darrick J. Wong5ce368f2018-03-23 18:57:09 -070017@E2SCRUB_CMT@E2SCRUB_DIR= scrub
Theodore Ts'o0afb9be2018-08-18 11:19:25 -040018@ALL_CMT@SUPPORT_LIB_SUBDIR= lib/support
19@ALL_CMT@E2P_LIB_SUBDIR= lib/e2p
20@ALL_CMT@EXT2FS_LIB_SUBDIR= lib/ext2fs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000021
Theodore Ts'o0afb9be2018-08-18 11:19:25 -040022LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \
Theodore Ts'oe598c292020-11-24 23:00:57 -050023 $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR)
Theodore Ts'o0afb9be2018-08-18 11:19:25 -040024
Theodore Ts'o6ac81e42018-08-18 23:22:53 -040025PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \
26 $(E2SCRUB_DIR)
27
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000028SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000029
Theodore Ts'o0355d6d2016-01-01 21:44:12 -050030SUBS= util/subst.conf lib/config.h $(top_builddir)/lib/dirpaths.h \
Theodore Ts'od1154eb2011-09-18 17:34:37 -040031 lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000032
Theodore Ts'o21c84b71997-04-29 16:15:03 +000033TAR=tar
34
Theodore Ts'o78130a22003-03-14 02:42:42 -050035all:: subs
Theodore Ts'o6928adc2000-05-25 23:28:50 +000036 $(MAKE) libs
Theodore Ts'o0afb9be2018-08-18 11:19:25 -040037@ALL_CMT@ $(MAKE) progs
38@ALL_CMT@ $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000039
Theodore Ts'o93df80d2020-03-28 17:56:56 -040040all-static::
41 $(MAKE) libs
42@ALL_CMT@ $(MAKE) static-progs
43
Theodore Ts'of0eae152008-10-10 14:00:46 -040044subs: $(DEP_SUBSTITUTE)
Theodore Ts'o60b30db2008-09-01 17:59:01 -040045 @for i in $(SUBS) ; do if test -d `dirname $$i` ; \
46 then $(MAKE) $$i || exit $$? ; fi ; done
47 @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
48 @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
Theodore Ts'odcb8e1f2016-03-06 20:37:49 -050049 @(if test -d lib/support ; then cd lib/support && $(MAKE) prof_err.h; fi)
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050050
Theodore Ts'o3a0d5d32010-05-17 23:48:52 -040051progs: all-progs-recursive
Theodore Ts'o93df80d2020-03-28 17:56:56 -040052static-progs: all-static-progs-recursive
Theodore Ts'o3a0d5d32010-05-17 23:48:52 -040053libs: all-libs-recursive
Theodore Ts'oed07fd92018-08-22 13:42:23 -040054all-progs-recursive all-libs-recursive:: subs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000055
Theodore Ts'oe5f0f3e2018-08-18 10:42:44 -040056rpm:
Andreas Dilger90466c12006-06-21 00:05:49 -040057 sh contrib/build-rpm
58
Theodore Ts'o21c84b71997-04-29 16:15:03 +000059docs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050060 -@test -d doc && cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000061
62install-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050063 -@test -d doc && cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000064
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000065uninstall-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050066 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000067
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000068clean-doc:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050069 -@test -d doc && cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000070
71distclean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050072 -test -d doc && cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000073
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050074install: subs all-libs-recursive install-progs-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050075 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'ofeb235e2018-08-24 17:12:20 -040076@SUBSET_CMT@ $(MAKE) install-libs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000077
Theodore Ts'o522798d2004-12-15 11:28:55 -050078install-strip: subs all-libs-recursive install-strip-progs-recursive \
79 install-shlibs-strip-libs-recursive install-doc-libs
80
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000081uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
82
Theodore Ts'o50e1e101997-04-26 13:58:21 +000083install-libs: install-libs-recursive
84
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000085uninstall-libs: uninstall-libs-recursive
86
Theodore Ts'ofedfb272014-02-23 00:17:09 -050087coverage.txt: coverage.txt-recursive
88
Matthias Andree58b3d8d2012-05-11 19:14:30 -040089check-recursive: all
90
Theodore Ts'o11b8ef82017-04-26 10:07:18 -040091TAGS clean-recursive distclean-recursive depend-recursive fullcheck-recursive \
92 check-recursive mostlyclean-recursive realclean-recursive \
93 coverage.txt-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050094 @for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000095 if test -d $$subdir ; then \
96 target=`echo $@|$(SED) 's/-recursive//'`; \
97 echo making $$target in $$subdir; \
98 (cd $$subdir && $(MAKE) $$target) || exit 1; \
99 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000100 done
101
Theodore Ts'o522798d2004-12-15 11:28:55 -0500102all-progs-recursive install-progs-recursive install-strip-progs-recursive \
Theodore Ts'oed07fd92018-08-22 13:42:23 -0400103 uninstall-progs-recursive coverage.txt-progs-recursive:: all-libs-recursive
104
105
Theodore Ts'o93df80d2020-03-28 17:56:56 -0400106@ALL_CMT@all-progs-recursive all-static-progs-recursive install-progs-recursive \
107@ALL_CMT@ install-strip-progs-recursive uninstall-progs-recursive \
108@ALL_CMT@ coverage.txt-progs-recursive:: all-libs-recursive
Theodore Ts'oed07fd92018-08-22 13:42:23 -0400109@ALL_CMT@ @for subdir in $(PROG_SUBDIRS); do \
110@ALL_CMT@ if test -d $$subdir ; then \
111@ALL_CMT@ target=`echo $@|$(SED) 's/-progs-recursive//'`; \
112@ALL_CMT@ echo making $$target in $$subdir; \
113@ALL_CMT@ (cd $$subdir && $(MAKE) $$target) || exit 1; \
114@ALL_CMT@ fi ; \
115@ALL_CMT@ done
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000116
Theodore Ts'o522798d2004-12-15 11:28:55 -0500117all-libs-recursive install-libs-recursive install-strip-libs-recursive \
118 uninstall-libs-recursive install-shlibs-libs-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -0500119 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive \
Theodore Ts'oed07fd92018-08-22 13:42:23 -0400120 coverage.txt-libs-recursive::
Theodore Ts'o47204ff2004-11-30 10:52:27 -0500121 @for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000122 if test -d $$subdir ; then \
123 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
124 echo making $$target in $$subdir; \
125 (cd $$subdir && $(MAKE) $$target) || exit 1; \
126 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000127 done
128
129mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000130
Theodore Ts'ofedfb272014-02-23 00:17:09 -0500131clean:: clean-recursive clean-local clean-doc
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500132 $(RM) -f $(SUBS)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000133
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500134distclean: distclean-doc distclean-recursive
Theodore Ts'oe5f0f3e2018-08-18 10:42:44 -0400135 $(RM) -rf autom4te.cache ext2ed/Makefile po/stamp-po \
Theodore Ts'o59a220d2015-07-01 19:40:23 -0400136 asm_types.h config.log public_config.h parse-types.log
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500137 $(MAKE) distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000138
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000139realclean: realclean-recursive realclean-local
140
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000141depend:: depend-recursive
142
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400143lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
144 $(srcdir)/lib/ext2fs/ext2_types.h.in
145 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000146
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400147lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
148 $(srcdir)/lib/blkid/blkid_types.h.in
149 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500150
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400151lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
152 $(srcdir)/lib/uuid/uuid_types.h.in
153 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500154
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000155mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600156 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000157
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000158clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000159
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000160distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600161 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000162 config.status config.log config.cache MCONFIG Makefile \
163 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
164
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000165realclean-local: distclean-local
166 $(RM) -f configure
167
Andreas Dilgerdb7cb4b2011-06-15 22:17:38 -0400168check:: all check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000169
Theodore Ts'o11b8ef82017-04-26 10:07:18 -0400170fullcheck:: all fullcheck-recursive