1 # c++-examples/any/makefile
3 # WARNING: this makefile isn't safe for parallel making!
5 # builds the C++ ANY example
9 # $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/c++-examples/any/makefile,v 1.1.1.1 2001/05/18 23:14:05 mb Exp $
11 # Revision 1.1.1.1 2001/05/18 23:14:05 mb
12 # Move from private repository to open source repository
14 # Revision 1.3 2000/12/22 00:03:01 dmitch
15 # Misc. updates for clean build on Cheetah 1D7.
17 # Revision 1.2 2000/06/08 19:58:44 dmitch
20 # Revision 1.1.1.1 1999/03/16 18:05:57 aram
21 # Originals from SMIME Free Library.
23 # Revision 1.9 1997/02/16 16:47:46 rj
24 # made return *this after calling abort()'' a compile time option.
26 # Revision 1.8 1995/07/24 15:29:07 rj
27 # useful.asn1 renamed to asn-useful.asn1 to accomodate to snacc's new file name generation scheme.
28 # any-test.[hC] becomes any.[hC] due to to snacc's new file name generation scheme.
30 # `cd && make' instead of `cd; make'.
32 # changed `_' to `-' in file names.
34 # Revision 1.7 1995/02/20 11:46:19 rj
35 # build snacc if it doesn't exist.
36 # some makes leave a trailing slash on $(@D), others don't. this causes some mkdir(1)s to deny their cooperation. therefore, the slash has got to be stripped.
38 # Revision 1.6 1995/02/13 14:58:12 rj
39 # augment CPPFLAGS, not overwrite
41 # Revision 1.5 1994/10/08 04:35:42 rj
42 # enhance portability by using standard make capabilities instead of utilies (basename, dirname) not found on every platform.
44 # for the dependencies, generate the snacc compiler if it doesn't exist.
46 # Revision 1.4 1994/09/01 02:26:53 rj
47 # use CXX instead of CC to get another default linkage
49 # Revision 1.3 1994/08/31 21:38:34 rj
50 # rebuild the executables when the c++-lib is newer.
52 # Revision 1.2 1994/08/31 10:31:47 rj
53 # since .o files get moved, a few more dependencies are needed.
55 # Revision 1.1 1994/08/31 08:48:03 rj
56 # first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
59 include ../../makehead
63 ASN1_SRC_DIR = $(TOP)/asn1specs
65 ASN1_C++_LIB_DIR = $(TOP)/c++-lib
66 BUILD_DIR = /Data_and_Apps/dmitchBuild
67 ASN1_C++_INC_DIR = $(ASN1_C++_LIB_DIR)/inc
68 ASN1_C++_LIB = $(ASN1_C++_LIB_DIR)/libasn1c++.a -framework cdsa_utilities -F/System/Library/PrivateFrameworks
69 #ASN1_C++_LIB = $(BUILD_DIR)/libsnacc++.a
70 #ASN1_C++_LIB = -framework snaccRuntime -F/Data_and_Apps/dmitchBuild -lstdc++
72 COMPILERDIR = $(TOP)/compiler
73 SNACC = $(COMPILERDIR)/snacc
74 USEFUL_TYPES = $(ASN1_SRC_DIR)/asn-useful.asn1
75 SNACCFLAGS = -C $(SNACC_NOVOLAT) -u $(USEFUL_TYPES)
78 CPPFLAGS += -I$(TOP) -I$(ASN1_C++_INC_DIR) $(LENFLAG) -DVDADER_RULES -F/System/Library/PrivateFrameworks
80 ASN1FILES = $(ASN1_SRC_DIR)/any.asn1
82 # generated by snacc from any.asn1:
95 #-------------------------------------------------------------------------------
97 all:: genber def indef
100 $(ASN1CFILES): $(SNACC) $(ASN1FILES)
102 $(SNACC) $(SNACCFLAGS) $(ASN1FILES)
105 cd $(@D) && $(MAKE) $(@F)
114 $(MAKE) LENFLAG= `echo $(@D) | sed -e 's:/$$::'` $(@F)
120 $(MAKE) LENFLAG=-DUSE_INDEF_LEN `echo $(@D) | sed -e 's:/$$::'` $(@F)
123 genber: def-obj/any.o genber.o
125 $(CC) $(LDFLAGS) -o $@ def-obj/any.o genber.o $(ASN1_C++_LIB) $(LIBS) -lstdc++
127 def: def-obj/any.o def-obj/example.o
129 $(CC) $(LDFLAGS) -o $@ def-obj/any.o def-obj/example.o $(ASN1_C++_LIB) $(LIBS) -lstdc++
131 indef: indef-obj/any.o indef-obj/example.o
133 $(CC) $(LDFLAGS) -o $@ indef-obj/any.o indef-obj/example.o $(ASN1_C++_LIB) $(LIBS) -lstdc++
141 check:: genber def indef
142 $(RM) foo.ber bar.ber
144 ./indef att.ber > foo.ber
145 ./def foo.ber > bar.ber
147 @if cmp -s bar.ber att.ber; then\
148 echo "+++ Passed simple encode/decode tests using any.asn1.";\
150 echo "--- Failed simple encode/decode tests using any.asn1.";\
153 $(RM) foo.ber bar.ber
156 $(RM) *.o *~ .emacs* core def indef genber att.ber $(ASN1HFILES) $(ASN1CFILES)
157 $(RM) -r def-obj indef-obj
158 $(RM) foo.ber bar.ber
162 include ../../maketail
166 for dir in def-obj indef-obj; do\
167 < dependencies sed -e 's:^\(.*\.o\):'"$$dir"'/\1:' >> deps;\