blob: f5727a807967459909099458c46f01990a3052c9 [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'o147ba432013-10-23 12:51:32 -040016QUOTA_LIB_SUBDIR= lib/quota
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000017
Theodore Ts'oceff9622014-05-23 10:28:04 -040018LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) $(BLKID_LIB_SUBDIR) $(QUOTA_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'od1154eb2011-09-18 17:34:37 -040022SUBS= util/subst.conf lib/config.h lib/dirpaths.h \
23 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'o94ba8c72003-03-02 02:07:14 -050037
Theodore Ts'o3a0d5d32010-05-17 23:48:52 -040038progs: all-progs-recursive
39libs: all-libs-recursive
40all-progs-recursive all-libs-recursive: subs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000041
Andreas Dilger54833572007-05-22 16:20:14 -040042e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
43 cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
44
45rpm: e2fsprogs.spec
Andreas Dilger90466c12006-06-21 00:05:49 -040046 sh contrib/build-rpm
47
Theodore Ts'o21c84b71997-04-29 16:15:03 +000048docs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050049 -@test -d doc && cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000050
51install-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050052 -@test -d doc && cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000053
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000054uninstall-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050055 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000056
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000057clean-doc:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050058 -@test -d doc && cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000059
60distclean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050061 -test -d doc && cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000062
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050063install: subs all-libs-recursive install-progs-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050064 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040065 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 +000066
Theodore Ts'o522798d2004-12-15 11:28:55 -050067install-strip: subs all-libs-recursive install-strip-progs-recursive \
68 install-shlibs-strip-libs-recursive install-doc-libs
69
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000070uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
71
Theodore Ts'o50e1e101997-04-26 13:58:21 +000072install-libs: install-libs-recursive
73
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000074uninstall-libs: uninstall-libs-recursive
75
Theodore Ts'ofedfb272014-02-23 00:17:09 -050076coverage.txt: coverage.txt-recursive
77
Matthias Andree58b3d8d2012-05-11 19:14:30 -040078check-recursive: all
79
Theodore Ts'o3e377db2000-12-09 02:37:33 +000080TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -050081 mostlyclean-recursive realclean-recursive coverage.txt-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050082 @for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000083 if test -d $$subdir ; then \
84 target=`echo $@|$(SED) 's/-recursive//'`; \
85 echo making $$target in $$subdir; \
86 (cd $$subdir && $(MAKE) $$target) || exit 1; \
87 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000088 done
89
Theodore Ts'o522798d2004-12-15 11:28:55 -050090all-progs-recursive install-progs-recursive install-strip-progs-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -050091 uninstall-progs-recursive coverage.txt-progs-recursive: all-libs-recursive
Theodore Ts'o47204ff2004-11-30 10:52:27 -050092 @for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000093 if test -d $$subdir ; then \
94 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
95 echo making $$target in $$subdir; \
96 (cd $$subdir && $(MAKE) $$target) || exit 1; \
97 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000098 done
99
Theodore Ts'o522798d2004-12-15 11:28:55 -0500100all-libs-recursive install-libs-recursive install-strip-libs-recursive \
101 uninstall-libs-recursive install-shlibs-libs-recursive \
Theodore Ts'ofedfb272014-02-23 00:17:09 -0500102 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive \
103 coverage.txt-libs-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -0500104 @for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000105 if test -d $$subdir ; then \
106 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
107 echo making $$target in $$subdir; \
108 (cd $$subdir && $(MAKE) $$target) || exit 1; \
109 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000110 done
111
112mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000113
Theodore Ts'ofedfb272014-02-23 00:17:09 -0500114clean:: clean-recursive clean-local clean-doc
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500115 $(RM) -f $(SUBS)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000116
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500117distclean: distclean-doc distclean-recursive
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500118 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500119 $(MAKE) distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000120
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000121realclean: realclean-recursive realclean-local
122
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000123depend:: depend-recursive
124
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400125lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
126 $(srcdir)/lib/ext2fs/ext2_types.h.in
127 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000128
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400129lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
130 $(srcdir)/lib/blkid/blkid_types.h.in
131 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500132
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400133lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
134 $(srcdir)/lib/uuid/uuid_types.h.in
135 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500136
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000137mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600138 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000139
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000140clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000141
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000142distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600143 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000144 config.status config.log config.cache MCONFIG Makefile \
145 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
146
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000147realclean-local: distclean-local
148 $(RM) -f configure
149
Andreas Dilgerdb7cb4b2011-06-15 22:17:38 -0400150check:: all check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000151