blob: 7c5d441abe68a6e8025f67ac0d84d9a091f25816 [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
Aditya Kalif239fef2011-07-20 11:40:02 -070016@QUOTA_CMT@QUOTA_LIB_SUBDIR= lib/quota
Theodore Ts'ocdf186e2001-06-13 22:16:47 +000017
Aditya Kalif239fef2011-07-20 11:40:02 -070018LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) 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'o3e377db2000-12-09 02:37:33 +000076TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050077 mostlyclean-recursive realclean-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050078 @for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000079 if test -d $$subdir ; then \
80 target=`echo $@|$(SED) 's/-recursive//'`; \
81 echo making $$target in $$subdir; \
82 (cd $$subdir && $(MAKE) $$target) || exit 1; \
83 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000084 done
85
Theodore Ts'o522798d2004-12-15 11:28:55 -050086all-progs-recursive install-progs-recursive install-strip-progs-recursive \
Mike Frysinger1f803992008-02-28 20:41:17 -050087 uninstall-progs-recursive: all-libs-recursive
Theodore Ts'o47204ff2004-11-30 10:52:27 -050088 @for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000089 if test -d $$subdir ; then \
90 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
91 echo making $$target in $$subdir; \
92 (cd $$subdir && $(MAKE) $$target) || exit 1; \
93 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000094 done
95
Theodore Ts'o522798d2004-12-15 11:28:55 -050096all-libs-recursive install-libs-recursive install-strip-libs-recursive \
97 uninstall-libs-recursive install-shlibs-libs-recursive \
98 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050099 @for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000100 if test -d $$subdir ; then \
101 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
102 echo making $$target in $$subdir; \
103 (cd $$subdir && $(MAKE) $$target) || exit 1; \
104 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000105 done
106
107mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000108
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +0000109clean: clean-recursive clean-local clean-doc
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500110 $(RM) -f $(SUBS)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000111
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500112distclean: distclean-doc distclean-recursive
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500113 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500114 $(MAKE) distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000115
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000116realclean: realclean-recursive realclean-local
117
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000118depend:: depend-recursive
119
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400120lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
121 $(srcdir)/lib/ext2fs/ext2_types.h.in
122 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000123
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400124lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
125 $(srcdir)/lib/blkid/blkid_types.h.in
126 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500127
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400128lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
129 $(srcdir)/lib/uuid/uuid_types.h.in
130 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500131
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000132mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600133 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000134
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000135clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000136
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000137distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600138 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000139 config.status config.log config.cache MCONFIG Makefile \
140 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
141
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000142realclean-local: distclean-local
143 $(RM) -f configure
144
Andreas Dilgerdb7cb4b2011-06-15 22:17:38 -0400145check:: all check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000146