1 # c++-examples/simple/makefile
3 # WARNING: this makefile isn't safe for parallel making!
5 # $Header: /cvs/root/Security/SecuritySNACCRuntime/c++-examples/simple/Attic/makefile,v 1.1.1.1 2001/05/18 23:14:05 mb Exp $
7 # Revision 1.1.1.1 2001/05/18 23:14:05 mb
8 # Move from private repository to open source repository
10 # Revision 1.2 2000/06/08 19:59:04 dmitch
13 # Revision 1.1.1.1 1999/03/16 18:05:57 aram
14 # Originals from SMIME Free Library.
16 # Revision 1.9 1997/02/16 16:47:58 rj
17 # made return *this after calling abort()'' a compile time option.
19 # Revision 1.8 1995/07/24 15:29:44 rj
20 # `cd && make' instead of `cd; make'.
22 # changed `_' to `-' in file names.
24 # Revision 1.7 1995/02/20 11:47:37 rj
25 # build snacc if it doesn't exist.
26 # 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.
28 # Revision 1.6 1995/02/13 14:58:14 rj
29 # augment CPPFLAGS, not overwrite
31 # Revision 1.5 1994/10/08 04:35:59 rj
32 # enhance portability by using standard make capabilities instead of utilies (basename, dirname) not found on every platform.
34 # for the dependencies, generate the snacc compiler if it doesn't exist.
36 # Revision 1.4 1994/09/01 02:26:54 rj
37 # use CXX instead of CC to get another default linkage
39 # Revision 1.3 1994/08/31 21:40:00 rj
40 # rebuild the executables when the c++-lib is newer.
41 # the file good-pr.ber needs to be distributed.
43 # Revision 1.2 1994/08/31 10:31:50 rj
44 # since .o files get moved, a few more dependencies are needed.
46 # Revision 1.1 1994/08/31 08:48:10 rj
47 # first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
50 include ../../makehead
54 ASN1_SRC_DIR = $(TOP)/asn1specs
56 ASN1_C++_LIB_DIR = $(TOP)/c++-lib
57 BUILD_DIR = /Data_and_Apps/dmitchBuild
58 ASN1_C++_INC_DIR = $(ASN1_C++_LIB_DIR)/inc
59 #ASN1_C++_LIB = $(ASN1_C++_LIB_DIR)/libasn1c++.a
60 #ASN1_C++_LIB = $(BUILD_DIR)/libsnacc++.a
61 ASN1_C++_LIB = -framework snaccRuntime -F/Data_and_Apps/dmitchBuild -lstdc++
63 COMPILERDIR = $(TOP)/compiler
64 SNACC = $(COMPILERDIR)/snacc
65 USEFUL_TYPES = $(ASN1_SRC_DIR)/asn-useful.asn1
66 SNACCFLAGS = -C $(SNACC_NOVOLAT) -u $(USEFUL_TYPES)
69 CPPFLAGS += -I$(TOP) -I$(ASN1_C++_INC_DIR) $(LENFLAG)
71 ASN1FILES = $(ASN1_SRC_DIR)/p-rec.asn1
73 # generated by snacc from p-rec.asn1:
75 ASN1CFILES = p-rec.cpp
87 #-------------------------------------------------------------------------------
89 all:: genber def indef
92 $(ASN1CFILES): $(SNACC) $(ASN1FILES)
94 $(SNACC) $(SNACCFLAGS) $(ASN1FILES)
97 cd $(@D) && $(MAKE) $(@F)
106 $(MAKE) LENFLAG= `echo $(@D) | sed -e 's:/$$::'` $(@F)
112 $(MAKE) LENFLAG=-DUSE_INDEF_LEN `echo $(@D) | sed -e 's:/$$::'` $(@F)
115 genber: def-obj/p-rec.o genber.o
117 $(CXX) $(LDFLAGS) -o $@ def-obj/p-rec.o genber.o $(ASN1_C++_LIB) $(LIBS)
119 def: def-obj/p-rec.o def-obj/example.o
121 $(CXX) $(LDFLAGS) -o $@ def-obj/p-rec.o def-obj/example.o $(ASN1_C++_LIB) $(LIBS)
123 indef: indef-obj/p-rec.o indef-obj/example.o
125 $(CXX) $(LDFLAGS) -o $@ indef-obj/p-rec.o indef-obj/example.o $(ASN1_C++_LIB) $(LIBS)
134 $(RM) foo.ber bar.ber
135 ./indef good-pr.ber > foo.ber
136 ./def foo.ber > bar.ber
137 @if cmp -s bar.ber good-pr.ber; then\
138 echo "+++ Passed simple encode/decode tests using p-rec.asn1.";\
140 echo "--- Failed simple encode/decode tests using p-rec.asn1.";\
142 $(RM) foo.ber bar.ber
145 $(RM) *.o *~ .emacs* core def indef genber pr.ber $(ASN1HFILES) $(ASN1CFILES)
146 $(RM) -r def-obj indef-obj
147 $(RM) foo.ber bar.ber
151 include ../../maketail
155 for dir in def-obj indef-obj; do\
156 < dependencies sed -e 's:^\(.*\.o\):'"$$dir"'/\1:' >> deps;\