Makefile.in revision 1f00aafd9f5a1c69d72233c5b7859a38a6c702e5
1#
2# Makefile for lib/ss
3#
4
5srcdir = @srcdir@
6top_srcdir = @top_srcdir@
7VPATH = @srcdir@
8top_builddir = ../..
9my_dir = lib/ss
10INSTALL = @INSTALL@
11
12@MCONFIG@
13
14LIBRARY= libss
15LIBDIR= ss
16
17DLL_ADDRESS = 0x66880000
18DLL_JUMPSIZE = 0x1000
19DLL_GOTSIZE  = 0x1000
20DLL_VERSION = 1.0
21DLL_IMAGE = libss
22DLL_STUB = libss
23DLL_LIBS = -L../.. -lcom_err
24DLL_MYDIR = ss
25DLL_INSTALL_DIR = $(root_libdir)
26
27ELF_VERSION = 2.0
28ELF_SO_VERSION = 2
29ELF_IMAGE = libss
30ELF_MYDIR = ss
31ELF_INSTALL_DIR = $(root_libdir)
32ELF_OTHER_LIBS = -lc -L../.. -lcom_err
33
34BSDLIB_VERSION = 1.0
35BSDLIB_IMAGE = libss
36BSDLIB_MYDIR = ss
37BSDLIB_INSTALL_DIR = $(root_libdir)
38
39TAGS=etags
40COMPILE_ET=../et/compile_et
41MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
42
43# -I.. is so that ss/ss_err.h works
44# -I$(srcdir)/.. is so that ss/ss.h works
45# -I$(srcdir)/../et is so com_err.h works
46XTRA_CFLAGS=-DPOSIX_SIGNALS -I$(srcdir)/../et
47
48.c.o:
49	$(CC) $(ALL_CFLAGS) -c $<
50@PROFILE_CMT@	$(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
51@CHECKER_CMT@	$(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
52@DLL_CMT@	(export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) \
53@DLL_CMT@		$(ALL_CFLAGS) -o jump/$*.o -c $<)
54@ELF_CMT@	$(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
55@BSDLIB_CMT@	$(CC) $(ALL_CFLAGS) -fpic -o pic/$*.o -c $<
56
57# for the library
58
59LIB=	libss.a
60
61# with ss_err.o first, ss_err.h should get rebuilt first too.  should not
62# be relying on this, though.
63OBJS=	ss_err.o \
64	std_rqs.o \
65	invocation.o help.o \
66	execute_cmd.o listen.o parse.o error.o prompt.o \
67	request_tbl.o list_rqs.o pager.o requests.o \
68	data.o
69
70SRCS=	$(srcdir)/invocation.c $(srcdir)/help.c \
71	$(srcdir)/execute_cmd.c $(srcdir)/listen.c $(srcdir)/parse.c \
72	$(srcdir)/error.c $(srcdir)/prompt.c $(srcdir)/request_tbl.c \
73	$(srcdir)/list_rqs.c $(srcdir)/pager.c $(srcdir)/requests.c \
74	$(srcdir)/data.c 
75
76all:: mk_cmds
77
78@MAKEFILE_LIBRARY@
79@MAKEFILE_DLL@
80@MAKEFILE_ELF@
81@MAKEFILE_BSDLIB@
82@MAKEFILE_PROFILE@
83@MAKEFILE_CHECKER@
84
85CODE= $(SRCS) $(MKCMDSFILES)
86
87MKCMDSOBJS=	mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o
88
89MKCMDSFILES=	mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l
90
91MKCMDSCSRCS=	mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c
92
93
94HFILES=	ss.h ss_internal.h
95SHARE_FILES= ct_c.awk ct_c.sed
96
97INSTALL_HFILES=	ss.h 
98
99# for 'tags' and dependencies
100
101CFILES=	$(SRCS) $(MKCMDSCSRCS) test_ss.c
102
103# for building archives
104
105FILES=	$(SRCS) $(MKCMDSFILES) $(HFILES) \
106	ss_err.et std_rqs.ct Makefile \
107	test_ss.c ss 
108
109all::	libss.a # libss_p.a lint
110
111std_rqs.c: std_rqs.ct mk_cmds
112	DIR=$(srcdir) $(MK_CMDS) $(srcdir)/std_rqs.ct
113
114ss_err.c ss_err.h: ss_err.et
115	$(COMPILE_ET) $(srcdir)/ss_err.et
116
117ct.tab.c ct.tab.h: ct.y
118	$(RM) -f ct.tab.* y.*
119	$(YACC) -d $(srcdir)/ct.y
120	$(MV) -f y.tab.c ct.tab.c
121	$(MV) -f y.tab.h ct.tab.h
122
123#libss.o:	$(OBJS)
124#	$(LD) -r -s -o $@ $(OBJS)
125#	$(CHMOD) -x $@
126
127mk_cmds: $(DEP_SUBSTITUTE) $(srcdir)/mk_cmds.sh.in
128	$(SUBSTITUTE) $(srcdir)/mk_cmds.sh.in mk_cmds
129	$(CHMOD) +x mk_cmds
130
131installdirs::
132	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
133		$(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss \
134		$(DESTDIR)$(bindir)
135
136install:: libss.a $(INSTALL_HFILES) installdirs ss_err.h mk_cmds
137	$(INSTALL_DATA) libss.a $(DESTDIR)$(libdir)/libss.a
138	$(CHMOD) 644 $(DESTDIR)$(libdir)/libss.a
139	-$(RANLIB) $(DESTDIR)$(libdir)/libss.a
140	$(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libss.a
141	$(RM) -f $(DESTDIR)$(includedir)/ss/*
142	for i in $(INSTALL_HFILES); do \
143		$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \
144	done
145	$(INSTALL_DATA) ss_err.h $(DESTDIR)$(includedir)/ss/ss_err.h
146	for i in $(SHARE_FILES); do \
147		$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(datadir)/ss/$$i; \
148	done
149	$(INSTALL) mk_cmds $(DESTDIR)$(bindir)/mk_cmds
150
151uninstall::
152	$(RM) -f $(DESTDIR)$(libdir)/libss.a $(DESTDIR)$(bindir)/mk_cmds
153	$(RM) -rf $(DESTDIR)$(includedir)/ss $(DESTDIR)$(datadir)/ss
154
155clean::
156	$(RM) -f ../libss.a libss.a mk_cmds ss_err.h ss_err.c std_rqs.c \
157		*.o *~ \#* *.bak core 
158
159mostlyclean:: clean
160distclean:: clean
161	$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old
162
163#
164# Hack to parallel makes recognize dependencies correctly.
165#
166$(top_builddir)/lib/ss/ss_err.h: ss_err.h
167
168# +++ Dependency line eater +++
169# 
170# Makefile dependencies follow.  This must be the last section in
171# the Makefile.in file
172#
173invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
174 $(top_builddir)/lib/ss/ss_err.h
175help.o: $(srcdir)/help.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
176 $(top_builddir)/lib/ss/ss_err.h
177execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
178 $(top_builddir)/lib/ss/ss_err.h
179listen.o: $(srcdir)/listen.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
180 $(top_builddir)/lib/ss/ss_err.h
181parse.o: $(srcdir)/parse.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
182 $(top_builddir)/lib/ss/ss_err.h
183error.o: $(srcdir)/error.c $(srcdir)/../et/com_err.h $(srcdir)/ss_internal.h \
184 $(srcdir)/ss.h $(top_builddir)/lib/ss/ss_err.h
185prompt.o: $(srcdir)/prompt.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
186 $(top_builddir)/lib/ss/ss_err.h
187request_tbl.o: $(srcdir)/request_tbl.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
188 $(top_builddir)/lib/ss/ss_err.h
189list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
190 $(top_builddir)/lib/ss/ss_err.h
191pager.o: $(srcdir)/pager.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
192 $(top_builddir)/lib/ss/ss_err.h
193requests.o: $(srcdir)/requests.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
194 $(top_builddir)/lib/ss/ss_err.h
195data.o: $(srcdir)/data.c $(srcdir)/ss_internal.h $(srcdir)/ss.h \
196 $(top_builddir)/lib/ss/ss_err.h
197