6 top_srcdir = @top_srcdir@
11 LDFLAG_STATIC = @LDFLAG_STATIC@
17 XTRA_CFLAGS= -DRESOURCE_TRACK
19 LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBBLKID) $(LIBUUID)
20 DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBBLKID) $(DEPLIBUUID)
22 STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(STATIC_LIBBLKID) \
24 STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(STATIC_LIBBLKID) \
27 PROFILED_LIBS= $(PROFILED_LIBEXT2FS) $(PROFILED_LIBCOM_ERR) \
28 $(PROFILED_BLKID) $(PROFILED_LIBUUID)
29 PROFILED_DEPLIBS= $(PROFILED_LIBEXT2FS) $(PROFILED_LIBCOM_ERR) \
30 $(PROFILED_BLKID) $(DEPPROFILED_LIBUUID)
33 $(CC) -c $(ALL_CFLAGS) $< -o $@
34 @PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
37 # Flags for using Checker
38 # Note: The optimization flags must include -g
41 #LIBS= $(LIBCOM_ERR) $(LIB_EXT2FS) $(CHECKLIB)
42 #DEPLIBS= $(LIBCOM_ERR) $(LIB_EXT2FS)
43 #CHECKLIB= /usr/lib/libchecker.o
46 # Flags for doing mtrace --- uncomment to produce mtracing e2fsck
47 # Note: The optimization flags must include -g
51 #MTRACE_SRC= $(srcdir)/mtrace.c
55 # Flags for doing mcheck --- uncomment to produce mchecking e2fsck
56 # Note: The optimization flags must include -g
60 OBJS= dict.o unix.o e2fsck.o super.o pass1.o pass1b.o pass2.o pass3.o pass4.o \
61 pass5.o journal.o swapfs.o badblocks.o util.o dirinfo.o dx_dirinfo.o \
62 ehandler.o problem.o message.o recovery.o region.o revoke.o \
63 ea_refcount.o rehash.o $(MTRACE_OBJ)
65 PROFILED_OBJS= profiled/dict.o profiled/unix.o profiled/e2fsck.o \
66 profiled/super.o profiled/pass1.o profiled/pass1b.o \
67 profiled/pass2.o profiled/pass3.o profiled/pass4.o profiled/pass5.o \
68 profiled/journal.o profiled/badblocks.o profiled/util.o \
69 profiled/dirinfo.o profiled/dx_dirinfo.o profiled/ehandler.o \
70 profiled/message.o profiled/problem.o profiled/swapfs.o \
71 profiled/recovery.o profiled/region.o profiled/revoke.o \
72 profiled/ea_refcount.o profiled/rehash.o
74 SRCS= $(srcdir)/e2fsck.c \
84 $(srcdir)/recovery.c \
86 $(srcdir)/badblocks.c \
90 $(srcdir)/dx_dirinfo.c \
91 $(srcdir)/ehandler.c \
95 $(srcdir)/ea_refcount.c \
100 all:: profiled $(PROGS) e2fsck.static e2fsck.shared $(MANPAGES)
103 @PROFILE_CMT@all:: e2fsck.profiled
105 e2fsck: e2fsck.@E2FSCK_TYPE@
106 $(CP) e2fsck.@E2FSCK_TYPE@ e2fsck
108 e2fsck.static: $(OBJS) $(STATIC_DEPLIBS)
109 $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o e2fsck.static $(OBJS) \
112 e2fsck.shared: $(OBJS) $(DEPLIBS)
113 $(LD) $(ALL_LDFLAGS) -o e2fsck.shared $(OBJS) $(LIBS)
115 e2fsck.profiled: $(PROFILED_OBJS) $(PROFILED_DEPLIBS)
116 $(LD) $(ALL_LDFLAGS) -g -pg -o e2fsck.profiled $(PROFILED_OBJS) \
119 tst_refcount: ea_refcount.c
120 $(CC) -o tst_refcount $(srcdir)/ea_refcount.c \
121 $(ALL_CFLAGS) -DTEST_PROGRAM -lcom_err
124 $(CC) -o tst_region $(srcdir)/region.c \
125 $(ALL_CFLAGS) -DTEST_PROGRAM -lcom_err
128 $(LD) $(ALL_LDFLAGS) -o extend extend.o $(CHECKLIB)
131 $(LD) $(ALL_LDFLAGS) -o flushb flushb.o $(CHECKLIB)
133 iscan: iscan.o util.o ehandler.o $(DEPLIBS)
134 $(LD) $(ALL_LDFLAGS) -o iscan iscan.o util.o ehandler.o $(LIBS)
139 e2fsck.8: $(DEP_SUBSTITUTE) $(srcdir)/e2fsck.8.in
140 $(SUBSTITUTE) $(srcdir)/e2fsck.8.in e2fsck.8
143 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \
146 install: $(PROGS) $(MANPAGES) installdirs
147 for i in $(PROGS); do \
148 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
149 $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
151 $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
152 $(DESTDIR)$(root_sbindir)/fsck.ext2
153 $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
154 $(DESTDIR)$(root_sbindir)/fsck.ext3
155 for i in $(MANPAGES); do \
156 for j in $(COMPRESS_EXT); do \
157 $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
159 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
161 $(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 $(DESTDIR)$(man8dir)/fsck.ext2.8
162 $(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 $(DESTDIR)$(man8dir)/fsck.ext3.8
165 for i in $(PROGS); do \
166 $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
168 $(RM) -f $(DESTDIR)$(root_sbindir)/fsck.ext2 \
169 $(DESTDIR)$(root_sbindir)/fsck.ext3
170 for i in $(MANPAGES); do \
171 $(RM) -f $(DESTDIR)$(man8dir)/$$i; \
173 $(RM) -f $(DESTDIR)$(root_sbindir)/fsck.ext2 \
174 $(DESTDIR)$(root_sbindir)/fsck.ext3
177 $(RM) -f $(PROGS) \#* *\# *.s *.o *.a *~ core e2fsck.static \
178 e2fsck.shared e2fsck.profiled flushb e2fsck.8
183 $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
185 # +++ Dependency line eater +++
187 # Makefile dependencies follow. This must be the last section in
188 # the Makefile.in file
190 e2fsck.o: $(srcdir)/e2fsck.c $(srcdir)/e2fsck.h \
191 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
192 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
193 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
194 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
195 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
196 dict.o: $(srcdir)/dict.c $(srcdir)/dict.h
197 super.o: $(srcdir)/super.c $(top_srcdir)/lib/uuid/uuid.h $(srcdir)/e2fsck.h \
198 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
199 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
200 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
201 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
202 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
203 pass1.o: $(srcdir)/pass1.c $(srcdir)/e2fsck.h \
204 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
205 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
206 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
207 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
208 $(top_builddir)/lib/blkid/blkid_types.h \
209 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(srcdir)/problem.h
210 pass1b.o: $(srcdir)/pass1b.c $(top_srcdir)/lib/et/com_err.h \
211 $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
212 $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
213 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
214 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
215 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h $(srcdir)/dict.h
216 pass2.o: $(srcdir)/pass2.c $(srcdir)/e2fsck.h \
217 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
218 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
219 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
220 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
221 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h $(srcdir)/dict.h
222 pass3.o: $(srcdir)/pass3.c $(srcdir)/e2fsck.h \
223 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
224 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
225 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
226 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
227 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
228 pass4.o: $(srcdir)/pass4.c $(srcdir)/e2fsck.h \
229 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
230 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
231 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
232 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
233 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
234 pass5.o: $(srcdir)/pass5.c $(srcdir)/e2fsck.h \
235 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
236 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
237 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
238 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
239 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
240 journal.o: $(srcdir)/journal.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
241 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
242 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
243 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
244 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
245 $(top_builddir)/lib/blkid/blkid_types.h \
246 $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
247 $(top_srcdir)/lib/ext2fs/kernel-list.h $(srcdir)/problem.h \
248 $(top_srcdir)/lib/uuid/uuid.h
249 recovery.o: $(srcdir)/recovery.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
250 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
251 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
252 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
253 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
254 $(top_builddir)/lib/blkid/blkid_types.h \
255 $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
256 $(top_srcdir)/lib/ext2fs/kernel-list.h
257 revoke.o: $(srcdir)/revoke.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
258 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
259 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
260 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
261 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
262 $(top_builddir)/lib/blkid/blkid_types.h \
263 $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
264 $(top_srcdir)/lib/ext2fs/kernel-list.h
265 badblocks.o: $(srcdir)/badblocks.c $(top_srcdir)/lib/et/com_err.h \
266 $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
267 $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
268 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
269 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
270 $(top_builddir)/lib/blkid/blkid_types.h
271 util.o: $(srcdir)/util.c $(srcdir)/e2fsck.h \
272 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
273 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
274 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
275 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
276 $(top_builddir)/lib/blkid/blkid_types.h
277 unix.o: $(srcdir)/unix.c $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \
278 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
279 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
280 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
281 $(top_srcdir)/lib/blkid/blkid.h $(top_builddir)/lib/blkid/blkid_types.h \
282 $(srcdir)/problem.h $(top_srcdir)/version.h
283 dirinfo.o: $(srcdir)/dirinfo.c $(srcdir)/e2fsck.h \
284 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
285 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
286 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
287 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
288 $(top_builddir)/lib/blkid/blkid_types.h
289 dx_dirinfo.o: $(srcdir)/dx_dirinfo.c $(srcdir)/e2fsck.h \
290 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
291 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
292 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
293 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
294 $(top_builddir)/lib/blkid/blkid_types.h
295 ehandler.o: $(srcdir)/ehandler.c $(srcdir)/e2fsck.h \
296 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
297 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
298 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
299 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
300 $(top_builddir)/lib/blkid/blkid_types.h
301 problem.o: $(srcdir)/problem.c $(srcdir)/e2fsck.h \
302 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
303 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
304 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
305 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
306 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h \
308 message.o: $(srcdir)/message.c $(srcdir)/e2fsck.h \
309 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
310 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
311 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
312 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
313 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
314 swapfs.o: $(srcdir)/swapfs.c $(top_srcdir)/lib/et/com_err.h \
315 $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
316 $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
317 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
318 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
319 $(top_builddir)/lib/blkid/blkid_types.h
320 ea_refcount.o: $(srcdir)/ea_refcount.c $(srcdir)/e2fsck.h \
321 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
322 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
323 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
324 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
325 $(top_builddir)/lib/blkid/blkid_types.h
326 rehash.o: $(srcdir)/rehash.c $(srcdir)/e2fsck.h \
327 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
328 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
329 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
330 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
331 $(top_builddir)/lib/blkid/blkid_types.h $(srcdir)/problem.h
332 region.o: $(srcdir)/region.c $(srcdir)/e2fsck.h \
333 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
334 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
335 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
336 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/blkid/blkid.h \
337 $(top_builddir)/lib/blkid/blkid_types.h