]>
Commit | Line | Data |
---|---|---|
24b2c7a7 TT |
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@ | |
0e14f78e | 11 | LDFLAG_STATIC = @LDFLAG_STATIC@ |
24b2c7a7 TT |
12 | |
13 | @MCONFIG@ | |
14 | ||
15 | PROGS= resize2fs | |
c762c8e6 | 16 | TEST_PROGS= test_extent |
24b2c7a7 TT |
17 | MANPAGES= resize2fs.8 |
18 | ||
bf69235a | 19 | RESIZE_OBJS= extent.o resize2fs.o main.o online.o sim_progress.o |
24b2c7a7 | 20 | |
c762c8e6 TT |
21 | TEST_EXTENT_OBJS= extent.o test_extent.o |
22 | ||
23 | SRCS= $(srcdir)/extent.c \ | |
052db4b7 | 24 | $(srcdir)/resize2fs.c \ |
c762c8e6 | 25 | $(srcdir)/main.c \ |
bf69235a | 26 | $(srcdir)/online.c \ |
c762c8e6 | 27 | $(srcdir)/sim_progress.c |
24b2c7a7 | 28 | |
55f4cbd9 | 29 | LIBS= $(LIBE2P) $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBINTL) |
a6a1c081 | 30 | DEPLIBS= $(LIBE2P) $(LIBEXT2FS) $(DEPLIBCOM_ERR) |
24b2c7a7 | 31 | |
55f4cbd9 TT |
32 | STATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) \ |
33 | $(LIBINTL) | |
a6a1c081 | 34 | DEPSTATIC_LIBS= $(STATIC_LIBE2P) $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBCOM_ERR) |
0e14f78e | 35 | |
24b2c7a7 | 36 | .c.o: |
c13351f6 TT |
37 | $(E) " CC $<" |
38 | $(Q) $(CC) -c $(ALL_CFLAGS) $< -o $@ | |
24b2c7a7 | 39 | |
0cee8a5c | 40 | all:: $(PROGS) $(TEST_PROGS) $(MANPAGES) |
24b2c7a7 TT |
41 | |
42 | resize2fs: $(RESIZE_OBJS) $(DEPLIBS) | |
c13351f6 TT |
43 | $(E) " LD $@" |
44 | $(Q) $(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS) | |
24b2c7a7 | 45 | |
a6a1c081 | 46 | resize2fs.static: $(RESIZE_OBJS) $(DEPSTATIC_LIBS) |
c13351f6 TT |
47 | $(E) " LD $@" |
48 | $(Q) $(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \ | |
0e14f78e TT |
49 | $(RESIZE_OBJS) $(STATIC_LIBS) |
50 | ||
44339bdf | 51 | resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in |
c13351f6 TT |
52 | $(E) " SUBST $@" |
53 | $(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/resize2fs.8.in resize2fs.8 | |
24b2c7a7 | 54 | |
c762c8e6 | 55 | test_extent: $(TEST_EXTENT_OBJS) |
c13351f6 TT |
56 | $(E) " LD $@" |
57 | $(Q) $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS) | |
dd607056 | 58 | |
24b2c7a7 | 59 | installdirs: |
c13351f6 TT |
60 | $(E) " MKINSTALLDIRS $(root_sbindir) $(man8dir)" |
61 | $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \ | |
d171c5b5 | 62 | $(DESTDIR)$(man8dir) |
24b2c7a7 TT |
63 | |
64 | install: $(PROGS) $(MANPAGES) installdirs | |
c13351f6 | 65 | $(Q) for i in $(PROGS); do \ |
522798d3 | 66 | echo " INSTALL $(root_sbindir)/$$i"; \ |
e4c8e885 | 67 | $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \ |
24b2c7a7 | 68 | done |
c13351f6 | 69 | $(Q) for i in $(MANPAGES); do \ |
482afc44 TT |
70 | for j in $(COMPRESS_EXT); do \ |
71 | $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \ | |
72 | done; \ | |
522798d3 | 73 | echo " INSTALL_DATA $(man8dir)/$$i"; \ |
24b2c7a7 TT |
74 | $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \ |
75 | done | |
76 | ||
522798d3 | 77 | install-strip: install |
c13351f6 | 78 | $(Q) for i in $(PROGS); do \ |
522798d3 TT |
79 | echo " STRIP $(root_sbindir)/$$i"; \ |
80 | $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \ | |
81 | done | |
82 | ||
24b2c7a7 TT |
83 | uninstall: |
84 | for i in $(PROGS); do \ | |
e4c8e885 | 85 | $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \ |
24b2c7a7 TT |
86 | done |
87 | for i in $(MANPAGES); do \ | |
d171c5b5 | 88 | $(RM) -f $(DESTDIR)$(man8dir)/$$i; \ |
24b2c7a7 TT |
89 | done |
90 | ||
c762c8e6 | 91 | test_extent.out: test_extent $(srcdir)/test_extent.in |
afb6d709 | 92 | LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./test_extent < $(srcdir)/test_extent.in \ |
304905df | 93 | > test_extent.out |
c762c8e6 | 94 | |
3e377db2 | 95 | check:: test_extent.out |
c13351f6 | 96 | $(Q) if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \ |
c762c8e6 TT |
97 | echo "Test succeeded." ; \ |
98 | else \ | |
99 | echo "Test failed!" ; \ | |
100 | diff test_extent.out $(srcdir)/test_extent.in ; \ | |
101 | exit 1 ; \ | |
102 | fi | |
dd607056 | 103 | |
24b2c7a7 | 104 | clean: |
c762c8e6 | 105 | $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \ |
790a0ad4 | 106 | resize2fs.static test_extent.out |
24b2c7a7 TT |
107 | |
108 | mostlyclean: clean | |
5c36a2f8 | 109 | |
24b2c7a7 | 110 | distclean: clean |
5c36a2f8 | 111 | $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old |
24b2c7a7 | 112 | |
c762c8e6 TT |
113 | # |
114 | # Kludge to create a "special" e2fsprogs distribution file. | |
115 | # | |
116 | ||
117 | SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \ | |
118 | -e 's/pre-//' -e 's/-PLUS//'` | |
119 | TAR=tar | |
120 | ||
121 | $(top_srcdir)/.exclude-file: | |
8e74e669 | 122 | a=$(SRCROOT); \ |
c762c8e6 | 123 | (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \ |
8e74e669 TT |
124 | -o -name CVS -o -name \*.rej \) -print) \ |
125 | | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file | |
c762c8e6 TT |
126 | echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file |
127 | echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file | |
fac9c206 | 128 | echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file |
c762c8e6 TT |
129 | echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file |
130 | echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \ | |
131 | >> $(top_srcdir)/.exclude-file | |
fac9c206 TT |
132 | echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \ |
133 | >> $(top_srcdir)/.exclude-file | |
dd607056 | 134 | |
c762c8e6 TT |
135 | source_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 | \ | |
fac9c206 | 139 | gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz) |
c762c8e6 TT |
140 | rm -f $(top_srcdir)/.exclude-file |
141 | ||
24b2c7a7 TT |
142 | # +++ Dependency line eater +++ |
143 | # | |
144 | # Makefile dependencies follow. This must be the last section in | |
145 | # the Makefile.in file | |
146 | # | |
8e74e669 | 147 | extent.o: $(srcdir)/extent.c $(srcdir)/resize2fs.h \ |
797f5ef1 | 148 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
75e93ab0 TT |
149 | $(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 | |
8e74e669 | 152 | resize2fs.o: $(srcdir)/resize2fs.c $(srcdir)/resize2fs.h \ |
797f5ef1 | 153 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
75e93ab0 TT |
154 | $(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 | |
157 | main.o: $(srcdir)/main.c $(top_srcdir)/lib/e2p/e2p.h \ | |
797f5ef1 | 158 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
75e93ab0 TT |
159 | $(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 | |
bf69235a TT |
163 | online.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 | |
8e74e669 | 168 | sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \ |
797f5ef1 | 169 | $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ |
75e93ab0 TT |
170 | $(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 |