1#
2# Standard e2fsprogs prologue....
3#
4
5srcdir = @srcdir@
6top_srcdir = @top_srcdir@
7VPATH = @srcdir@
8top_builddir = ..
9my_dir = resize
10INSTALL = @INSTALL@
11LDFLAG_STATIC = @LDFLAG_STATIC@
12
13@MCONFIG@
14
15PROGS=		resize2fs
16TEST_PROGS=	test_extent
17MANPAGES=	resize2fs.8
18
19RESIZE_OBJS= extent.o resize2fs.o main.o online.o resource_track.o \
20		sim_progress.o
21
22TEST_EXTENT_OBJS= extent.o test_extent.o
23
24SRCS= $(srcdir)/extent.c \
25	$(srcdir)/resize2fs.c \
26	$(srcdir)/main.c \
27	$(srcdir)/online.c \
28	$(srcdir)/resource_track.c \
29	$(srcdir)/sim_progress.c
30
31LIBS= $(LIBE2P) $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBINTL)
32DEPLIBS= $(LIBE2P) $(LIBEXT2FS) $(DEPLIBCOM_ERR)
33
34STATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) \
35	$(LIBINTL)
36DEPSTATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) 
37
38.c.o:
39	$(E) "	CC $<"
40	$(Q) $(CC) -c $(ALL_CFLAGS) $< -o $@
41	$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
42
43all:: $(PROGS) $(TEST_PROGS) $(MANPAGES) 
44
45resize2fs: $(RESIZE_OBJS) $(DEPLIBS)
46	$(E) "	LD $@"
47	$(Q) $(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS) 
48
49resize2fs.static: $(RESIZE_OBJS) $(DEPSTATIC_LIBS)
50	$(E) "	LD $@"
51	$(Q) $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \
52		$(RESIZE_OBJS) $(STATIC_LIBS) 
53
54resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
55	$(E) "	SUBST $@"
56	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/resize2fs.8.in resize2fs.8
57
58test_extent: $(TEST_EXTENT_OBJS)
59	$(E) "	LD $@"
60	$(Q) $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS) 
61
62installdirs:
63	$(E) "	MKINSTALLDIRS $(root_sbindir) $(man8dir)"
64	$(Q) $(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \
65		$(DESTDIR)$(man8dir)
66
67install: $(PROGS) $(MANPAGES) installdirs
68	$(Q) for i in $(PROGS); do \
69		echo "	INSTALL $(root_sbindir)/$$i"; \
70		$(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
71	done
72	$(Q) for i in $(MANPAGES); do \
73		for j in $(COMPRESS_EXT); do \
74			$(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
75		done; \
76		echo "	INSTALL_DATA $(man8dir)/$$i"; \
77		$(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
78	done
79
80install-strip: install
81	$(Q) for i in $(PROGS); do \
82		echo "	STRIP $(root_sbindir)/$$i"; \
83		$(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
84	done
85
86uninstall:
87	for i in $(PROGS); do \
88		$(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
89	done
90	for i in $(MANPAGES); do \
91		$(RM) -f $(DESTDIR)$(man8dir)/$$i; \
92	done
93
94test_extent.out: test_extent $(srcdir)/test_extent.in
95	LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./test_extent < $(srcdir)/test_extent.in \
96		> test_extent.out
97
98check:: test_extent.out
99	$(Q) if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \
100		echo "Test succeeded." ; \
101	else \
102		echo "Test failed!" ; \
103		diff test_extent.out $(srcdir)/test_extent.in ; \
104		exit 1 ; \
105	fi
106
107clean:
108	$(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
109		resize2fs.static test_extent.out
110
111mostlyclean: clean
112
113distclean: clean
114	$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
115
116#
117# Kludge to create a "special" e2fsprogs distribution file.
118#
119
120SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
121			-e 's/pre-//' -e 's/-PLUS//'`
122TAR=tar
123
124$(top_srcdir)/.exclude-file:
125	a=$(SRCROOT); \
126	(cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
127		-o -name CVS -o -name \*.rej \) -print) \
128		| sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file
129	echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file
130	echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file
131	echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file
132	echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file
133	echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
134		>> $(top_srcdir)/.exclude-file
135	echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \
136		>> $(top_srcdir)/.exclude-file
137
138source_tar_file: $(top_srcdir)/.exclude-file
139	(cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
140		$(TAR) -c -h -v -f - \
141			-X $$a/.exclude-file $$a | \
142		gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz)
143	rm -f $(top_srcdir)/.exclude-file
144
145# +++ Dependency line eater +++
146# 
147# Makefile dependencies follow.  This must be the last section in
148# the Makefile.in file
149#
150extent.o: $(srcdir)/extent.c $(top_builddir)/lib/config.h \
151 $(top_builddir)/lib/dirpaths.h $(srcdir)/resize2fs.h \
152 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
153 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
154 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
155 $(top_builddir)/lib/ext2fs/ext2_err.h \
156 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
157 $(top_srcdir)/lib/e2p/e2p.h
158resize2fs.o: $(srcdir)/resize2fs.c $(top_builddir)/lib/config.h \
159 $(top_builddir)/lib/dirpaths.h $(srcdir)/resize2fs.h \
160 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
161 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
162 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
163 $(top_builddir)/lib/ext2fs/ext2_err.h \
164 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
165 $(top_srcdir)/lib/e2p/e2p.h
166main.o: $(srcdir)/main.c $(top_builddir)/lib/config.h \
167 $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/e2p/e2p.h \
168 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
169 $(srcdir)/resize2fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
170 $(top_srcdir)/lib/ext2fs/ext3_extents.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/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
173 $(top_srcdir)/version.h
174online.o: $(srcdir)/online.c $(top_builddir)/lib/config.h \
175 $(top_builddir)/lib/dirpaths.h $(srcdir)/resize2fs.h \
176 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
177 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
178 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
179 $(top_builddir)/lib/ext2fs/ext2_err.h \
180 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
181 $(top_srcdir)/lib/e2p/e2p.h
182resource_track.o: $(srcdir)/resource_track.c $(top_builddir)/lib/config.h \
183 $(top_builddir)/lib/dirpaths.h $(srcdir)/resize2fs.h \
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/ext2fs/ext3_extents.h \
186 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
187 $(top_builddir)/lib/ext2fs/ext2_err.h \
188 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
189 $(top_srcdir)/lib/e2p/e2p.h
190sim_progress.o: $(srcdir)/sim_progress.c $(top_builddir)/lib/config.h \
191 $(top_builddir)/lib/dirpaths.h $(srcdir)/resize2fs.h \
192 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
193 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
194 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
195 $(top_builddir)/lib/ext2fs/ext2_err.h \
196 $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
197 $(top_srcdir)/lib/e2p/e2p.h
198