blob: bf037e025465bdd71b258bc1ac803ac53a0cb438 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001#
2# Standard e2fsprogs prologue....
3#
4
5srcdir = @srcdir@
6top_srcdir = @top_srcdir@
7VPATH = @srcdir@
8top_builddir = ..
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +00009my_dir = debugfs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000010INSTALL = @INSTALL@
11
12@MCONFIG@
13
Theodore Ts'of62516f2011-11-21 08:23:25 -050014PROGS= debugfs
Theodore Ts'o50e1e101997-04-26 13:58:21 +000015MANPAGES= debugfs.8
16
Theodore Ts'o619dd192000-07-04 12:37:55 +000017MK_CMDS= _SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
Theodore Ts'o50e1e101997-04-26 13:58:21 +000018
Theodore Ts'oc6bd0c92000-08-14 20:37:09 +000019DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
JP Abgralle0ed7402014-03-19 19:08:39 -070020 lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
21 filefrag.o extent_cmds.o extent_inode.o zap.o
22
23RO_DEBUG_OBJS= ro_debug_cmds.o ro_debugfs.o util.o ncheck.o icheck.o ls.o \
24 lsdel.o logdump.o htree.o e2freefrag.o filefrag.o extent_cmds.o \
25 extent_inode.o
Theodore Ts'oe88c5a32011-11-14 22:01:52 -050026
Theodore Ts'o521e3681997-04-29 17:48:10 +000027SRCS= debug_cmds.c $(srcdir)/debugfs.c $(srcdir)/util.c $(srcdir)/ls.c \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000028 $(srcdir)/ncheck.c $(srcdir)/icheck.c $(srcdir)/lsdel.c \
Theodore Ts'o7dec0502004-12-21 20:37:36 -050029 $(srcdir)/dump.c $(srcdir)/set_fields.c ${srcdir}/logdump.c \
JP Abgralle0ed7402014-03-19 19:08:39 -070030 $(srcdir)/htree.c $(srcdir)/unused.c ${srcdir}/../misc/e2freefrag.c \
31 $(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c
Theodore Ts'o50e1e101997-04-26 13:58:21 +000032
Theodore Ts'o3ae497e2003-03-16 06:26:25 -050033LIBS= $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
Theodore Ts'odaf7a6e2008-04-17 16:54:24 -040034 $(LIBUUID)
Theodore Ts'oa6a1c082009-07-01 22:06:51 -040035DEPLIBS= $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
36 $(DEPLIBBLKID) $(DEPLIBUUID)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000037
JP Abgralle0ed7402014-03-19 19:08:39 -070038STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) $(STATIC_LIBCOM_ERR) \
39 $(STATIC_LIBBLKID) $(STATIC_LIBUUID) $(STATIC_LIBE2P)
40STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBSS) \
41 $(DEPSTATIC_LIBCOM_ERR) $(DEPSTATIC_LIBUUID) \
42 $(DEPSTATIC_LIBE2P)
43
Theodore Ts'o50e1e101997-04-26 13:58:21 +000044.c.o:
Theodore Ts'oc13351f2009-07-02 00:11:17 -040045 $(E) " CC $<"
46 $(Q) $(CC) -c $(ALL_CFLAGS) $< -o $@
JP Abgralle0ed7402014-03-19 19:08:39 -070047 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
Theodore Ts'o50e1e101997-04-26 13:58:21 +000048
Theodore Ts'o62c06f71997-04-29 14:34:47 +000049all:: $(PROGS) $(MANPAGES)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000050
51debugfs: $(DEBUG_OBJS) $(DEPLIBS)
Theodore Ts'oc13351f2009-07-02 00:11:17 -040052 $(E) " LD $@"
53 $(Q) $(CC) $(ALL_LDFLAGS) -o debugfs $(DEBUG_OBJS) $(LIBS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000054
JP Abgralle0ed7402014-03-19 19:08:39 -070055debugfs.static: $(DEBUG_OBJS) $(STATIC_DEPLIBS)
56 $(E) " LD $@"
57 $(Q) $(CC) $(LDFLAGS_STATIC) -o debugfs.static $(DEBUG_OBJS) \
58 $(STATIC_LIBS) $(READLINE_LIB)
59
60rdebugfs: $(RO_DEBUG_OBJS) $(DEPLIBS)
61 $(E) " LD $@"
62 $(Q) $(CC) $(ALL_LDFLAGS) -o rdebugfs $(RO_DEBUG_OBJS) $(LIBS)
63
Theodore Ts'o50e1e101997-04-26 13:58:21 +000064debug_cmds.c debug_cmds.h: debug_cmds.ct
Theodore Ts'oc13351f2009-07-02 00:11:17 -040065 $(E) " MK_CMDS $@"
66 $(Q) $(MK_CMDS) $(srcdir)/debug_cmds.ct
Theodore Ts'o50e1e101997-04-26 13:58:21 +000067
JP Abgralle0ed7402014-03-19 19:08:39 -070068extent_cmds.c extent_cmds.h: extent_cmds.ct
69 $(E) " MK_CMDS $@"
70 $(Q) $(MK_CMDS) $(srcdir)/extent_cmds.ct
71
72ro_debug_cmds.c ro_debug_cmds.h: ro_debug_cmds.ct
73 $(E) " MK_CMDS $@"
74 $(Q) $(MK_CMDS) $(srcdir)/ro_debug_cmds.ct
75
76ro_debugfs.o: debugfs.c
77 $(E) " CC $@"
78 $(Q) $(CC) -c $(ALL_CFLAGS) $< -DREAD_ONLY -o $@
79
80e2freefrag.o: $(srcdir)/../misc/e2freefrag.c
81 $(E) " CC $@"
82 $(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) $< -DDEBUGFS -o $@
83
Theodore Ts'o44339bd1997-10-15 02:47:20 +000084debugfs.8: $(DEP_SUBSTITUTE) $(srcdir)/debugfs.8.in
Theodore Ts'oc13351f2009-07-02 00:11:17 -040085 $(E) " SUBST $@"
86 $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/debugfs.8.in debugfs.8
Theodore Ts'o62c06f71997-04-29 14:34:47 +000087
Theodore Ts'o50e1e101997-04-26 13:58:21 +000088installdirs:
Theodore Ts'oc13351f2009-07-02 00:11:17 -040089 $(E) " MKINSTALLDIRS $(root_sbindir) $(man8dir)"
90 $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \
Theodore Ts'o7e44f241998-04-01 03:16:29 +000091 $(DESTDIR)$(man8dir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000092
93install: $(PROGS) $(MANPAGES) installdirs
Theodore Ts'oc13351f2009-07-02 00:11:17 -040094 $(Q) for i in $(PROGS); do \
Theodore Ts'o522798d2004-12-15 11:28:55 -050095 echo " INSTALL $(root_sbindir)/$$i"; \
Theodore Ts'o7e44f241998-04-01 03:16:29 +000096 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +000097 done
Theodore Ts'oc13351f2009-07-02 00:11:17 -040098 $(Q) for i in $(MANPAGES); do \
Theodore Ts'o482afc42002-10-31 03:32:34 -050099 for j in $(COMPRESS_EXT); do \
100 $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
101 done; \
Theodore Ts'o522798d2004-12-15 11:28:55 -0500102 echo " INSTALL_DATA $(man8dir)/$$i"; \
Theodore Ts'o74becf31997-04-26 14:37:06 +0000103 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000104 done
105
Theodore Ts'o522798d2004-12-15 11:28:55 -0500106install-strip: install
Theodore Ts'oc13351f2009-07-02 00:11:17 -0400107 $(Q) for i in $(PROGS); do \
Theodore Ts'o522798d2004-12-15 11:28:55 -0500108 echo " STRIP $(root_sbindir)/$$i"; \
109 $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
110 done
111
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000112uninstall:
113 for i in $(PROGS); do \
Theodore Ts'o7e44f241998-04-01 03:16:29 +0000114 $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000115 done
116 for i in $(MANPAGES); do \
Theodore Ts'o7e44f241998-04-01 03:16:29 +0000117 $(RM) -f $(DESTDIR)$(man8dir)/$$i; \
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000118 done
119
120clean:
JP Abgralle0ed7402014-03-19 19:08:39 -0700121 $(RM) -f $(PROGS) debugfs.8 \#* *.s *.o *.a *~ debug_cmds.c \
122 extent_cmds.c ro_debug_cmds.c core rdebugfs debugfs.static
Theodore Ts'o62c06f71997-04-29 14:34:47 +0000123
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000124mostlyclean: clean
125distclean: clean
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000126 $(RM) -f debug_cmds.c .depend Makefile $(srcdir)/TAGS \
127 $(srcdir)/Makefile.in.old
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000128
129# +++ Dependency line eater +++
130#
131# Makefile dependencies follow. This must be the last section in
132# the Makefile.in file
133#
Theodore Ts'o96b5cac2001-12-24 15:33:49 -0500134debug_cmds.o: debug_cmds.c $(top_srcdir)/lib/ss/ss.h \
Theodore Ts'oa2146af2003-04-17 23:37:28 -0400135 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
Theodore Ts'o62c06f71997-04-29 14:34:47 +0000136debugfs.o: $(srcdir)/debugfs.c $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od3aea7d1999-09-14 20:55:37 +0000137 $(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400138 $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
139 $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
140 $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
141 $(top_builddir)/lib/ext2fs/ext2_err.h \
142 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
143 $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
144 $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
145 $(top_srcdir)/lib/ext2fs/kernel-list.h
Theodore Ts'odba838b1998-12-04 06:15:12 +0000146util.o: $(srcdir)/util.c $(srcdir)/debugfs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000147 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400148 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000149 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400150 $(top_builddir)/lib/ext2fs/ext2_err.h \
151 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400152ls.o: $(srcdir)/ls.c $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
153 $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400154 $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400155 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400156 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'odba838b1998-12-04 06:15:12 +0000157ncheck.o: $(srcdir)/ncheck.c $(srcdir)/debugfs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000158 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400159 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400160 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400161 $(top_builddir)/lib/ext2fs/ext2_err.h \
162 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o62c06f71997-04-29 14:34:47 +0000163icheck.o: $(srcdir)/icheck.c $(srcdir)/debugfs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000164 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400165 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400166 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400167 $(top_builddir)/lib/ext2fs/ext2_err.h \
168 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o62c06f71997-04-29 14:34:47 +0000169lsdel.o: $(srcdir)/lsdel.c $(srcdir)/debugfs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000170 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400171 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400172 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400173 $(top_builddir)/lib/ext2fs/ext2_err.h \
174 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o62c06f71997-04-29 14:34:47 +0000175dump.o: $(srcdir)/dump.c $(srcdir)/debugfs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000176 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400177 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400178 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400179 $(top_builddir)/lib/ext2fs/ext2_err.h \
180 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o7dec0502004-12-21 20:37:36 -0500181set_fields.o: $(srcdir)/set_fields.c $(srcdir)/debugfs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000182 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400183 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400184 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400185 $(top_builddir)/lib/ext2fs/ext2_err.h \
186 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
187 $(top_srcdir)/lib/e2p/e2p.h
Theodore Ts'o96b5cac2001-12-24 15:33:49 -0500188logdump.o: $(srcdir)/logdump.c $(srcdir)/debugfs.h \
189 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400190 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400191 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400192 $(top_builddir)/lib/ext2fs/ext2_err.h \
193 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400194 $(srcdir)/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400195 $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
Theodore Ts'o7380ac92002-03-05 01:57:53 -0500196htree.o: $(srcdir)/htree.c $(srcdir)/debugfs.h \
197 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400198 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400199 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400200 $(top_builddir)/lib/ext2fs/ext2_err.h \
201 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
202 $(top_srcdir)/lib/e2p/e2p.h
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400203unused.o: $(srcdir)/unused.c $(srcdir)/debugfs.h \
204 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400205 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400206 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
Theodore Ts'oe1f08502009-10-04 14:45:08 -0400207 $(top_builddir)/lib/ext2fs/ext2_err.h \
208 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h