Whamcloud - gitweb
Merge branch 'maint' into next
[tools/e2fsprogs.git] / lib / ss / Makefile.in
1 #
2 # Makefile for lib/ss
3 #
4
5 srcdir = @srcdir@
6 top_srcdir = @top_srcdir@
7 VPATH = @srcdir@
8 top_builddir = ../..
9 my_dir = lib/ss
10 INSTALL = @INSTALL@
11 DLOPEN_LIB = @DLOPEN_LIB@
12
13 @MCONFIG@
14
15 LIBRARY= libss
16 LIBDIR= ss
17
18 ELF_VERSION = 2.0
19 ELF_SO_VERSION = 2
20 ELF_IMAGE = libss
21 ELF_MYDIR = ss
22 ELF_INSTALL_DIR = $(root_libdir)
23 ELF_OTHER_LIBS = -lcom_err $(DLOPEN_LIB)
24
25 BSDLIB_VERSION = 1.0
26 BSDLIB_IMAGE = libss
27 BSDLIB_MYDIR = ss
28 BSDLIB_INSTALL_DIR = $(root_libdir)
29
30 TAGS=etags
31 COMPILE_ET=../et/compile_et --build-tree
32 MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
33
34 .c.o:
35         $(E) "  CC $<"
36         $(Q) $(CC) $(ALL_CFLAGS) -c $<
37         $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
38         $(Q) $(CPPCHECK_CMD) $<
39 @PROFILE_CMT@   $(Q) $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
40 @CHECKER_CMT@   $(Q) $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
41 @ELF_CMT@       $(Q) $(CC) $(ALL_CFLAGS) -DSHARED_ELF_LIB -fPIC -o elfshared/$*.o -c $<
42 @BSDLIB_CMT@    $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
43
44 # for the library
45
46 # with ss_err.o first, ss_err.h should get rebuilt first too.  should not
47 # be relying on this, though.
48 OBJS=   ss_err.o \
49         std_rqs.o \
50         invocation.o help.o \
51         execute_cmd.o listen.o parse.o error.o prompt.o \
52         request_tbl.o list_rqs.o pager.o requests.o \
53         data.o get_readline.o
54
55 SRCS=   $(srcdir)/invocation.c $(srcdir)/help.c \
56         $(srcdir)/execute_cmd.c $(srcdir)/listen.c $(srcdir)/parse.c \
57         $(srcdir)/error.c $(srcdir)/prompt.c $(srcdir)/request_tbl.c \
58         $(srcdir)/list_rqs.c $(srcdir)/pager.c $(srcdir)/requests.c \
59         $(srcdir)/data.c $(srcdir)/get_readline.c
60
61 all:: mk_cmds
62
63 @MAKEFILE_LIBRARY@
64 @MAKEFILE_ELF@
65 @MAKEFILE_BSDLIB@
66 @MAKEFILE_PROFILE@
67 @MAKEFILE_CHECKER@
68
69 CODE= $(SRCS) $(MKCMDSFILES)
70
71 MKCMDSOBJS=     mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o
72
73 MKCMDSFILES=    mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l
74
75 MKCMDSCSRCS=    mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c
76
77
78 HFILES= ss.h ss_internal.h
79 SHARE_FILES= ct_c.awk ct_c.sed
80
81 INSTALL_HFILES= ss.h 
82
83 # for 'tags' and dependencies
84
85 CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c
86
87 # for building archives
88
89 FILES=  $(SRCS) $(MKCMDSFILES) $(HFILES) \
90         ss_err.et std_rqs.ct Makefile \
91         test_ss.c ss 
92
93 all::   libss.a ss.pc # libss_p.a lint
94
95 std_rqs.c: std_rqs.ct mk_cmds
96         $(E) "  MK_CMDS $@"
97         $(Q) DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct
98
99 std_rqs.o: ss_err.h
100
101 test_cmd.c: test_cmd.ct mk_cmds
102         $(E) "  MK_CMDS $@"
103         $(Q) DIR=$(srcdir) $(MK_CMDS) $(srcdir)/test_cmd.ct
104
105 ss_err.c ss_err.h: ss_err.et
106         $(E) "  COMPILE_ET ss_err.et"
107         $(Q) $(COMPILE_ET) $(srcdir)/ss_err.et
108
109 ct.tab.c ct.tab.h: ct.y
110         $(RM) -f ct.tab.* y.*
111         $(YACC) -d $(srcdir)/ct.y
112         $(MV) -f y.tab.c ct.tab.c
113         $(MV) -f y.tab.h ct.tab.h
114
115 #libss.o:       $(OBJS)
116 #       $(LD) -r -s -o $@ $(OBJS)
117 #       $(CHMOD) -x $@
118
119 mk_cmds: $(DEP_SUBSTITUTE) $(srcdir)/mk_cmds.sh.in
120         $(E) "  SUBST $@"
121         $(Q) $(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds
122         $(Q) $(CHMOD) +x mk_cmds
123
124 ss.pc: $(srcdir)/ss.pc.in $(top_builddir)/config.status
125         $(E) "  CONFIG.STATUS $@"
126         $(Q) cd $(top_builddir); CONFIG_FILES=lib/ss/ss.pc ./config.status
127
128 installdirs::
129         $(E) "  MKINSTALLDIRS $(libdir) $(includedir)/ss $(datadir)/ss $(bindir)"
130         $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
131                 $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
132                 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgconfigdir)
133
134 install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds ss.pc
135         $(E) "  INSTALL_DATA $(DESTDIR)$(libdir)/libss.a"
136         $(Q) $(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a
137         -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libss.a
138         $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a
139         $(Q) $(RM) -f $(DESTDIR)$(includedir)/ss/*
140         $(Q) for i in $(INSTALL_HFILES); do \
141                 echo "  INSTALL_DATA $(DESTDIR)$(includedir)/ss/$$i"; \
142                 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
143         done
144         $(E) "  INSTALL_DATA $(includedir)/ss/ss_err.h"
145         $(Q) $(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
146         $(Q) for i in $(SHARE_FILES); do \
147                 echo "  INSTALL_DATA $(DESTDIR)$(datadir)/ss/$$i"; \
148                 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/ss/$$i; \
149         done
150         $(E) "  INSTALL $(bindir)/mk_cmds"
151         $(Q) $(INSTALL) mk_cmds $(DESTDIR)$(bindir)/mk_cmds
152         $(E) "  INSTALL_DATA $(man1dir)/mk_cmds.1"
153         $(Q) $(INSTALL_DATA) $(srcdir)/mk_cmds.1 $(DESTDIR)$(man1dir)/mk_cmds.1
154         $(E) "  INSTALL_DATA $(pkgconfigdir)/ss.pc"
155         $(Q) $(INSTALL_DATA) ss.pc $(DESTDIR)$(pkgconfigdir)/ss.pc
156
157 uninstall::
158         $(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds \
159                 $(DESTDIR)$(pkgconfigdir)/ss.pc \
160                 $(DESTDIR)$(man1dir)/mk_cmds.1 
161         $(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss
162
163 test_ss: test_ss.o test_cmd.o $(DEPLIBSS) $(DEPLIBCOM_ERR)
164         $(E) "  LD $@"
165         $(Q) $(CC) -o $@ test_ss.o test_cmd.o $(ALL_CFLAGS) \
166                 $(LIBSS) $(LIBCOM_ERR) $(SYSLIBS)
167
168 check:: all test_ss
169         $(E) "  RUN TEST test_ss"
170         -@(LD_LIBRARY_PATH=$(LIB) DYLD_LIBRARY_PATH=$(LIB) ./test_ss -f $(srcdir)/test_script > test_out 2>&1; exit 0)
171         $(Q) if diff test_out $(srcdir)/test_script_expected > test.diff; then \
172                 true ; else echo "Regression test for ss library failed!"; exit 1 ; fi
173
174 clean::
175         $(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \
176                 tst_cmds.c test_ss test_out test.diff *.o *~ \#* *.bak core \
177                 test_cmd.c
178
179 mostlyclean:: clean
180 distclean:: clean
181         $(RM) -f .depend Makefile ss.pc \
182                 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
183
184 #
185 # Hack to parallel makes recognize dependencies correctly.
186 #
187 $(top_builddir)/lib/ss/ss_err.h: ss_err.h
188
189 $(OBJS): subdirs
190
191 # +++ Dependency line eater +++
192
193 # Makefile dependencies follow.  This must be the last section in
194 # the Makefile.in file
195 #
196 invocation.o: $(srcdir)/invocation.c $(top_builddir)/lib/config.h \
197  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
198  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
199 help.o: $(srcdir)/help.c $(top_builddir)/lib/config.h \
200  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
201  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
202 execute_cmd.o: $(srcdir)/execute_cmd.c $(top_builddir)/lib/config.h \
203  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
204  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
205 listen.o: $(srcdir)/listen.c $(top_builddir)/lib/config.h \
206  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
207  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
208 parse.o: $(srcdir)/parse.c $(top_builddir)/lib/config.h \
209  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
210  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
211 error.o: $(srcdir)/error.c $(top_builddir)/lib/config.h \
212  $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
213  $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
214 prompt.o: $(srcdir)/prompt.c $(top_builddir)/lib/config.h \
215  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
216  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
217 request_tbl.o: $(srcdir)/request_tbl.c $(top_builddir)/lib/config.h \
218  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
219  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
220 list_rqs.o: $(srcdir)/list_rqs.c $(top_builddir)/lib/config.h \
221  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
222  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
223 pager.o: $(srcdir)/pager.c $(top_builddir)/lib/config.h \
224  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
225  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
226 requests.o: $(srcdir)/requests.c $(top_builddir)/lib/config.h \
227  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
228  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
229 data.o: $(srcdir)/data.c $(top_builddir)/lib/config.h \
230  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
231  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
232 get_readline.o: $(srcdir)/get_readline.c $(top_builddir)/lib/config.h \
233  $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
234  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h