blob: deabd914ef5c3686c1221d41a6fb07e2a9e275b9 [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@
11
12@MCONFIG@
13
14PROGS= resize2fs
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000015TEST_PROGS= test_extent
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000016MANPAGES= resize2fs.8
17
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000018RESIZE_OBJS= extent.o ext2_block_move.o ext2_inode_move.o resize2fs.o \
19 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 \
24 $(srcdir)/ext2_block_move.c \
25 $(srcdir)/ext2_inode_move.c \
Theodore Ts'o052db4b1997-06-12 07:14:32 +000026 $(srcdir)/resize2fs.c \
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000027 $(srcdir)/main.c \
28 $(srcdir)/sim_progress.c
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000029
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000030LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBUUID)
31DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBUUID)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000032
33.c.o:
34 $(CC) -c $(ALL_CFLAGS) $< -o $@
35
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000036all:: $(PROGS) $(TEST_PROGS) $(MANPAGES)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000037
38resize2fs: $(RESIZE_OBJS) $(DEPLIBS)
39 $(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS)
40
Theodore Ts'o44339bd1997-10-15 02:47:20 +000041resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000042 $(SUBSTITUTE) $(srcdir)/resize2fs.8.in resize2fs.8
43
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000044test_extent: $(TEST_EXTENT_OBJS)
45 $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS)
46
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000047installdirs:
48 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(usbindir) \
49 $(DESTDIR)$(man8dir) $(DESTDIR)$(cat8dir)
50
51install: $(PROGS) $(MANPAGES) installdirs
52 for i in $(PROGS); do \
53 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(usbindir)/$$i; \
54 $(STRIP) $(DESTDIR)$(usbindir)/$$i; \
55 done
56 for i in $(MANPAGES); do \
57 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
58 done
59
60uninstall:
61 for i in $(PROGS); do \
62 $(RM) -f $(usbindir)/$$i; \
63 done
64 for i in $(MANPAGES); do \
65 $(RM) -f $(man8dir)/$$i; \
66 done
67
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000068test_extent.out: test_extent $(srcdir)/test_extent.in
69 ./test_extent < $(srcdir)/test_extent.in > test_extent.out
70
71check: test_extent.out
72 @if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \
73 echo "Test succeeded." ; \
74 else \
75 echo "Test failed!" ; \
76 diff test_extent.out $(srcdir)/test_extent.in ; \
77 exit 1 ; \
78 fi
79
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000080clean:
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000081 $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
82 test_extent.out
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000083
84mostlyclean: clean
85distclean: clean
86 $(RM) -f .depend Makefile
87
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000088#
89# Kludge to create a "special" e2fsprogs distribution file.
90#
91
92SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
93 -e 's/pre-//' -e 's/-PLUS//'`
94TAR=tar
95
96$(top_srcdir)/.exclude-file:
Theodore Ts'o8e74e661997-06-17 05:36:04 +000097 a=$(SRCROOT); \
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000098 (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o8e74e661997-06-17 05:36:04 +000099 -o -name CVS -o -name \*.rej \) -print) \
100 | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000101 echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file
102 echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file
103 echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file
104 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
105 >> $(top_srcdir)/.exclude-file
106
107source_tar_file: $(top_srcdir)/.exclude-file
108 (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
109 $(TAR) -c -h -v -f - \
110 -X $$a/.exclude-file $$a | \
111 gzip -9 > e2fsprogs-@E2FSPROGS_VERSION@.tar.gz)
112 rm -f $(top_srcdir)/.exclude-file
113
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000114# +++ Dependency line eater +++
115#
116# Makefile dependencies follow. This must be the last section in
117# the Makefile.in file
118#
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000119extent.o: $(srcdir)/extent.c $(srcdir)/resize2fs.h \
120 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od40259f1997-10-20 00:44:26 +0000121 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000122 $(top_srcdir)/lib/ext2fs/bitops.h
123ext2_block_move.o: $(srcdir)/ext2_block_move.c $(srcdir)/resize2fs.h \
124 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od40259f1997-10-20 00:44:26 +0000125 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000126 $(top_srcdir)/lib/ext2fs/bitops.h
127ext2_inode_move.o: $(srcdir)/ext2_inode_move.c $(srcdir)/resize2fs.h \
128 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od40259f1997-10-20 00:44:26 +0000129 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000130 $(top_srcdir)/lib/ext2fs/bitops.h
131resize2fs.o: $(srcdir)/resize2fs.c $(srcdir)/resize2fs.h \
132 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od40259f1997-10-20 00:44:26 +0000133 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000134 $(top_srcdir)/lib/ext2fs/bitops.h
135main.o: $(srcdir)/main.c $(srcdir)/resize2fs.h \
136 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od40259f1997-10-20 00:44:26 +0000137 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000138 $(top_srcdir)/lib/ext2fs/bitops.h
139sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \
140 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
Theodore Ts'od40259f1997-10-20 00:44:26 +0000141 $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000142 $(top_srcdir)/lib/ext2fs/bitops.h