blob: 5708efdead5cd774a00aefb34ad017eb64354fbc [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'ocdf186e2001-06-13 22:16:47 +000016
Scott James Remnant39fd3d42009-05-14 13:03:25 +010017LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) intl
Theodore Ts'o921f4ad2004-11-19 17:25:27 -050018PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
Theodore Ts'of3b3dbb1999-07-19 16:18:52 +000019SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
Theodore Ts'o50e1e101997-04-26 13:58:21 +000020
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050021SUBS= lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
Theodore Ts'o50e1e101997-04-26 13:58:21 +000022
Theodore Ts'o21c84b71997-04-29 16:15:03 +000023TAR=tar
24
Theodore Ts'o78130a22003-03-14 02:42:42 -050025all:: subs
Theodore Ts'o6928adc2000-05-25 23:28:50 +000026 $(MAKE) libs
27 $(MAKE) progs
28 $(MAKE) docs
Theodore Ts'oa4d09611997-04-29 14:28:00 +000029
Theodore Ts'of0eae152008-10-10 14:00:46 -040030subs: $(DEP_SUBSTITUTE)
Theodore Ts'o60b30db2008-09-01 17:59:01 -040031 @for i in $(SUBS) ; do if test -d `dirname $$i` ; \
32 then $(MAKE) $$i || exit $$? ; fi ; done
33 @(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
34 @(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050035
Theodore Ts'o3a0d5d32010-05-17 23:48:52 -040036progs: all-progs-recursive
37libs: all-libs-recursive
38all-progs-recursive all-libs-recursive: subs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000039
Andreas Dilger54833572007-05-22 16:20:14 -040040e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
41 cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
42
43rpm: e2fsprogs.spec
Andreas Dilger90466c12006-06-21 00:05:49 -040044 sh contrib/build-rpm
45
Theodore Ts'o21c84b71997-04-29 16:15:03 +000046docs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050047 -@test -d doc && cd doc && $(MAKE) libext2fs.info
Theodore Ts'o21c84b71997-04-29 16:15:03 +000048
49install-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050050 -@test -d doc && cd doc && $(MAKE) install-doc-libs
Theodore Ts'o21c84b71997-04-29 16:15:03 +000051
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000052uninstall-doc-libs:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050053 -@test -d doc && cd doc && $(MAKE) uninstall-doc-libs
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000054
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000055clean-doc:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050056 -@test -d doc && cd doc && $(MAKE) clean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000057
58distclean-doc:
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050059 -test -d doc && cd doc && $(MAKE) distclean
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +000060
Theodore Ts'o94ba8c72003-03-02 02:07:14 -050061install: subs all-libs-recursive install-progs-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050062 install-shlibs-libs-recursive install-doc-libs
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040063 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 +000064
Theodore Ts'o522798d2004-12-15 11:28:55 -050065install-strip: subs all-libs-recursive install-strip-progs-recursive \
66 install-shlibs-strip-libs-recursive install-doc-libs
67
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000068uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
69
Theodore Ts'o50e1e101997-04-26 13:58:21 +000070install-libs: install-libs-recursive
71
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000072uninstall-libs: uninstall-libs-recursive
73
Theodore Ts'o3e377db2000-12-09 02:37:33 +000074TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
Theodore Ts'o522798d2004-12-15 11:28:55 -050075 mostlyclean-recursive realclean-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050076 @for subdir in $(SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000077 if test -d $$subdir ; then \
78 target=`echo $@|$(SED) 's/-recursive//'`; \
79 echo making $$target in $$subdir; \
80 (cd $$subdir && $(MAKE) $$target) || exit 1; \
81 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000082 done
83
Theodore Ts'o522798d2004-12-15 11:28:55 -050084all-progs-recursive install-progs-recursive install-strip-progs-recursive \
Mike Frysinger1f803992008-02-28 20:41:17 -050085 uninstall-progs-recursive: all-libs-recursive
Theodore Ts'o47204ff2004-11-30 10:52:27 -050086 @for subdir in $(PROG_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000087 if test -d $$subdir ; then \
88 target=`echo $@|$(SED) 's/-progs-recursive//'`; \
89 echo making $$target in $$subdir; \
90 (cd $$subdir && $(MAKE) $$target) || exit 1; \
91 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000092 done
93
Theodore Ts'o522798d2004-12-15 11:28:55 -050094all-libs-recursive install-libs-recursive install-strip-libs-recursive \
95 uninstall-libs-recursive install-shlibs-libs-recursive \
96 install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050097 @for subdir in $(LIB_SUBDIRS); do \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000098 if test -d $$subdir ; then \
99 target=`echo $@|$(SED) 's/-libs-recursive//'`; \
100 echo making $$target in $$subdir; \
101 (cd $$subdir && $(MAKE) $$target) || exit 1; \
102 fi ; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000103 done
104
105mostlyclean: mostlyclean-recursive mostlyclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000106
Theodore Ts'o3ac9f0e1999-07-19 21:02:11 +0000107clean: clean-recursive clean-local clean-doc
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500108 $(RM) -f $(SUBS)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000109
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500110distclean: distclean-doc distclean-recursive
Theodore Ts'o605e6f02004-11-30 22:06:27 -0500111 $(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
Theodore Ts'o9c3ea642008-01-01 17:00:39 -0500112 $(MAKE) distclean-local
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000113
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000114realclean: realclean-recursive realclean-local
115
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000116depend:: depend-recursive
117
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400118lib/ext2fs/ext2_types.h: $(DEP_SUBSTITUTE) asm_types.h \
119 $(srcdir)/lib/ext2fs/ext2_types.h.in
120 cd $(top_builddir); CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000121
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400122lib/blkid/blkid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
123 $(srcdir)/lib/blkid/blkid_types.h.in
124 cd $(top_builddir); CONFIG_FILES=./lib/blkid/blkid_types.h ./config.status
Theodore Ts'oed1b33e2003-03-01 19:29:01 -0500125
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400126lib/uuid/uuid_types.h: $(DEP_SUBSTITUTE) asm_types.h \
127 $(srcdir)/lib/uuid/uuid_types.h.in
128 cd $(top_builddir); CONFIG_FILES=./lib/uuid/uuid_types.h ./config.status
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500129
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000130mostlyclean-local:
Andreas Dilger83d0b972001-08-04 01:02:34 -0600131 $(RM) -f \#* *~ *.orig core MAKELOG
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000132
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000133clean-local: mostlyclean-local
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000134
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000135distclean-local: clean-local
Andreas Dilger83d0b972001-08-04 01:02:34 -0600136 $(RM) -f $(SUBS) $(SUBST_CONF) \
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000137 config.status config.log config.cache MCONFIG Makefile \
138 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
139
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000140realclean-local: distclean-local
141 $(RM) -f configure
142
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500143check:: subs check-recursive
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000144