6 top_srcdir = @top_srcdir@
11 DLOPEN_LIB = @DLOPEN_LIB@
22 ELF_INSTALL_DIR = $(root_libdir)
23 ELF_OTHER_LIBS = -L../.. -lcom_err $(DLOPEN_LIB)
28 BSDLIB_INSTALL_DIR = $(root_libdir)
31 COMPILE_ET=../et/compile_et --build-tree
32 MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
34 # -I.. is so that ss/ss_err.h works
35 # -I$(srcdir)/.. is so that ss/ss.h works
36 # -I$(srcdir)/../et is so com_err.h works
37 XTRA_CFLAGS= -I$(srcdir)/../et
41 @$(CC) $(ALL_CFLAGS) -c $<
42 @PROFILE_CMT@ @$(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
43 @CHECKER_CMT@ @$(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
44 @ELF_CMT@ @$(CC) $(ALL_CFLAGS) -DSHARED_ELF_LIB -fPIC -o elfshared/$*.o -c $<
45 @BSDLIB_CMT@ @$(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
51 # with ss_err.o first, ss_err.h should get rebuilt first too. should not
52 # be relying on this, though.
56 execute_cmd.o listen.o parse.o error.o prompt.o \
57 request_tbl.o list_rqs.o pager.o requests.o \
60 SRCS= $(srcdir)/invocation.c $(srcdir)/help.c \
61 $(srcdir)/execute_cmd.c $(srcdir)/listen.c $(srcdir)/parse.c \
62 $(srcdir)/error.c $(srcdir)/prompt.c $(srcdir)/request_tbl.c \
63 $(srcdir)/list_rqs.c $(srcdir)/pager.c $(srcdir)/requests.c \
64 $(srcdir)/data.c $(srcdir)/get_readline.c
74 CODE= $(SRCS) $(MKCMDSFILES)
76 MKCMDSOBJS= mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o
78 MKCMDSFILES= mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l
80 MKCMDSCSRCS= mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c
83 HFILES= ss.h ss_internal.h
84 SHARE_FILES= ct_c.awk ct_c.sed
88 # for 'tags' and dependencies
90 CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c
92 # for building archives
94 FILES= $(SRCS) $(MKCMDSFILES) $(HFILES) \
95 ss_err.et std_rqs.ct Makefile \
98 all:: libss.a # libss_p.a lint
100 std_rqs.c: std_rqs.ct mk_cmds
102 @DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct
104 ss_err.c ss_err.h: ss_err.et
105 @echo " COMPILE_ET $<"
106 @$(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 @$(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds
124 $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
125 $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
128 install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds
129 $(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a
130 $(CHMOD) 644 $(DESTDIR)$(libdir)/libss.a
131 -$(RANLIB) $(DESTDIR)$(libdir)/libss.a
132 $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a
133 $(RM) -f $(DESTDIR)$(includedir)/ss/*
134 for i in $(INSTALL_HFILES); do \
135 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
137 $(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
138 for i in $(SHARE_FILES); do \
139 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/ss/$$i; \
141 $(INSTALL) mk_cmds $(DESTDIR)$(bindir)/mk_cmds
142 $(INSTALL_DATA) $(srcdir)/mk_cmds.1 $(DESTDIR)$(man1dir)/mk_cmds.1
145 $(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds
146 $(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss
149 $(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \
150 *.o *~ \#* *.bak core
154 $(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
157 # Hack to parallel makes recognize dependencies correctly.
159 $(top_builddir)/lib/ss/ss_err.h: ss_err.h
161 # +++ Dependency line eater +++
163 # Makefile dependencies follow. This must be the last section in
164 # the Makefile.in file
166 invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
167 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
168 help.o: $(srcdir)/help.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
169 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
170 execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
171 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
172 listen.o: $(srcdir)/listen.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
173 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
174 parse.o: $(srcdir)/parse.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
175 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
176 error.o: $(srcdir)/error.c $(top_srcdir)/lib/et/com_err.h \
177 $(srcdir)/ss_internal.h $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h \
178 $(top_srcdir)/lib/et/com_err.h
179 prompt.o: $(srcdir)/prompt.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
180 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
181 request_tbl.o: $(srcdir)/request_tbl.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
182 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
183 list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
184 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
185 pager.o: $(srcdir)/pager.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
186 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
187 requests.o: $(srcdir)/requests.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
188 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
189 data.o: $(srcdir)/data.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
190 $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
191 get_readline.o: $(srcdir)/get_readline.c $(srcdir)/ss_internal.h \
192 $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h \
193 $(top_srcdir)/lib/et/com_err.h