1 # c-examples/any/makefile
3 # WARNING: this makefile isn't safe for parallel making!
5 # compile the any example
9 # $Header: /cvs/root/Security/SecuritySNACCRuntime/c-examples/any/Attic/makefile,v 1.1.1.1 2001/05/18 23:14:07 mb Exp $
11 # Revision 1.1.1.1 2001/05/18 23:14:07 mb
12 # Move from private repository to open source repository
14 # Revision 1.1.1.1 1999/03/16 18:06:08 aram
15 # Originals from SMIME Free Library.
17 # Revision 1.6 1995/07/24 20:42:31 rj
18 # useful.asn1 renamed to asn-useful.asn1 to accomodate to snacc's new file name generation scheme.
19 # any-test.[hc] becomes any.[hc] due to to snacc's new file name generation scheme.
21 # `cd && make' instead of `cd; make'.
23 # changed `_' to `-' in file names.
25 # Revision 1.5 1995/02/20 11:51:39 rj
26 # build snacc if it doesn't exist.
27 # 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.
29 # Revision 1.4 1995/02/13 15:05:05 rj
30 # augment CPPFLAGS, not overwrite.
31 # use $(@D) and $(@F) instead of `dirname $@` and `basename $@` (not every system's got the commands).
32 # we need the compiler for the dependencies, so make it if it doesn't yet exist.
34 # Revision 1.3 1994/08/31 21:41:37 rj
35 # rebuild the executables when the c-lib is newer.
37 # Revision 1.2 1994/08/31 10:31:49 rj
38 # since .o files get moved, a few more dependencies are needed.
40 # Revision 1.1 1994/08/31 08:46:20 rj
41 # first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
44 include ../../makehead
48 ASN1_SRC_DIR = $(TOP)/asn1specs
50 ASN1_C_LIB_DIR = $(TOP)/c-lib
51 ASN1_C_INC_DIR = $(ASN1_C_LIB_DIR)/inc
52 ASN1_C_LIB = $(ASN1_C_LIB_DIR)/libasn1csbuf.a
54 COMPILERDIR = $(TOP)/compiler
55 SNACC = $(COMPILERDIR)/snacc
56 USEFUL_TYPES = $(ASN1_SRC_DIR)/asn-useful.asn1
57 SNACCFLAGS = -u $(USEFUL_TYPES)
59 CPPFLAGS += -I$(TOP) -I$(ASN1_C_INC_DIR) -DUSE_SBUF $(LENFLAG)
61 ASN1FILES = $(ASN1_SRC_DIR)/any.asn1
63 # generated by snacc from any.asn1:
76 #-------------------------------------------------------------------------------
78 all:: genber def indef
81 $(ASN1CFILES): $(SNACC) $(ASN1FILES)
83 $(SNACC) $(SNACCFLAGS) $(ASN1FILES)
86 cd $(@D) && $(MAKE) $(@F)
95 $(MAKE) LENFLAG= `echo $(@D) | sed -e 's:/$$::'` $(@F)
101 $(MAKE) LENFLAG=-DUSE_INDEF_LEN `echo $(@D) | sed -e 's:/$$::'` $(@F)
104 genber: def-obj/any.o genber.o
106 $(CC) $(LDFLAGS) -o $@ def-obj/any.o genber.o $(ASN1_C_LIB) $(LIBS)
108 def: def-obj/any.o def-obj/example.o
110 $(CC) $(LDFLAGS) -o $@ def-obj/any.o def-obj/example.o $(ASN1_C_LIB) $(LIBS)
112 indef: indef-obj/any.o indef-obj/example.o
114 $(CC) $(LDFLAGS) -o $@ indef-obj/any.o indef-obj/example.o $(ASN1_C_LIB) $(LIBS)
122 check:: genber def indef
123 $(RM) foo.ber bar.ber
125 ./indef att.ber > foo.ber
126 ./def foo.ber > bar.ber
128 @if cmp -s bar.ber att.ber; then\
129 echo "+++ Passed simple encode/decode tests using any.asn1.";\
131 echo "--- Failed simple encode/decode tests using any.asn1.";\
134 $(RM) foo.ber bar.ber
137 $(RM) *.o *~ .emacs* core def indef genber att.ber $(ASN1HFILES) $(ASN1CFILES)
138 $(RM) -r def-obj indef-obj
139 $(RM) foo.ber bar.ber
143 include ../../maketail
147 for dir in def-obj indef-obj; do\
148 < dependencies sed -e 's:^\(.*\.o\):'"$$dir"'/\1:' >> deps;\