Whamcloud - gitweb
Add install-strip and install-shlibs-strip targets
[tools/e2fsprogs.git] / resize / Makefile.in
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@
11 LDFLAG_STATIC = @LDFLAG_STATIC@
12
13 @MCONFIG@
14
15 PROGS=          resize2fs
16 TEST_PROGS=     test_extent
17 MANPAGES=       resize2fs.8
18
19 RESIZE_OBJS= extent.o resize2fs.o main.o sim_progress.o 
20
21 TEST_EXTENT_OBJS= extent.o test_extent.o
22
23 SRCS= $(srcdir)/extent.c \
24         $(srcdir)/resize2fs.c \
25         $(srcdir)/main.c \
26         $(srcdir)/sim_progress.c
27
28 LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) $(LIBINTL)
29 DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
30
31 STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) $(LIBINTL)
32 STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBCOM_ERR) 
33
34 .c.o:
35         @echo " CC $<"
36         @$(CC) -c $(ALL_CFLAGS) $< -o $@
37
38 all:: $(PROGS) $(TEST_PROGS) $(MANPAGES) 
39
40 resize2fs: $(RESIZE_OBJS) $(DEPLIBS)
41         @echo " LD $@"
42         @$(CC) $(ALL_LDFLAGS) -o resize2fs $(RESIZE_OBJS) $(LIBS) 
43
44 resize2fs.static: $(RESIZE_OBJS)  $(STATIC_DEPLIBS)
45         @echo " LD $@"
46         @$(LD) $(ALL_LDFLAGS) $(LDFLAG_STATIC) -o resize2fs.static \
47                 $(RESIZE_OBJS) $(STATIC_LIBS) 
48
49 resize2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/resize2fs.8.in
50         @echo " SUBST $@"
51         @$(SUBSTITUTE_UPTIME) $(srcdir)/resize2fs.8.in resize2fs.8
52
53 test_extent: $(TEST_EXTENT_OBJS)
54         @echo " LD $@"
55         @$(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS) 
56
57 installdirs:
58         @echo " MKINSTALLDIRS $(root_sbindir) $(man8dir)"
59         @$(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \
60                 $(DESTDIR)$(man8dir)
61
62 install: $(PROGS) $(MANPAGES) installdirs
63         @for i in $(PROGS); do \
64                 echo "  INSTALL $(root_sbindir)/$$i"; \
65                 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
66         done
67         @for i in $(MANPAGES); do \
68                 for j in $(COMPRESS_EXT); do \
69                         $(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
70                 done; \
71                 echo "  INSTALL_DATA $(man8dir)/$$i"; \
72                 $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
73         done
74
75 install-strip: install
76         @for i in $(PROGS); do \
77                 echo "  STRIP $(root_sbindir)/$$i"; \
78                 $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
79         done
80
81 uninstall:
82         for i in $(PROGS); do \
83                 $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
84         done
85         for i in $(MANPAGES); do \
86                 $(RM) -f $(DESTDIR)$(man8dir)/$$i; \
87         done
88
89 test_extent.out: test_extent $(srcdir)/test_extent.in
90         LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./test_extent < $(srcdir)/test_extent.in \
91                 > test_extent.out
92
93 check:: test_extent.out
94         @if cmp -s test_extent.out $(srcdir)/test_extent.in ; then \
95                 echo "Test succeeded." ; \
96         else \
97                 echo "Test failed!" ; \
98                 diff test_extent.out $(srcdir)/test_extent.in ; \
99                 exit 1 ; \
100         fi
101
102 clean:
103         $(RM) -f $(PROGS) $(TEST_PROGS) $(MANPAGES) \#* *.s *.o *.a *~ core \
104                 resize2fs.static test_extent.out
105
106 mostlyclean: clean
107
108 distclean: clean
109         $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
110
111 #
112 # Kludge to create a "special" e2fsprogs distribution file.
113 #
114
115 SRCROOT = `echo e2fsprogs-@E2FSPROGS_VERSION@ | sed -e 's/-WIP//' \
116                         -e 's/pre-//' -e 's/-PLUS//'`
117 TAR=tar
118
119 $(top_srcdir)/.exclude-file:
120         a=$(SRCROOT); \
121         (cd $(top_srcdir)/.. ; find e2fsprogs \( -name \*~ -o -name \*.orig \
122                 -o -name CVS -o -name \*.rej \) -print) \
123                 | sed -e "s/e2fsprogs/$$a/" > $(top_srcdir)/.exclude-file
124         echo "$(SRCROOT)/build" >> $(top_srcdir)/.exclude-file
125         echo "$(SRCROOT)/rpm.log" >> $(top_srcdir)/.exclude-file
126         echo "$(SRCROOT)/powerquest" >> $(top_srcdir)/.exclude-file
127         echo "$(SRCROOT)/.exclude-file" >> $(top_srcdir)/.exclude-file
128         echo $(SRCROOT)/e2fsprogs-@E2FSPROGS_VERSION@.tar.gz \
129                 >> $(top_srcdir)/.exclude-file
130         echo $(SRCROOT)/e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz \
131                 >> $(top_srcdir)/.exclude-file
132
133 source_tar_file: $(top_srcdir)/.exclude-file
134         (cd $(top_srcdir)/..; a=$(SRCROOT); rm -f $$a ; ln -sf e2fsprogs $$a ; \
135                 $(TAR) -c -h -v -f - \
136                         -X $$a/.exclude-file $$a | \
137                 gzip -9 > e2fsprogs-ALL-@E2FSPROGS_VERSION@.tar.gz)
138         rm -f $(top_srcdir)/.exclude-file
139
140 # +++ Dependency line eater +++
141
142 # Makefile dependencies follow.  This must be the last section in
143 # the Makefile.in file
144 #
145 extent.o: $(srcdir)/extent.c $(srcdir)/resize2fs.h \
146  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
147  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
148  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
149  $(top_srcdir)/lib/ext2fs/bitops.h
150 resize2fs.o: $(srcdir)/resize2fs.c $(srcdir)/resize2fs.h \
151  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
152  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
153  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
154  $(top_srcdir)/lib/ext2fs/bitops.h
155 main.o: $(srcdir)/main.c $(srcdir)/resize2fs.h \
156  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
157  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
158  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
159  $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/version.h
160 sim_progress.o: $(srcdir)/sim_progress.c $(srcdir)/resize2fs.h \
161  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
162  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/et/com_err.h \
163  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
164  $(top_srcdir)/lib/ext2fs/bitops.h