]>
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 = .. | |
9 | INSTALL = @INSTALL@ | |
10 | LDFLAG_STATIC = @LDFLAG_STATIC@ | |
11 | ||
12 | @MCONFIG@ | |
13 | ||
14 | PROGS= e2fsck extend @EXTRA_PROGS@ | |
15 | MANPAGES= e2fsck.8 | |
16 | ||
62c06f79 TT |
17 | LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) |
18 | DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR) | |
19 | ||
20 | STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) | |
21 | STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) | |
22 | ||
23 | PROFILED_LIBS= $(PROFILED_LIBEXT2FS) $(PROFILED_LIBCOM_ERR) | |
24 | PROFILED_DEPLIBS= $(PROFILED_LIBEXT2FS) $(PROFILED_LIBCOM_ERR) | |
50e1e10f TT |
25 | |
26 | .c.o: | |
74becf3c | 27 | $(CC) -c $(ALL_CFLAGS) $< -o $@ |
62c06f79 | 28 | @PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -pg -o profiled/$*.o -c $< |
50e1e10f TT |
29 | |
30 | # | |
31 | # Flags for using Checker | |
32 | # Note: The optimization flags must include -g | |
33 | # | |
34 | #MCHECK= -checker | |
62c06f79 TT |
35 | #LIBS= $(LIBCOM_ERR) $(LIB_EXT2FS) $(CHECKLIB) |
36 | #DEPLIBS= $(LIBCOM_ERR) $(LIB_EXT2FS) | |
50e1e10f TT |
37 | #CHECKLIB= /usr/lib/libchecker.o |
38 | ||
39 | # | |
40 | # Flags for doing mtrace --- uncomment to produce mtracing e2fsck | |
41 | # Note: The optimization flags must include -g | |
42 | # | |
43 | #MTRACE= -DMTRACE | |
44 | #MTRACE_OBJ= mtrace.o | |
45 | #MTRACE_SRC= $(srcdir)/mtrace.c | |
46 | #OPT= -g | |
47 | ||
48 | # | |
49 | # Flags for doing mcheck --- uncomment to produce mchecking e2fsck | |
50 | # Note: The optimization flags must include -g | |
51 | # | |
52 | #MCHECK= -DMCHECK | |
53 | ||
50e1e10f TT |
54 | OBJS= e2fsck.o pass1.o pass1b.o pass2.o pass3.o pass4.o pass5.o \ |
55 | badblocks.o util.o dirinfo.o ehandler.o $(MTRACE_OBJ) | |
56 | ||
62c06f79 TT |
57 | PROFILED_OBJS= profiled/e2fsck.o profiled/pass1.o profiled/pass1b.o \ |
58 | profiled/pass2.o profiled/pass3.o profiled/pass4.o profiled/pass5.o \ | |
59 | profiled/badblocks.o profiled/util.o profiled/dirinfo.o \ | |
60 | profiled/ehandler.o | |
61 | ||
50e1e10f TT |
62 | SRCS= $(srcdir)/e2fsck.c \ |
63 | $(srcdir)/pass1.c \ | |
64 | $(srcdir)/pass1b.c \ | |
65 | $(srcdir)/pass2.c \ | |
66 | $(srcdir)/pass3.c \ | |
67 | $(srcdir)/pass4.c \ | |
68 | $(srcdir)/pass5.c \ | |
69 | $(srcdir)/badblocks.c \ | |
70 | $(srcdir)/util.c \ | |
71 | $(srcdir)/dirinfo.c \ | |
72 | $(srcdir)/ehandler.c \ | |
73 | $(MTRACE_SRC) | |
74 | ||
62c06f79 | 75 | all:: profiled $(PROGS) e2fsck.static e2fsck.shared |
50e1e10f | 76 | |
62c06f79 TT |
77 | @PROFILE_CMT@all:: e2fsck.profiled |
78 | ||
79 | e2fsck: e2fsck.@E2FSCK_TYPE@ | |
80 | $(CP) e2fsck.@E2FSCK_TYPE@ e2fsck | |
81 | ||
82 | e2fsck.static: $(OBJS) $(STATIC_DEPLIBS) | |
83 | $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o e2fsck.static $(OBJS) \ | |
84 | $(STATIC_LIBS) | |
85 | ||
86 | e2fsck.shared: $(OBJS) $(DEPLIBS) | |
87 | $(LD) $(ALL_LDFLAGS) -o e2fsck.shared $(OBJS) $(LIBS) | |
88 | ||
89 | e2fsck.profiled: $(PROFILED_OBJS) $(DEPLIBS) | |
90 | $(LD) $(ALL_LDFLAGS) -pg -o e2fsck.profiled $(PROFILED_OBJS) \ | |
91 | $(PROFILED_LIBS) | |
50e1e10f TT |
92 | |
93 | extend: extend.o | |
74becf3c | 94 | $(LD) $(ALL_LDFLAGS) -o extend extend.o $(CHECKLIB) |
50e1e10f TT |
95 | |
96 | flushb: flushb.o | |
74becf3c | 97 | $(LD) $(ALL_LDFLAGS) -o flushb flushb.o $(CHECKLIB) |
50e1e10f TT |
98 | |
99 | iscan: iscan.o util.o | |
74becf3c | 100 | $(LD) $(ALL_LDFLAGS) -o iscan iscan.o util.o ehandler.o $(LIBS) |
50e1e10f | 101 | |
62c06f79 TT |
102 | profiled: |
103 | mkdir profiled | |
104 | ||
105 | e2fsck.8: $(SUBSTITUTE) $(srcdir)/e2fsck.8.in | |
106 | -$(CHMOD) +x $(SUBSTITUTE) | |
107 | $(SUBSTITUTE) $(srcdir)/e2fsck.8.in e2fsck.8 | |
50e1e10f TT |
108 | |
109 | installdirs: | |
110 | $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) \ | |
111 | $(DESTDIR)$(cat8dir) | |
112 | ||
113 | install: $(PROGS) $(MANPAGES) installdirs | |
114 | for i in $(PROGS); do \ | |
115 | $(INSTALL_PROGRAM) $$i $(DESTDIR)$(sbindir)/$$i; \ | |
116 | $(STRIP) $(DESTDIR)$(sbindir)/$$i; \ | |
117 | done | |
118 | $(LN) -f $(DESTDIR)$(sbindir)/e2fsck $(DESTDIR)$(sbindir)/fsck.ext2 | |
119 | for i in $(MANPAGES); do \ | |
74becf3c | 120 | $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \ |
50e1e10f | 121 | done |
74becf3c | 122 | |
50e1e10f TT |
123 | uninstall: |
124 | $(RM) -f $(sbindir)/e2fsck | |
125 | $(RM) -f $(sbindir)/flushb | |
126 | $(RM) -f $(sbindir)/fsck.ext2 | |
127 | for i in $(MANPAGES); do \ | |
128 | $(RM) -f $(man8dir)/$$i; \ | |
129 | done | |
130 | ||
131 | clean: | |
62c06f79 TT |
132 | $(RM) -f $(PROGS) \#* *\# *.s *.o *.a *~ core e2fsck.static \ |
133 | e2fsck.shared e2fsck.profiled e2fsck.8 | |
134 | $(RM) -rf profiled | |
135 | ||
50e1e10f TT |
136 | mostlyclean: clean |
137 | distclean: clean | |
138 | $(RM) -f .depend Makefile | |
139 | ||
140 | # +++ Dependency line eater +++ | |
141 | # | |
142 | # Makefile dependencies follow. This must be the last section in | |
143 | # the Makefile.in file | |
144 | # | |
62c06f79 TT |
145 | e2fsck.o: $(srcdir)/e2fsck.c \ |
146 | $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \ | |
147 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/io.h \ | |
148 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \ | |
149 | $(srcdir)/../version.h | |
150 | pass1.o: $(srcdir)/pass1.c $(top_srcdir)/lib/et/com_err.h \ | |
151 | $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ | |
152 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
153 | $(top_srcdir)/lib/ext2fs/bitops.h | |
154 | pass1b.o: $(srcdir)/pass1b.c \ | |
155 | $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \ | |
156 | $(top_srcdir)/lib/ext2fs/ext2fs.h \ | |
157 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
158 | $(top_srcdir)/lib/ext2fs/bitops.h | |
159 | pass2.o: $(srcdir)/pass2.c $(top_srcdir)/lib/et/com_err.h \ | |
160 | $(srcdir)/e2fsck.h \ | |
161 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/io.h \ | |
162 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h | |
163 | pass3.o: $(srcdir)/pass3.c \ | |
164 | $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \ | |
165 | $(top_srcdir)/lib/ext2fs/ext2fs.h \ | |
166 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
167 | $(top_srcdir)/lib/ext2fs/bitops.h | |
168 | pass4.o: $(srcdir)/pass4.c $(srcdir)/e2fsck.h \ | |
169 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
170 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
171 | $(top_srcdir)/lib/ext2fs/bitops.h | |
172 | pass5.o: $(srcdir)/pass5.c $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \ | |
173 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/io.h \ | |
174 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h | |
175 | badblocks.o: $(srcdir)/badblocks.c \ | |
176 | $(top_srcdir)/lib/et/com_err.h $(srcdir)/e2fsck.h \ | |
177 | $(top_srcdir)/lib/ext2fs/ext2fs.h \ | |
178 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
179 | $(top_srcdir)/lib/ext2fs/bitops.h | |
180 | util.o: $(srcdir)/util.c $(srcdir)/e2fsck.h \ | |
181 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
182 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
183 | $(top_srcdir)/lib/ext2fs/bitops.h | |
184 | dirinfo.o: $(srcdir)/dirinfo.c $(top_srcdir)/lib/et/com_err.h \ | |
185 | $(srcdir)/e2fsck.h \ | |
186 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/io.h \ | |
187 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h | |
188 | ehandler.o: $(srcdir)/ehandler.c \ | |
189 | $(srcdir)/e2fsck.h \ | |
190 | $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ | |
191 | $(top_srcdir)/lib/ext2fs/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ | |
192 | $(top_srcdir)/lib/ext2fs/bitops.h | |
193 | ||
50e1e10f | 194 |