blob: 728d3a57c039620ea6bc95376e1dea1f520a6f29 [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
14
Theodore Ts'oa98b51e2007-08-03 20:10:46 -040015LIB_SUBDIRS=lib/et lib/ss lib/e2p lib/uuid lib/ext2fs lib/blkid intl
Theodore Ts'o921f4ad2004-11-19 17:25:27 -050016PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000017SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000018
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050019SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000020
Theodore Ts'o21c84b71997-04-29 16:15:03 +000021TAR=tar
22
Theodore Ts'o78130a22003-03-14 02:42:42 -050023all:: subs
Theodore Ts'o6928adc2000-05-25 23:28:50 +000024 $(MAKE) libs
25 $(MAKE) progs
26 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000027
Theodore Ts'of0eae152008-10-10 14:00:46 -040028subs: $(DEP_SUBSTITUTE)
Theodore Ts'o60b30db2008-09-01 17:59:01 -040029 @for i in $(SUBS) ; do if test -d `dirname $$i` ; \
30 then $(MAKE) $$i || exit $$? ; fi ; done
31 @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
32 @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050033
34progs: subs all-progs-recursive
35libs: subs all-libs-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +000036
Andreas Dilger54833572007-05-22 16:20:14 -040037e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
38 cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
39
40rpm: e2fsprogs.spec
Andreas Dilger90466c12006-06-21 00:05:49 -040041 sh contrib/build-rpm
42
Theodore Ts'o21c84b71997-04-29 16:15:03 +000043docs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050044 -@test -d doc && cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000045
46install-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050047 -@test -d doc && cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000048
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000049uninstall-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050050 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000051
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000052clean-doc:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050053 -@test -d doc && cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000054
55distclean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050056 -test -d doc && cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000057
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050058install: subs all-libs-recursive install-progs-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050059 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040060 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 +000061
Theodore Ts'o522798d2004-12-15 11:28:55 -050062install-strip: subs all-libs-recursive install-strip-progs-recursive \
63 install-shlibs-strip-libs-recursive install-doc-libs
64
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000065uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
66
Theodore Ts'o50e1e101997-04-26 13:58:21 +000067install-libs: install-libs-recursive
68
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000069uninstall-libs: uninstall-libs-recursive
70
Theodore Ts'o3e377db2000-12-09 02:37:33 +000071TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050072 mostlyclean-recursive realclean-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050073 @for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000074 if test -d $$subdir ; then \
75 target=`echo $@|$(SED) 's/-recursive//'`; \
76 echo making $$target in $$subdir; \
77 (cd $$subdir && $(MAKE) $$target) || exit 1; \
78 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000079 done
80
Theodore Ts'o522798d2004-12-15 11:28:55 -050081all-progs-recursive install-progs-recursive install-strip-progs-recursive \
Mike Frysinger1f803992008-02-28 20:41:17 -050082 uninstall-progs-recursive: all-libs-recursive
Theodore Ts'o47204ff2004-11-30 10:52:27 -050083 @for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000084 if test -d $$subdir ; then \
85 target=`echo $@|$(SED) 's/-progs-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-libs-recursive install-libs-recursive install-strip-libs-recursive \
92 uninstall-libs-recursive install-shlibs-libs-recursive \
93 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050094 @for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000095 if test -d $$subdir ; then \
96 target=`echo $@|$(SED) 's/-libs-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
102mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000103
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +0000104clean: clean-recursive clean-local clean-doc
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500105 $(RM) -f $(SUBS)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000106
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500107distclean: distclean-doc distclean-recursive
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500108 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500109 $(MAKE) distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000110
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000111realclean: realclean-recursive realclean-local
112
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000113depend:: depend-recursive
114
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400115lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
116 $(srcdir)/lib/ext2fs/ext2_types.h.in
117 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000118
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400119lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
120 $(srcdir)/lib/blkid/blkid_types.h.in
121 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500122
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400123lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
124 $(srcdir)/lib/uuid/uuid_types.h.in
125 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500126
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000127mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600128 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000129
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000130clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000131
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000132distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600133 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000134 config.status config.log config.cache MCONFIG Makefile \
135 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
136
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000137realclean-local: distclean-local
138 $(RM) -f configure
139
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500140check:: subs check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000141