Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 1 | # |
| 2 | # Standard e2fsprogs prologue.... |
| 3 | # |
| 4 | |
| 5 | srcdir = @srcdir@ |
| 6 | top_srcdir = @top_srcdir@ |
| 7 | VPATH = @srcdir@ |
| 8 | top_builddir = .. |
| 9 | my_dir = resize |
| 10 | INSTALL = @INSTALL@ |
Theodore Ts'o | 0e14f78 | 1998-02-27 06:04:23 +0000 | [diff] [blame] | 11 | LDFLAG_STATIC = @LDFLAG_STATIC@ |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 12 | |
| 13 | @MCONFIG@ |
| 14 | |
| 15 | PROGS= resize2fs |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 16 | TEST_PROGS= test_extent |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 17 | MANPAGES= resize2fs.8 |
| 18 | |
Theodore Ts'o | a8519a2 | 1998-02-16 22:16:20 +0000 | [diff] [blame] | 19 | RESIZE_OBJS= extent.o resize2fs.o main.o sim_progress.o |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 20 | |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 21 | TEST_EXTENT_OBJS= extent.o test_extent.o |
| 22 | |
| 23 | SRCS= $(srcdir)/extent.c \ |
Theodore Ts'o | 052db4b | 1997-06-12 07:14:32 +0000 | [diff] [blame] | 24 | $(srcdir)/resize2fs.c \ |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 25 | $(srcdir)/main.c \ |
| 26 | $(srcdir)/sim_progress.c |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 27 | |
Theodore Ts'o | fac9c20 | 1998-03-07 23:36:45 +0000 | [diff] [blame] | 28 | LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) |
| 29 | DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR) |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 30 | |
Theodore Ts'o | fac9c20 | 1998-03-07 23:36:45 +0000 | [diff] [blame] | 31 | STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) |
| 32 | STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) |
Theodore Ts'o | 0e14f78 | 1998-02-27 06:04:23 +0000 | [diff] [blame] | 33 | |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 34 | .c.o: |
| 35 | $(CC) -c $(ALL_CFLAGS) $< -o $@ |
| 36 | |
Theodore Ts'o | 0cee8a5 | 2000-04-06 21:38:34 +0000 | [diff] [blame] | 37 | all:: $(PROGS) $(TEST_PROGS) $(MANPAGES) |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 38 | |
| 39 | resize2fs: $(RESIZE_OBJS) $(DEPLIBS) |
| 40 | $(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS) |
| 41 | |
Theodore Ts'o | 0e14f78 | 1998-02-27 06:04:23 +0000 | [diff] [blame] | 42 | resize2fs.static: $(RESIZE_OBJS) $(STATIC_DEPLIBS) |
| 43 | $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \ |
| 44 | $(RESIZE_OBJS) $(STATIC_LIBS) |
| 45 | |
Theodore Ts'o | 44339bd | 1997-10-15 02:47:20 +0000 | [diff] [blame] | 46 | resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 47 | $(SUBSTITUTE) $(srcdir)/resize2fs.8.in resize2fs.8 |
| 48 | |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 49 | test_extent: $(TEST_EXTENT_OBJS) |
| 50 | $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS) |
| 51 | |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 52 | installdirs: |
Theodore Ts'o | d171c5b | 1998-04-03 16:07:06 +0000 | [diff] [blame] | 53 | $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) \ |
| 54 | $(DESTDIR)$(man8dir) |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 55 | |
| 56 | install: $(PROGS) $(MANPAGES) installdirs |
| 57 | for i in $(PROGS); do \ |
Theodore Ts'o | d171c5b | 1998-04-03 16:07:06 +0000 | [diff] [blame] | 58 | $(INSTALL_PROGRAM) $$i $(DESTDIR)$(sbindir)/$$i; \ |
| 59 | $(STRIP) $(DESTDIR)$(sbindir)/$$i; \ |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 60 | done |
| 61 | for i in $(MANPAGES); do \ |
| 62 | $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \ |
| 63 | done |
| 64 | |
| 65 | uninstall: |
| 66 | for i in $(PROGS); do \ |
Theodore Ts'o | d171c5b | 1998-04-03 16:07:06 +0000 | [diff] [blame] | 67 | $(RM) -f $(DESTDIR)$(sbindir)/$$i; \ |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 68 | done |
| 69 | for i in $(MANPAGES); do \ |
Theodore Ts'o | d171c5b | 1998-04-03 16:07:06 +0000 | [diff] [blame] | 70 | $(RM) -f $(DESTDIR)$(man8dir)/$$i; \ |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 71 | done |
| 72 | |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 73 | test_extent.out: test_extent $(srcdir)/test_extent.in |
| 74 | ./test_extent < $(srcdir)/test_extent.in > test_extent.out |
| 75 | |
| 76 | check: test_extent.out |
| 77 | @if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \ |
| 78 | echo "Test succeeded." ; \ |
| 79 | else \ |
| 80 | echo "Test failed!" ; \ |
| 81 | diff test_extent.out $(srcdir)/test_extent.in ; \ |
| 82 | exit 1 ; \ |
| 83 | fi |
| 84 | |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 85 | clean: |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 86 | $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \ |
Theodore Ts'o | 790a0ad4 | 1999-07-19 16:16:12 +0000 | [diff] [blame] | 87 | resize2fs.static test_extent.out |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 88 | |
| 89 | mostlyclean: clean |
Theodore Ts'o | 5c36a2f | 1999-11-19 18:42:30 +0000 | [diff] [blame] | 90 | |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 91 | distclean: clean |
Theodore Ts'o | 5c36a2f | 1999-11-19 18:42:30 +0000 | [diff] [blame] | 92 | $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 93 | |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 94 | # |
| 95 | # Kludge to create a "special" e2fsprogs distribution file. |
| 96 | # |
| 97 | |
| 98 | SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \ |
| 99 | -e 's/pre-//' -e 's/-PLUS//'` |
| 100 | TAR=tar |
| 101 | |
| 102 | $(top_srcdir)/.exclude-file: |
Theodore Ts'o | 8e74e66 | 1997-06-17 05:36:04 +0000 | [diff] [blame] | 103 | a=$(SRCROOT); \ |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 104 | (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \ |
Theodore Ts'o | 8e74e66 | 1997-06-17 05:36:04 +0000 | [diff] [blame] | 105 | -o -name CVS -o -name \*.rej \) -print) \ |
| 106 | | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 107 | echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file |
| 108 | echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file |
Theodore Ts'o | fac9c20 | 1998-03-07 23:36:45 +0000 | [diff] [blame] | 109 | echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 110 | echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file |
| 111 | echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \ |
| 112 | >> $(top_srcdir)/.exclude-file |
Theodore Ts'o | fac9c20 | 1998-03-07 23:36:45 +0000 | [diff] [blame] | 113 | echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \ |
| 114 | >> $(top_srcdir)/.exclude-file |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 115 | |
| 116 | source_tar_file: $(top_srcdir)/.exclude-file |
| 117 | (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \ |
| 118 | $(TAR) -c -h -v -f - \ |
| 119 | -X $$a/.exclude-file $$a | \ |
Theodore Ts'o | fac9c20 | 1998-03-07 23:36:45 +0000 | [diff] [blame] | 120 | gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz) |
Theodore Ts'o | c762c8e | 1997-06-17 03:52:12 +0000 | [diff] [blame] | 121 | rm -f $(top_srcdir)/.exclude-file |
| 122 | |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 123 | # +++ Dependency line eater +++ |
| 124 | # |
| 125 | # Makefile dependencies follow. This must be the last section in |
| 126 | # the Makefile.in file |
| 127 | # |
Theodore Ts'o | 8e74e66 | 1997-06-17 05:36:04 +0000 | [diff] [blame] | 128 | extent.o: $(srcdir)/extent.c $(srcdir)/resize2fs.h \ |
Theodore Ts'o | 0cee8a5 | 2000-04-06 21:38:34 +0000 | [diff] [blame] | 129 | $(top_srcdir)/include/linux/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ |
| 130 | $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ |
| 131 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h |
Theodore Ts'o | 8e74e66 | 1997-06-17 05:36:04 +0000 | [diff] [blame] | 132 | resize2fs.o: $(srcdir)/resize2fs.c $(srcdir)/resize2fs.h \ |
Theodore Ts'o | 0cee8a5 | 2000-04-06 21:38:34 +0000 | [diff] [blame] | 133 | $(top_srcdir)/include/linux/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ |
| 134 | $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ |
| 135 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h |
Theodore Ts'o | 8e74e66 | 1997-06-17 05:36:04 +0000 | [diff] [blame] | 136 | main.o: $(srcdir)/main.c $(srcdir)/resize2fs.h \ |
Theodore Ts'o | 0cee8a5 | 2000-04-06 21:38:34 +0000 | [diff] [blame] | 137 | $(top_srcdir)/include/linux/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ |
| 138 | $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ |
| 139 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \ |
| 140 | $(srcdir)/../version.h |
Theodore Ts'o | 8e74e66 | 1997-06-17 05:36:04 +0000 | [diff] [blame] | 141 | sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \ |
Theodore Ts'o | 0cee8a5 | 2000-04-06 21:38:34 +0000 | [diff] [blame] | 142 | $(top_srcdir)/include/linux/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ |
| 143 | $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ |
| 144 | $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h |