blob: 3ad2cebe245f2d8b6c1bb2ce09bdb94a9cfecb39 [file] [log] [blame]
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +00001#
2# Standard e2fsprogs prologue....
3#
4
5srcdir = @srcdir@
6top_srcdir = @top_srcdir@
7VPATH = @srcdir@
8top_builddir = ..
9my_dir = resize
10INSTALL = @INSTALL@
Theodore Ts'o0e14f781998-02-27 06:04:23 +000011LDFLAG_STATIC = @LDFLAG_STATIC@
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000012
13@MCONFIG@
14
15PROGS= resize2fs
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000016TEST_PROGS= test_extent
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000017MANPAGES= resize2fs.8
18
Theodore Ts'oa8519a21998-02-16 22:16:20 +000019RESIZE_OBJS= extent.o resize2fs.o main.o sim_progress.o
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000020
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000021TEST_EXTENT_OBJS= extent.o test_extent.o
22
23SRCS= $(srcdir)/extent.c \
Theodore Ts'o052db4b1997-06-12 07:14:32 +000024 $(srcdir)/resize2fs.c \
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000025 $(srcdir)/main.c \
26 $(srcdir)/sim_progress.c
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000027
Theodore Ts'ofac9c201998-03-07 23:36:45 +000028LIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
29DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000030
Theodore Ts'ofac9c201998-03-07 23:36:45 +000031STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR)
32STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR)
Theodore Ts'o0e14f781998-02-27 06:04:23 +000033
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000034.c.o:
35 $(CC) -c $(ALL_CFLAGS) $< -o $@
36
Theodore Ts'o0cee8a52000-04-06 21:38:34 +000037all:: $(PROGS) $(TEST_PROGS) $(MANPAGES)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000038
39resize2fs: $(RESIZE_OBJS) $(DEPLIBS)
40 $(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS)
41
Theodore Ts'o0e14f781998-02-27 06:04:23 +000042resize2fs.static: $(RESIZE_OBJS) $(STATIC_DEPLIBS)
43 $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \
44 $(RESIZE_OBJS) $(STATIC_LIBS)
45
Theodore Ts'o44339bd1997-10-15 02:47:20 +000046resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000047 $(SUBSTITUTE) $(srcdir)/resize2fs.8.in resize2fs.8
48
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000049test_extent: $(TEST_EXTENT_OBJS)
50 $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS)
51
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000052installdirs:
Theodore Ts'oe4c8e882000-07-05 23:54:46 +000053 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \
Theodore Ts'od171c5b1998-04-03 16:07:06 +000054 $(DESTDIR)$(man8dir)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000055
56install: $(PROGS) $(MANPAGES) installdirs
57 for i in $(PROGS); do \
Theodore Ts'oe4c8e882000-07-05 23:54:46 +000058 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
59 $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000060 done
61 for i in $(MANPAGES); do \
Theodore Ts'o482afc42002-10-31 03:32:34 -050062 for j in $(COMPRESS_EXT); do \
63 $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
64 done; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000065 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
66 done
67
68uninstall:
69 for i in $(PROGS); do \
Theodore Ts'oe4c8e882000-07-05 23:54:46 +000070 $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000071 done
72 for i in $(MANPAGES); do \
Theodore Ts'od171c5b1998-04-03 16:07:06 +000073 $(RM) -f $(DESTDIR)$(man8dir)/$$i; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000074 done
75
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000076test_extent.out: test_extent $(srcdir)/test_extent.in
Theodore Ts'o304905d2002-03-07 20:55:01 -050077 LD_LIBRARY_PATH=$(LIB) ./test_extent < $(srcdir)/test_extent.in \
78 > test_extent.out
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000079
Theodore Ts'o3e377db2000-12-09 02:37:33 +000080check:: test_extent.out
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000081 @if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \
82 echo "Test succeeded." ; \
83 else \
84 echo "Test failed!" ; \
85 diff test_extent.out $(srcdir)/test_extent.in ; \
86 exit 1 ; \
87 fi
88
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000089clean:
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000090 $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
Theodore Ts'o790a0ad41999-07-19 16:16:12 +000091 resize2fs.static test_extent.out
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000092
93mostlyclean: clean
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +000094
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000095distclean: clean
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +000096 $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000097
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000098#
99# Kludge to create a "special" e2fsprogs distribution file.
100#
101
102SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
103 -e 's/pre-//' -e 's/-PLUS//'`
104TAR=tar
105
106$(top_srcdir)/.exclude-file:
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000107 a=$(SRCROOT); \
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000108 (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000109 -o -name CVS -o -name \*.rej \) -print) \
110 | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000111 echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file
112 echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file
Theodore Ts'ofac9c201998-03-07 23:36:45 +0000113 echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000114 echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file
115 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
116 >> $(top_srcdir)/.exclude-file
Theodore Ts'ofac9c201998-03-07 23:36:45 +0000117 echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \
118 >> $(top_srcdir)/.exclude-file
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000119
120source_tar_file: $(top_srcdir)/.exclude-file
121 (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
122 $(TAR) -c -h -v -f - \
123 -X $$a/.exclude-file $$a | \
Theodore Ts'ofac9c201998-03-07 23:36:45 +0000124 gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz)
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000125 rm -f $(top_srcdir)/.exclude-file
126
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000127# +++ Dependency line eater +++
128#
129# Makefile dependencies follow. This must be the last section in
130# the Makefile.in file
131#
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000132extent.o: $(srcdir)/extent.c $(srcdir)/resize2fs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000133 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
134 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
135 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
136 $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000137resize2fs.o: $(srcdir)/resize2fs.c $(srcdir)/resize2fs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000138 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
139 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
140 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
141 $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000142main.o: $(srcdir)/main.c $(srcdir)/resize2fs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000143 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
144 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
145 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
146 $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/version.h
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000147sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000148 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
149 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
150 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
151 $(top_srcdir)/lib/ext2fs/bitops.h