blob: 7da9ad7df16f709e59a9214b919155934c7407ea [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'o24c9b552008-07-14 22:38:01 -040010% : %.sh
11
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000012@RESIZER_CMT@RESIZE_DIR= resize
13@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
Scott James Remnant39fd3d42009-05-14 13:03:25 +010014@UUID_CMT@UUID_LIB_SUBDIR= lib/uuid
Theodore Ts'o14b596d2009-04-22 09:18:30 -040015@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
Theodore Ts'of34af412015-07-11 23:05:57 -040016SUPPORT_LIB_SUBDIR= lib/support
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000017
Theodore Ts'of34af412015-07-11 23:05:57 -040018LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) lib/ext2fs intl
Theodore Ts'o921f4ad2004-11-19 17:25:27 -050019PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000020SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000021
Theodore Ts'o0355d6d2016-01-01 21:44:12 -050022SUBS= util/subst.conf lib/config.h $(top_builddir)/lib/dirpaths.h \
Theodore Ts'od1154eb2011-09-18 17:34:37 -040023 lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000024
Theodore Ts'o21c84b71997-04-29 16:15:03 +000025TAR=tar
26
Theodore Ts'o78130a22003-03-14 02:42:42 -050027all:: subs
Theodore Ts'o6928adc2000-05-25 23:28:50 +000028 $(MAKE) libs
29 $(MAKE) progs
30 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000031
Theodore Ts'of0eae152008-10-10 14:00:46 -040032subs: $(DEP_SUBSTITUTE)
Theodore Ts'o60b30db2008-09-01 17:59:01 -040033 @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)
Theodore Ts'odcb8e1f2016-03-06 20:37:49 -050037 @(if test -d lib/support ; then cd lib/support && $(MAKE) prof_err.h; fi)
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050038
Theodore Ts'o3a0d5d32010-05-17 23:48:52 -040039progs: all-progs-recursive
40libs: all-libs-recursive
41all-progs-recursive all-libs-recursive: subs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000042
Andreas Dilger54833572007-05-22 16:20:14 -040043e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
44 cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
45
46rpm: e2fsprogs.spec
Andreas Dilger90466c12006-06-21 00:05:49 -040047 sh contrib/build-rpm
48
Theodore Ts'o21c84b71997-04-29 16:15:03 +000049docs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050050 -@test -d doc && cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000051
52install-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050053 -@test -d doc && cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000054
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000055uninstall-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050056 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000057
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000058clean-doc:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050059 -@test -d doc && cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000060
61distclean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050062 -test -d doc && cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000063
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050064install: subs all-libs-recursive install-progs-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050065 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040066 if test ! -d e2fsck && test ! -d debugfs && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +000067
Theodore Ts'o522798d2004-12-15 11:28:55 -050068install-strip: subs all-libs-recursive install-strip-progs-recursive \
69 install-shlibs-strip-libs-recursive install-doc-libs
70
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000071uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
72
Theodore Ts'o50e1e101997-04-26 13:58:21 +000073install-libs: install-libs-recursive
74
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000075uninstall-libs: uninstall-libs-recursive
76
Theodore Ts'ofedfb272014-02-23 00:17:09 -050077coverage.txt: coverage.txt-recursive
78
Matthias Andree58b3d8d2012-05-11 19:14:30 -040079check-recursive: all
80
Theodore Ts'o3e377db2000-12-09 02:37:33 +000081TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -050082 mostlyclean-recursive realclean-recursive coverage.txt-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050083 @for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000084 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 ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000089 done
90
Theodore Ts'o522798d2004-12-15 11:28:55 -050091all-progs-recursive install-progs-recursive install-strip-progs-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -050092 uninstall-progs-recursive coverage.txt-progs-recursive: all-libs-recursive
Theodore Ts'o47204ff2004-11-30 10:52:27 -050093 @for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000094 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 ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000099 done
100
Theodore Ts'o522798d2004-12-15 11:28:55 -0500101all-libs-recursive install-libs-recursive install-strip-libs-recursive \
102 uninstall-libs-recursive install-shlibs-libs-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -0500103 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive \
104 coverage.txt-libs-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -0500105 @for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000106 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 ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000111 done
112
113mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000114
Theodore Ts'ofedfb272014-02-23 00:17:09 -0500115clean:: clean-recursive clean-local clean-doc
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500116 $(RM) -f $(SUBS)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000117
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500118distclean: distclean-doc distclean-recursive
Theodore Ts'o59a220d2015-07-01 19:40:23 -0400119 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po \
120 asm_types.h config.log public_config.h parse-types.log
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500121 $(MAKE) distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000122
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000123realclean: realclean-recursive realclean-local
124
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000125depend:: depend-recursive
126
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400127lib/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
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000130
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400131lib/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
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500134
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400135lib/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
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500138
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000139mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600140 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000141
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000142clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000143
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000144distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600145 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000146 config.status config.log config.cache MCONFIG Makefile \
147 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
148
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000149realclean-local: distclean-local
150 $(RM) -f configure
151
Andreas Dilgerdb7cb4b2011-06-15 22:17:38 -0400152check:: all check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000153