blob: 67589120a8f40c06a583f35c26f6439ef2241772 [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'obf692352006-03-17 19:45:45 -050019RESIZE_OBJS= extent.o resize2fs.o main.o online.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 \
Theodore Ts'obf692352006-03-17 19:45:45 -050026 $(srcdir)/online.c \
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000027 $(srcdir)/sim_progress.c
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000028
Theodore Ts'o55f4cbd2005-01-05 03:01:06 -050029LIBS= $(LIBE2P) $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBINTL)
30DEPLIBS= $(LIBE2P) $(LIBEXT2FS) $(LIBCOM_ERR)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000031
Theodore Ts'o55f4cbd2005-01-05 03:01:06 -050032STATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) \
33 $(LIBINTL)
34STATIC_DEPLIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR)
Theodore Ts'o0e14f781998-02-27 06:04:23 +000035
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000036.c.o:
Theodore Ts'o47204ff2004-11-30 10:52:27 -050037 @echo " CC $<"
38 @$(CC) -c $(ALL_CFLAGS) $< -o $@
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000039
Theodore Ts'o0cee8a52000-04-06 21:38:34 +000040all:: $(PROGS) $(TEST_PROGS) $(MANPAGES)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000041
42resize2fs: $(RESIZE_OBJS) $(DEPLIBS)
Theodore Ts'o47204ff2004-11-30 10:52:27 -050043 @echo " LD $@"
44 @$(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000045
Theodore Ts'o0e14f781998-02-27 06:04:23 +000046resize2fs.static: $(RESIZE_OBJS) $(STATIC_DEPLIBS)
Theodore Ts'o47204ff2004-11-30 10:52:27 -050047 @echo " LD $@"
48 @$(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \
Theodore Ts'o0e14f781998-02-27 06:04:23 +000049 $(RESIZE_OBJS) $(STATIC_LIBS)
50
Theodore Ts'o44339bd1997-10-15 02:47:20 +000051resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
Theodore Ts'o47204ff2004-11-30 10:52:27 -050052 @echo " SUBST $@"
53 @$(SUBSTITUTE_UPTIME) $(srcdir)/resize2fs.8.in resize2fs.8
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000054
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000055test_extent: $(TEST_EXTENT_OBJS)
Theodore Ts'o47204ff2004-11-30 10:52:27 -050056 @echo " LD $@"
57 @$(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS)
Theodore Ts'odd607052004-04-03 13:53:46 -050058
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000059installdirs:
Theodore Ts'o522798d2004-12-15 11:28:55 -050060 @echo " MKINSTALLDIRS $(root_sbindir) $(man8dir)"
61 @$(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \
Theodore Ts'od171c5b1998-04-03 16:07:06 +000062 $(DESTDIR)$(man8dir)
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000063
64install: $(PROGS) $(MANPAGES) installdirs
Theodore Ts'o522798d2004-12-15 11:28:55 -050065 @for i in $(PROGS); do \
66 echo " INSTALL $(root_sbindir)/$$i"; \
Theodore Ts'oe4c8e882000-07-05 23:54:46 +000067 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000068 done
Theodore Ts'o522798d2004-12-15 11:28:55 -050069 @for i in $(MANPAGES); do \
Theodore Ts'o482afc42002-10-31 03:32:34 -050070 for j in $(COMPRESS_EXT); do \
71 $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
72 done; \
Theodore Ts'o522798d2004-12-15 11:28:55 -050073 echo " INSTALL_DATA $(man8dir)/$$i"; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000074 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
75 done
76
Theodore Ts'o522798d2004-12-15 11:28:55 -050077install-strip: install
78 @for i in $(PROGS); do \
79 echo " STRIP $(root_sbindir)/$$i"; \
80 $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
81 done
82
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000083uninstall:
84 for i in $(PROGS); do \
Theodore Ts'oe4c8e882000-07-05 23:54:46 +000085 $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000086 done
87 for i in $(MANPAGES); do \
Theodore Ts'od171c5b1998-04-03 16:07:06 +000088 $(RM) -f $(DESTDIR)$(man8dir)/$$i; \
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +000089 done
90
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000091test_extent.out: test_extent $(srcdir)/test_extent.in
Theodore Ts'oafb6d702003-04-21 16:12:34 -040092 LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./test_extent < $(srcdir)/test_extent.in \
Theodore Ts'o304905d2002-03-07 20:55:01 -050093 > test_extent.out
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000094
Theodore Ts'o3e377db2000-12-09 02:37:33 +000095check:: test_extent.out
Theodore Ts'oc762c8e1997-06-17 03:52:12 +000096 @if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \
97 echo "Test succeeded." ; \
98 else \
99 echo "Test failed!" ; \
100 diff test_extent.out $(srcdir)/test_extent.in ; \
101 exit 1 ; \
102 fi
Theodore Ts'odd607052004-04-03 13:53:46 -0500103
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000104clean:
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000105 $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
Theodore Ts'o790a0ad41999-07-19 16:16:12 +0000106 resize2fs.static test_extent.out
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000107
108mostlyclean: clean
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000109
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000110distclean: clean
Theodore Ts'o5c36a2f1999-11-19 18:42:30 +0000111 $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000112
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000113#
114# Kludge to create a "special" e2fsprogs distribution file.
115#
116
117SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
118 -e 's/pre-//' -e 's/-PLUS//'`
119TAR=tar
120
121$(top_srcdir)/.exclude-file:
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000122 a=$(SRCROOT); \
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000123 (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000124 -o -name CVS -o -name \*.rej \) -print) \
125 | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000126 echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file
127 echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file
Theodore Ts'ofac9c201998-03-07 23:36:45 +0000128 echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000129 echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file
130 echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
131 >> $(top_srcdir)/.exclude-file
Theodore Ts'ofac9c201998-03-07 23:36:45 +0000132 echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \
133 >> $(top_srcdir)/.exclude-file
Theodore Ts'odd607052004-04-03 13:53:46 -0500134
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000135source_tar_file: $(top_srcdir)/.exclude-file
136 (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
137 $(TAR) -c -h -v -f - \
138 -X $$a/.exclude-file $$a | \
Theodore Ts'ofac9c201998-03-07 23:36:45 +0000139 gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz)
Theodore Ts'oc762c8e1997-06-17 03:52:12 +0000140 rm -f $(top_srcdir)/.exclude-file
141
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000142# +++ Dependency line eater +++
143#
144# Makefile dependencies follow. This must be the last section in
145# the Makefile.in file
146#
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000147extent.o: $(srcdir)/extent.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 \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400149 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
150 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
151 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000152resize2fs.o: $(srcdir)/resize2fs.c $(srcdir)/resize2fs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000153 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400154 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
155 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
156 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h
157main.o: $(srcdir)/main.c $(top_srcdir)/lib/e2p/e2p.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000158 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400159 $(srcdir)/resize2fs.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
160 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
161 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h \
162 $(top_srcdir)/version.h
Theodore Ts'obf692352006-03-17 19:45:45 -0500163online.o: $(srcdir)/online.c $(srcdir)/resize2fs.h \
164 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
165 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
166 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
167 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h
Theodore Ts'o8e74e661997-06-17 05:36:04 +0000168sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \
Theodore Ts'o797f5ef2001-06-01 23:49:46 +0000169 $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Theodore Ts'o75e93ab2005-05-06 09:37:58 -0400170 $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
171 $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
172 $(top_builddir)/lib/ext2fs/ext2_err.h $(top_srcdir)/lib/ext2fs/bitops.h