]>
Commit | Line | Data |
---|---|---|
50e1e10f TT |
1 | # |
2 | # Makefile for e2fsck | |
3 | # | |
4 | ||
5 | srcdir = @srcdir@ | |
6 | top_srcdir = @top_srcdir@ | |
7 | VPATH = @srcdir@ | |
8 | top_builddir = .. | |
1e3472c5 | 9 | my_dir = e2fsck |
50e1e10f TT |
10 | INSTALL = @INSTALL@ |
11 | LDFLAG_STATIC = @LDFLAG_STATIC@ | |
12 | ||
13 | @MCONFIG@ | |
14 | ||
5be8dc21 | 15 | PROGS= e2fsck |
50e1e10f | 16 | MANPAGES= e2fsck.8 |
8bf191e8 | 17 | XTRA_CFLAGS= -DRESOURCE_TRACK |
50e1e10f | 18 | |
1e3472c5 | 19 | LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBUUID) |
894edb2e | 20 | DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(DEPLIBUUID) |
62c06f79 | 21 | |
1e3472c5 | 22 | STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(STATIC_LIBUUID) |
894edb2e | 23 | STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(DEPSTATIC_LIBUUID) |
62c06f79 | 24 | |
1e3472c5 | 25 | PROFILED_LIBS= $(PROFILED_LIBEXT2FS) $(PROFILED_LIBCOM_ERR) $(PROFILED_LIBUUID) |
894edb2e TT |
26 | PROFILED_DEPLIBS= $(PROFILED_LIBEXT2FS) $(PROFILED_LIBCOM_ERR) \ |
27 | $(DEPPROFILED_LIBUUID) | |
50e1e10f TT |
28 | |
29 | .c.o: | |
74becf3c | 30 | $(CC) -c $(ALL_CFLAGS) $< -o $@ |
21c84b71 | 31 | @PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $< |
50e1e10f TT |
32 | |
33 | # | |
34 | # Flags for using Checker | |
35 | # Note: The optimization flags must include -g | |
36 | # | |
37 | #MCHECK= -checker | |
62c06f79 TT |
38 | #LIBS= $(LIBCOM_ERR) $(LIB_EXT2FS) $(CHECKLIB) |
39 | #DEPLIBS= $(LIBCOM_ERR) $(LIB_EXT2FS) | |
50e1e10f TT |
40 | #CHECKLIB= /usr/lib/libchecker.o |
41 | ||
42 | # | |
43 | # Flags for doing mtrace --- uncomment to produce mtracing e2fsck | |
44 | # Note: The optimization flags must include -g | |
45 | # | |
46 | #MTRACE= -DMTRACE | |
47 | #MTRACE_OBJ= mtrace.o | |
48 | #MTRACE_SRC= $(srcdir)/mtrace.c | |
49 | #OPT= -g | |
50 | ||
51 | # | |
52 | # Flags for doing mcheck --- uncomment to produce mchecking e2fsck | |
53 | # Note: The optimization flags must include -g | |
54 | # | |
55 | #MCHECK= -DMCHECK | |
56 | ||
1b6bf175 | 57 | OBJS= unix.o e2fsck.o super.o pass1.o pass1b.o pass2.o pass3.o pass4.o \ |
17390c04 | 58 | pass5.o journal.o swapfs.o badblocks.o util.o dirinfo.o ehandler.o \ |
0e8a9560 | 59 | problem.o message.o recovery.o revoke.o $(MTRACE_OBJ) |
50e1e10f | 60 | |
1b6bf175 TT |
61 | PROFILED_OBJS= profiled/unix.o profiled/e2fsck.o profiled/super.o \ |
62 | profiled/pass1.o profiled/pass1b.o \ | |
62c06f79 | 63 | profiled/pass2.o profiled/pass3.o profiled/pass4.o profiled/pass5.o \ |
17390c04 TT |
64 | profiled/journal.o profiled/badblocks.o profiled/util.o \ |
65 | profiled/dirinfo.o profiled/ehandler.o profiled/message.o \ | |
0e8a9560 TT |
66 | profiled/problem.o profiled/swapfs.o profiled/recovery.o \ |
67 | profiled/revoke.o | |
62c06f79 | 68 | |
50e1e10f | 69 | SRCS= $(srcdir)/e2fsck.c \ |
1b6bf175 | 70 | $(srcdir)/super.c \ |
50e1e10f TT |
71 | $(srcdir)/pass1.c \ |
72 | $(srcdir)/pass1b.c \ | |
73 | $(srcdir)/pass2.c \ | |
74 | $(srcdir)/pass3.c \ | |
75 | $(srcdir)/pass4.c \ | |
76 | $(srcdir)/pass5.c \ | |
17390c04 | 77 | $(srcdir)/journal.c \ |
3b5386dc | 78 | $(srcdir)/recovery.c \ |
0e8a9560 | 79 | $(srcdir)/revoke.c \ |
50e1e10f TT |
80 | $(srcdir)/badblocks.c \ |
81 | $(srcdir)/util.c \ | |
1b6bf175 | 82 | $(srcdir)/unix.c \ |
50e1e10f TT |
83 | $(srcdir)/dirinfo.c \ |
84 | $(srcdir)/ehandler.c \ | |
21c84b71 | 85 | $(srcdir)/problem.c \ |
50e1e10f TT |
86 | $(MTRACE_SRC) |
87 | ||
1e3472c5 | 88 | all:: profiled $(PROGS) e2fsck.static e2fsck.shared $(MANPAGES) |
28ffafb0 | 89 | @sync |
50e1e10f | 90 | |
62c06f79 TT |
91 | @PROFILE_CMT@all:: e2fsck.profiled |
92 | ||
93 | e2fsck: e2fsck.@E2FSCK_TYPE@ | |
94 | $(CP) e2fsck.@E2FSCK_TYPE@ e2fsck | |
95 | ||
96 | e2fsck.static: $(OBJS) $(STATIC_DEPLIBS) | |
97 | $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o e2fsck.static $(OBJS) \ | |
98 | $(STATIC_LIBS) | |
99 | ||
100 | e2fsck.shared: $(OBJS) $(DEPLIBS) | |
101 | $(LD) $(ALL_LDFLAGS) -o e2fsck.shared $(OBJS) $(LIBS) | |
102 | ||
21c84b71 TT |
103 | e2fsck.profiled: $(PROFILED_OBJS) $(PROFILED_DEPLIBS) |
104 | $(LD) $(ALL_LDFLAGS) -g -pg -o e2fsck.profiled $(PROFILED_OBJS) \ | |
62c06f79 | 105 | $(PROFILED_LIBS) |
50e1e10f TT |
106 | |
107 | extend: extend.o | |
74becf3c | 108 | $(LD) $(ALL_LDFLAGS) -o extend extend.o $(CHECKLIB) |
50e1e10f TT |
109 | |
110 | flushb: flushb.o | |
74becf3c | 111 | $(LD) $(ALL_LDFLAGS) -o flushb flushb.o $(CHECKLIB) |
50e1e10f TT |
112 | |
113 | iscan: iscan.o util.o | |
74becf3c | 114 | $(LD) $(ALL_LDFLAGS) -o iscan iscan.o util.o ehandler.o $(LIBS) |
50e1e10f | 115 | |
62c06f79 TT |
116 | profiled: |
117 | mkdir profiled | |
118 | ||
44339bdf | 119 | e2fsck.8: $(DEP_SUBSTITUTE) $(srcdir)/e2fsck.8.in |
62c06f79 | 120 | $(SUBSTITUTE) $(srcdir)/e2fsck.8.in e2fsck.8 |
50e1e10f TT |
121 | |
122 | installdirs: | |
7e44f242 TT |
123 | $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \ |
124 | $(DESTDIR)$(man8dir) | |
50e1e10f TT |
125 | |
126 | install: $(PROGS) $(MANPAGES) installdirs | |
127 | for i in $(PROGS); do \ | |
7e44f242 TT |
128 | $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \ |
129 | $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \ | |
50e1e10f | 130 | done |
7e44f242 TT |
131 | $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \ |
132 | $(DESTDIR)$(root_sbindir)/fsck.ext2 | |
1d279218 TT |
133 | $(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \ |
134 | $(DESTDIR)$(root_sbindir)/fsck.ext3 | |
50e1e10f | 135 | for i in $(MANPAGES); do \ |
74becf3c | 136 | $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \ |
50e1e10f | 137 | done |
74becf3c | 138 | |
50e1e10f | 139 | uninstall: |
21c84b71 | 140 | for i in $(PROGS); do \ |
7e44f242 | 141 | $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \ |
21c84b71 | 142 | done |
1d279218 TT |
143 | $(RM) -f $(DESTDIR)$(root_sbindir)/fsck.ext2 \ |
144 | $(DESTDIR)$(root_sbindir)/fsck.ext3 | |
50e1e10f | 145 | for i in $(MANPAGES); do \ |
7e44f242 | 146 | $(RM) -f $(DESTDIR)$(man8dir)/$$i; \ |
50e1e10f TT |
147 | done |
148 | ||
149 | clean: | |
62c06f79 | 150 | $(RM) -f $(PROGS) \#* *\# *.s *.o *.a *~ core e2fsck.static \ |
3ac9f0ef | 151 | e2fsck.shared e2fsck.profiled flushb e2fsck.8 |
62c06f79 TT |
152 | $(RM) -rf profiled |
153 | ||
50e1e10f TT |
154 | mostlyclean: clean |
155 | distclean: clean | |
5c36a2f8 | 156 | $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old |
50e1e10f TT |
157 | |
158 | # +++ Dependency line eater +++ | |
159 | # | |
160 | # Makefile dependencies follow. This must be the last section in | |
161 | # the Makefile.in file | |
162 | # | |
80bfaa3e | 163 | e2fsck.o: $(srcdir)/e2fsck.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
164 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
165 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
166 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
167 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
08b21301 | 168 | super.o: $(srcdir)/super.c $(top_srcdir)/lib/uuid/uuid.h $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
169 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
170 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
171 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
172 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
80bfaa3e | 173 | pass1.o: $(srcdir)/pass1.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
174 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
175 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
176 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
177 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
a29f4d30 | 178 | pass1b.o: $(srcdir)/pass1b.c $(top_srcdir)/lib/et/com_err.h \ |
54c637d4 | 179 | $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \ |
797f5ef1 TT |
180 | $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ |
181 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
182 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
5a679c8f | 183 | pass2.o: $(srcdir)/pass2.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
184 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
185 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
186 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
187 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
08b21301 | 188 | pass3.o: $(srcdir)/pass3.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
189 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
190 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
191 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
192 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
62c06f79 | 193 | pass4.o: $(srcdir)/pass4.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
194 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
195 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
196 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
197 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
08b21301 | 198 | pass5.o: $(srcdir)/pass5.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
199 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
200 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
201 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
202 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h | |
0e8a9560 | 203 | journal.o: $(srcdir)/journal.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
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)/include/linux/jfs.h \ | |
208 | $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h \ | |
209 | $(srcdir)/problem.h $(top_srcdir)/lib/uuid/uuid.h | |
0e8a9560 | 210 | recovery.o: $(srcdir)/recovery.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
211 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
212 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.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)/include/linux/jfs.h \ | |
215 | $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h | |
0e8a9560 | 216 | revoke.o: $(srcdir)/revoke.c $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
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)/include/linux/jfs.h \ | |
221 | $(top_srcdir)/include/linux/jfs_compat.h $(top_srcdir)/include/linux/list.h | |
80bfaa3e | 222 | badblocks.o: $(srcdir)/badblocks.c $(top_srcdir)/lib/et/com_err.h \ |
54c637d4 | 223 | $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \ |
797f5ef1 TT |
224 | $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ |
225 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
226 | $(top_srcdir)/lib/ext2fs/bitops.h | |
80bfaa3e | 227 | util.o: $(srcdir)/util.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
228 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
229 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
d40259fd | 230 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ |
797f5ef1 TT |
231 | $(top_srcdir)/lib/ext2fs/bitops.h |
232 | unix.o: $(srcdir)/unix.c $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \ | |
233 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ | |
234 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ | |
235 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \ | |
236 | $(srcdir)/problem.h $(top_srcdir)/version.h | |
80bfaa3e | 237 | dirinfo.o: $(srcdir)/dirinfo.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
238 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
239 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
240 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
241 | $(top_srcdir)/lib/ext2fs/bitops.h | |
a29f4d30 | 242 | ehandler.o: $(srcdir)/ehandler.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
243 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
244 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
245 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
246 | $(top_srcdir)/lib/ext2fs/bitops.h | |
a29f4d30 | 247 | problem.o: $(srcdir)/problem.c $(srcdir)/e2fsck.h \ |
797f5ef1 TT |
248 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
249 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
250 | $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
251 | $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/problem.h $(srcdir)/problemP.h |