6 top_srcdir = @top_srcdir@
12 DLOPEN_LIB = @DLOPEN_LIB@
23 ELF_INSTALL_DIR = $(root_libdir)
24 ELF_OTHER_LIBS = -lcom_err $(DLOPEN_LIB)
29 BSDLIB_INSTALL_DIR = $(root_libdir)
32 MK_CMDS= _SS_DIR_OVERRIDE=$(srcdir) ./mk_cmds
33 COMPILE_ET= _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
37 $(Q) $(CC) $(ALL_CFLAGS_STLIB) -c $<
38 $(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
39 $(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
40 @PROFILE_CMT@ $(Q) $(CC) $(ALL_CFLAGS_STLIB) -g -pg -o profiled/$*.o -c $<
41 @ELF_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) -DSHARED_ELF_LIB -fPIC -shared -o elfshared/$*.o -c $<
42 @BSDLIB_CMT@ $(Q) $(CC) $(ALL_CFLAGS_SHLIB) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
46 # with ss_err.o first, ss_err.h should get rebuilt first too. should not
47 # be relying on this, though.
51 execute_cmd.o listen.o parse.o error.o prompt.o \
52 request_tbl.o list_rqs.o pager.o requests.o \
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
68 CODE= $(SRCS) $(MKCMDSFILES)
70 MKCMDSOBJS= mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o
72 MKCMDSFILES= mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l
74 MKCMDSCSRCS= mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c
77 HFILES= ss.h ss_internal.h
78 SHARE_FILES= ct_c.awk ct_c.sed
82 # for 'tags' and dependencies
84 CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c
86 # for building archives
88 FILES= $(SRCS) $(MKCMDSFILES) $(HFILES) \
89 ss_err.et std_rqs.ct Makefile \
92 all:: libss.a ss.pc # libss_p.a lint
94 std_rqs.c: std_rqs.ct mk_cmds
96 $(Q) DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct
100 test_cmd.c: test_cmd.ct mk_cmds
102 $(Q) DIR=$(srcdir) $(MK_CMDS) $(srcdir)/test_cmd.ct
104 ss_err.c ss_err.h: ss_err.et
105 $(E) " COMPILE_ET ss_err.et"
106 $(Q) $(COMPILE_ET) $(srcdir)/ss_err.et
108 ct.tab.c ct.tab.h: ct.y
109 $(RM) -f ct.tab.* y.*
110 $(YACC) -d $(srcdir)/ct.y
111 $(MV) -f y.tab.c ct.tab.c
112 $(MV) -f y.tab.h ct.tab.h
115 # $(LD) -r -s -o $@ $(OBJS)
118 mk_cmds: $(DEP_SUBSTITUTE) $(srcdir)/mk_cmds.sh.in
120 $(Q) $(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds
121 $(Q) $(CHMOD) +x mk_cmds
123 ss.pc: $(srcdir)/ss.pc.in $(top_builddir)/config.status
124 $(E) " CONFIG.STATUS $@"
125 $(Q) cd $(top_builddir); CONFIG_FILES=lib/ss/ss.pc ./config.status
128 $(E) " MKDIR_P $(libdir) $(includedir)/ss $(datadir)/ss $(bindir)"
129 $(Q) $(MKDIR_P) $(DESTDIR)$(libdir) \
130 $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
131 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgconfigdir)
133 install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds ss.pc
134 $(E) " INSTALL_DATA $(DESTDIR)$(libdir)/libss.a"
135 $(Q) $(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a
136 -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libss.a
137 $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a
138 $(Q) $(RM) -f $(DESTDIR)$(includedir)/ss/*
139 $(Q) for i in $(INSTALL_HFILES); do \
140 echo " INSTALL_DATA $(DESTDIR)$(includedir)/ss/$$i"; \
141 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
143 $(E) " INSTALL_DATA $(includedir)/ss/ss_err.h"
144 $(Q) $(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
145 $(Q) for i in $(SHARE_FILES); do \
146 echo " INSTALL_DATA $(DESTDIR)$(datadir)/ss/$$i"; \
147 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/ss/$$i; \
149 $(E) " INSTALL $(bindir)/mk_cmds"
150 $(Q) $(INSTALL) mk_cmds $(DESTDIR)$(bindir)/mk_cmds
151 $(E) " INSTALL_DATA $(man1dir)/mk_cmds.1"
152 $(Q) $(INSTALL_DATA) $(srcdir)/mk_cmds.1 $(DESTDIR)$(man1dir)/mk_cmds.1
153 $(E) " INSTALL_DATA $(pkgconfigdir)/ss.pc"
154 $(Q) $(INSTALL_DATA) ss.pc $(DESTDIR)$(pkgconfigdir)/ss.pc
157 $(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds \
158 $(DESTDIR)$(pkgconfigdir)/ss.pc \
159 $(DESTDIR)$(man1dir)/mk_cmds.1
160 $(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss
162 test_ss: test_ss.o test_cmd.o $(DEPLIBSS) $(DEPLIBCOM_ERR)
164 $(Q) $(CC) -o $@ test_ss.o test_cmd.o $(ALL_CFLAGS) $(ALL_LDFLAGS) \
165 $(LIBSS) $(LIBCOM_ERR) $(SYSLIBS)
167 fullcheck check:: all test_ss
168 $(E) " RUN TEST test_ss"
169 -@($(TESTENV) ./test_ss -f $(srcdir)/test_script > test_out 2>&1; exit 0)
170 $(Q) if diff test_out $(srcdir)/test_script_expected > test.diff; then \
171 true ; else echo "Regression test for ss library failed!"; exit 1 ; fi
174 $(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \
175 tst_cmds.c test_ss test_out test.diff *.o *~ \#* *.bak core \
180 $(RM) -f .depend Makefile ss.pc \
181 $(srcdir)/TAGS $(srcdir)/Makefile.in.old
184 # Hack to parallel makes recognize dependencies correctly.
186 $(top_builddir)/lib/ss/ss_err.h: ss_err.h
190 # +++ Dependency line eater +++
192 # Makefile dependencies follow. This must be the last section in
193 # the Makefile.in file
195 invocation.o: $(srcdir)/invocation.c $(top_builddir)/lib/config.h \
196 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
197 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
198 help.o: $(srcdir)/help.c $(top_builddir)/lib/config.h \
199 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
200 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
201 execute_cmd.o: $(srcdir)/execute_cmd.c $(top_builddir)/lib/config.h \
202 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
203 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
204 listen.o: $(srcdir)/listen.c $(top_builddir)/lib/config.h \
205 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
206 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
207 parse.o: $(srcdir)/parse.c $(top_builddir)/lib/config.h \
208 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
209 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
210 error.o: $(srcdir)/error.c $(top_builddir)/lib/config.h \
211 $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
212 $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
213 prompt.o: $(srcdir)/prompt.c $(top_builddir)/lib/config.h \
214 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
215 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
216 request_tbl.o: $(srcdir)/request_tbl.c $(top_builddir)/lib/config.h \
217 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
218 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
219 list_rqs.o: $(srcdir)/list_rqs.c $(top_builddir)/lib/config.h \
220 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
221 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
222 pager.o: $(srcdir)/pager.c $(top_builddir)/lib/config.h \
223 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
224 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
225 requests.o: $(srcdir)/requests.c $(top_builddir)/lib/config.h \
226 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
227 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
228 data.o: $(srcdir)/data.c $(top_builddir)/lib/config.h \
229 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
230 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
231 get_readline.o: $(srcdir)/get_readline.c $(top_builddir)/lib/config.h \
232 $(top_builddir)/lib/dirpaths.h $(srcdir)/ss_internal.h $(srcdir)/ss.h \
233 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h