2 # Standard e2fsprogs prologue....
6 top_srcdir = @top_srcdir@
11 LDFLAG_STATIC = @LDFLAG_STATIC@
16 TEST_PROGS= test_extent
19 RESIZE_OBJS= extent.o resize2fs.o main.o sim_progress.o
21 TEST_EXTENT_OBJS= extent.o test_extent.o
23 SRCS= $(srcdir)/extent.c \
24 $(srcdir)/resize2fs.c \
26 $(srcdir)/sim_progress.c
28 LIBS= $(LIBE2P) $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBINTL)
29 DEPLIBS= $(LIBE2P) $(LIBEXT2FS) $(LIBCOM_ERR)
31 STATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) \
33 STATIC_DEPLIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR)
37 @$(CC) -c $(ALL_CFLAGS) $< -o $@
39 all:: $(PROGS) $(TEST_PROGS) $(MANPAGES)
41 resize2fs: $(RESIZE_OBJS) $(DEPLIBS)
43 @$(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS)
45 resize2fs.static: $(RESIZE_OBJS) $(STATIC_DEPLIBS)
47 @$(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \
48 $(RESIZE_OBJS) $(STATIC_LIBS)
50 resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
52 @$(SUBSTITUTE_UPTIME) $(srcdir)/resize2fs.8.in resize2fs.8
54 test_extent: $(TEST_EXTENT_OBJS)
56 @$(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS)
59 @echo " MKINSTALLDIRS $(root_sbindir) $(man8dir)"
60 @$(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \
63 install: $(PROGS) $(MANPAGES) installdirs
64 @for i in $(PROGS); do \
65 echo " INSTALL $(root_sbindir)/$$i"; \
66 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
68 @for i in $(MANPAGES); do \
69 for j in $(COMPRESS_EXT); do \
70 $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
72 echo " INSTALL_DATA $(man8dir)/$$i"; \
73 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
76 install-strip: install
77 @for i in $(PROGS); do \
78 echo " STRIP $(root_sbindir)/$$i"; \
79 $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
83 for i in $(PROGS); do \
84 $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
86 for i in $(MANPAGES); do \
87 $(RM) -f $(DESTDIR)$(man8dir)/$$i; \
90 test_extent.out: test_extent $(srcdir)/test_extent.in
91 LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./test_extent < $(srcdir)/test_extent.in \
94 check:: test_extent.out
95 @if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \
96 echo "Test succeeded." ; \
98 echo "Test failed!" ; \
99 diff test_extent.out $(srcdir)/test_extent.in ; \
104 $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
105 resize2fs.static test_extent.out
110 $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
113 # Kludge to create a "special" e2fsprogs distribution file.
116 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
117 -e 's/pre-//' -e 's/-PLUS//'`
120 $(top_srcdir)/.exclude-file:
122 (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
123 -o -name CVS -o -name \*.rej \) -print) \
124 | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file
125 echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file
126 echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file
127 echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file
128 echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file
129 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
130 >> $(top_srcdir)/.exclude-file
131 echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \
132 >> $(top_srcdir)/.exclude-file
134 source_tar_file: $(top_srcdir)/.exclude-file
135 (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
136 $(TAR) -c -h -v -f - \
137 -X $$a/.exclude-file $$a | \
138 gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz)
139 rm -f $(top_srcdir)/.exclude-file
141 # +++ Dependency line eater +++
143 # Makefile dependencies follow. This must be the last section in
144 # the Makefile.in file
146 extent.o: $(srcdir)/extent.c $(srcdir)/resize2fs.h \
147 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
148 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
149 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
150 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h
151 resize2fs.o: $(srcdir)/resize2fs.c $(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/ext2_fs.h \
154 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
155 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h
156 main.o: $(srcdir)/main.c $(top_srcdir)/lib/e2p/e2p.h \
157 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
158 $(srcdir)/resize2fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
159 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
160 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
161 $(top_srcdir)/version.h
162 sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \
163 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
164 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
165 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
166 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h