]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/c++-lib/makefile
Security-54.1.7.tar.gz
[apple/security.git] / SecuritySNACCRuntime / c++-lib / makefile
1 # c++-lib/makefile
2 #
3 # makes C++ ASN.1 runtime library
4 #
5 # MS 92
6 #
7 # $Header: /cvs/root/Security/SecuritySNACCRuntime/c++-lib/Attic/makefile,v 1.1.1.1 2001/05/18 23:14:05 mb Exp $
8 # $Log: makefile,v $
9 # Revision 1.1.1.1 2001/05/18 23:14:05 mb
10 # Move from private repository to open source repository
11 #
12 # Revision 1.3 2000/12/22 00:04:15 dmitch
13 # Misc. updates for clean build on Cheetah 1D7.
14 #
15 # Revision 1.2 2000/05/10 23:38:06 rmurphy
16 # Updating makefile and install related files
17 #
18 # Revision 1.1.1.1 1999/03/16 18:05:58 aram
19 # Originals from SMIME Free Library.
20 #
21 # Revision 1.12 1997/03/13 09:15:05 wan
22 # Improved dependency generation for stupid makedepends.
23 # Corrected PeekTag to peek into buffer only as far as necessary.
24 # Added installable error handler.
25 # Fixed small glitch in idl-code generator (Markku Savela <msa@msa.tte.vtt.fi>).
26 #
27 # Revision 1.11 1997/02/16 16:48:25 rj
28 # made return *this after calling abort()'' a compile time option.
29 #
30 # Revision 1.10 1997/02/15 20:40:26 rj
31 # clean/clobber simplified, no recursive call
32 #
33 # Revision 1.9 1995/09/07 18:44:09 rj
34 # snacced.[hC] renamed into tcl-if.[hC],
35 # tkXAppInit.c lost its X.
36 #
37 # asn-useful.asn1 is compiled with the -l 50 option, as recommended by MS in the documentation.
38 #
39 # Revision 1.8 1995/07/27 08:33:31 rj
40 # make $(TCL-P) if necessary.
41 #
42 # actions for stamp-useful rule: call diff only if both input files exist.
43 #
44 # Revision 1.7 1995/07/24 15:52:59 rj
45 # changed `_' to `-' in file names.
46 #
47 # useful.asn1 renamed to asn-useful.asn1 to accomodate to snacc's new file name generation scheme.
48 #
49 # make tcl interface as determined thru the $(TCL-P) utility prog.
50 #
51 # `cd && make' instead of `cd; make'.
52 #
53 # create installation directories only if they do not exist already.
54 #
55 # call make recursively to generate the libraries different dependencies and concatenate them.
56 #
57 # Revision 1.6 1995/02/20 11:40:24 rj
58 # remove stamp-useful before removing asn-useful.[hC].
59 # distribute install-sh.
60 # use $(INSTALL*) in a for-loop as some install programs (namely the distributed install-sh) only process their first argument!
61 #
62 # Revision 1.5 1995/02/09 14:03:22 rj
63 # enforce generation of inc/asn-useful.h and src/asn-useful.cpp when making dependencies
64 #
65 # Revision 1.4 1994/10/08 05:27:31 rj
66 # don't distribute the non-bootstrapping version of asn-useful.[hc]
67 #
68 # Revision 1.3 1994/10/08 04:03:19 rj
69 # a new asn-useful.[Ch] get generated every time the compiler or asn-useful.asn1 changes.
70 #
71 # the Tcl interface needs a separate library because conditional compilation and virtual tables don't match otherwise.
72 #
73 # Revision 1.2 1994/08/31 23:28:41 rj
74 # DISTFILES and install phony target added.
75 #
76 # Revision 1.1 1994/08/28 09:20:22 rj
77 # first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
78 #
79
80 include ../makehead
81 include ../makehead.static
82
83 DEPENDENCIES =
84
85 TOP = ..
86
87 ASN1_SRC_DIR = $(TOP)/asn1specs
88
89 COMPILERDIR = $(TOP)/compiler
90 SNACC = $(COMPILERDIR)/snacc
91 USEFUL_TYPES = $(ASN1_SRC_DIR)/asn-useful.asn1
92
93 CPPFLAGS += -Iinc -I$(TOP) $(tcl_def) -F/System/Library/PrivateFrameworks
94
95 #
96 # hack around broken autoconf and missing makehead
97 #
98 RANLIB= /usr/bin/ranlib
99 TCL-P = $(TOP)/tcl-p
100
101 #- #ifdef _IBM_ENC_
102 #- # Base directory of snacc11
103 #- UserDir=/net/saturn/usr4/GLASS/tools
104 #- Snacc11Dir=$(UserDir)/snacc
105 #- #
106 #- # where ShmMgr is located
107 #- ShmMgrDir=/net/saturn/usr4/GLASS/tools/shmmgr
108 #- #
109 #- # Directories of the HeiTS
110 #- # needed to include *.h files and Libs.
111 #- HeiTSDir = /u/HeiTS
112 #- OSSDir = $(HeiTSDir)/oss
113 #- BMSDir = $(HeiTSDir)/bms
114 #- MEMDir = $(HeiTSDir)/memmgr
115 #- #
116 #- # my own .h files for OSS are located at
117 #- OwnOSSDir = $(UserDir)/include/HeiTS3.2.6/oss_aix
118 #- OwnMemMgrDir = $(UserDir)/include/HeiTS3.2.6/memmgr
119 #- #
120 #- # OSS include and define for compiling
121 #- # HeiTS 3.2.6
122 #- HeiTSIncDirs = -I$(OwnOSSDir) -I$(OwnMemMgrDir) -D__AIX_32__ -D__AIX__
123 #- # HeiTS 3.2.7
124 #- #HeiTSIncDirs = -I$(OwnOSSDir) -I$(OwnMemMgrDir) -D__ALL_SOURCE -D__AIX_32__ -DMMSERV -DDEBUG -DMAP_MANAGEMENT -DMHEG
125 #- #
126 #- LIB_HDR_DIR = $(Snacc11Dir)/cpp_incl
127 #-
128 #- CC = xlC
129 #- CFLAGS = -c -g -qchars=signed -+ -DIEEE_REAL_FMT -I$(LIB_HDR_DIR) -I$(ShmMgrDir) $(HeiTSIncDirs)
130 #- #endif /* _IBM_ENC_ */
131
132 HFILES.d = \
133 inc/asn-any.h \
134 inc/asn-bits.h \
135 inc/asn-bool.h \
136 inc/asn-buf.h \
137 inc/asn-config.h \
138 inc/asn-enum.h \
139 inc/asn-incl.h \
140 inc/asn-int.h \
141 inc/asn-len.h \
142 inc/asn-list.h \
143 inc/asn-null.h \
144 inc/asn-octs.h \
145 inc/asn-oid.h \
146 inc/asn-real.h \
147 inc/asn-tag.h \
148 inc/asn-type.h \
149 inc/hash.h \
150 inc/init.h \
151 inc/meta.h \
152 inc/print.h \
153 inc/tcl-if.h \
154 inc/str-stk.h
155
156 HFILES = \
157 $(HFILES.d) \
158 inc/asn-useful.h
159
160 HFILES.shared = \
161 $(TOP)/snacc.h \
162 $(TOP)/config.h \
163 $(TOP)/policy.h
164
165 CFILES.d = \
166 src/asn-any.cpp \
167 src/asn-bits.cpp \
168 src/asn-bool.cpp \
169 src/asn-enum.cpp \
170 src/asn-int.cpp \
171 src/asn-len.cpp \
172 src/asn-list.cpp \
173 src/asn-null.cpp \
174 src/asn-octs.cpp \
175 src/asn-oid.cpp \
176 src/asn-real.cpp \
177 src/asn-tag.cpp \
178 src/asn-type.cpp \
179 src/hash.cpp \
180 src/meta.cpp \
181 src/print.cpp \
182 src/tcl-if.cpp \
183 src/str-stk.cpp \
184 src/tkAppInit.c
185
186 CFILES = \
187 $(CFILES.d) \
188 src/asn-useful.cpp
189
190 d = src
191
192 OFILES = \
193 $d/asn-any.o \
194 $d/asn-bits.o \
195 $d/asn-bool.o \
196 $d/asn-enum.o \
197 $d/asn-int.o \
198 $d/asn-len.o \
199 $d/asn-list.o \
200 $d/asn-null.o \
201 $d/asn-octs.o \
202 $d/asn-oid.o \
203 $d/asn-real.o \
204 $d/asn-tag.o \
205 $d/asn-type.o \
206 $d/asn-useful.o \
207 $d/hash.o \
208 $d/meta.o \
209 $d/print.o \
210 $d/tcl-if.o \
211 $d/str-stk.o \
212 $d/tkAppInit.o
213
214 DISTFILES = \
215 README \
216 makefile \
217 $(HFILES.d) \
218 $(CFILES.d)
219
220 LIB = libasn1c++.a
221
222 #-------------------------------------------------------------------------------
223
224 default:: c++-lib tcl-lib
225
226 d = dummy
227
228 $d:: $(CFILES)
229
230 $d::
231 test -d $@ || mkdir $@
232 $(RM) $@/*.[Cc] $@/*.cpp
233 ln $(CFILES) $@
234
235 .PHONY: ofiles lib
236 .PHONY: c++-lib tcl-lib
237
238 ofiles: $(OFILES)
239
240 lib: libasn1$d.a
241
242 c++-lib:
243 $(MAKE) d=c++ c++ ofiles lib tcl_def=-DMETA=0
244
245 tcl-lib:: $(TCL-P)
246
247 tcl-lib::
248 if $(TCL-P); then $(MAKE) d=tcl tcl ofiles lib tcl_def=-DTCL; fi
249
250 libasn1c++.a \
251 libasn1tcl.a: $(OFILES)
252 $(AR) rv $@ $?
253 $(RANLIB) $@
254
255 #$(LIB):: $(CFILES)
256
257 inc/asn-useful.h \
258 src/asn-useful.cpp: stamp-useful
259
260 stamp-useful: $(SNACC) $(USEFUL_TYPES) $(TCL-P)
261 if $(TCL-P); then\
262 $(SNACC) -C $(SNACC_NOVOLAT) -l 50 -tcl "" $(USEFUL_TYPES);\
263 $(RM) modules.cpp;\
264 else\
265 $(SNACC) -C $(SNACC_NOVOLAT) -l 50 $(USEFUL_TYPES);\
266 fi
267 # the dates in the two files will differ, so the files really differ if diff prints more than 4 lines of output:
268 @if [ ! -f inc/asn-useful.h ] || [ `diff asn-useful.h inc/asn-useful.h | wc -l` -gt 4 ]; then\
269 mv asn-useful.h inc/asn-useful.h;\
270 else\
271 echo "asn-useful.h hasn't changed";\
272 $(RM) asn-useful.h;\
273 fi
274 @if [ ! -f src/asn-useful.cpp ] || [ `diff asn-useful.cpp src/asn-useful.cpp | wc -l` -gt 4 ]; then\
275 mv asn-useful.cpp src/asn-useful.cpp;\
276 else\
277 echo "asn-useful.cpp hasn't changed";\
278 $(RM) asn-useful.cpp;\
279 fi
280 date > $@
281
282 $(SNACC):
283 cd $(@D) && $(MAKE) $(@F)
284
285 install-sh:
286 ln $(TOP)/install-sh $@
287
288 $(incdir)/snacc/c++ $(libexecdir):
289 $(TOP)/mkinstalldirs $@
290
291 install:: $(HFILES) c++-lib tcl-lib install-sh $(incdir)/snacc/c++ $(libexecdir)
292
293 install::
294 for h in $(HFILES) $(HFILES.shared); do $(INSTALL_DATA) $$h $(incdir)/snacc/c++/; done
295 for l in $(LIB); do $(INSTALL_DATA) $$l $(libexecdir)/; $(RANLIB) -t $(libexecdir)/$$l; done
296 if [ $d != tcl ]; then $(MAKE) LIB=libasn1tcl.a d=tcl $@; fi
297
298 clean::
299 $(RM) stamp-useful
300 $(RM) asn-useful.h inc/asn-useful.h
301 $(RM) asn-useful.cpp src/asn-useful.cpp
302 $(RM) $(OFILES)
303 $(RM) -r c++ tcl
304 $(RM) *.o *~ .emacs* core
305
306 clobber::
307 $(RM) libasn1c++.a
308 $(RM) libasn1tcl.a
309 $(RM) install-sh
310
311 depend:: inc/asn-useful.h src/asn-useful.cpp
312
313 depend::
314 if [ x"$(DEPENDENCIES)" = x ]; then\
315 $(MAKE) d=c++ c++ DEPENDENCIES=deps.c++ depend;\
316 if $(TCL-P); then\
317 $(MAKE) d=tcl tcl tcl_def=-DTCL DEPENDENCIES=deps.tcl depend;\
318 fi;\
319 cp /dev/null dependencies;\
320 for dir in c++ tcl; do\
321 < deps.$$dir sed -e "s/^src/$$dir/;s/^[a-z-]*\.o:/$$dir\/&/" >> dependencies;\
322 $(RM) deps.$$dir;\
323 done;\
324 fi
325
326 include ../maketail