3 # Builds and installs the snacc ASN.1 compiler and libraries.
7 # $Header: /cvs/root/Security/SecuritySNACCRuntime/Attic/makefile,v 1.1.1.1 2001/05/18 23:14:04 mb Exp $
9 # Revision 1.1.1.1 2001/05/18 23:14:04 mb
10 # Move from private repository to open source repository
12 # Revision 1.3 2000/12/22 00:00:40 dmitch
13 # Add include makehead.static due to apparently broken autoconf, which now generates empty makehead file.
15 # Revision 1.2 2000/06/15 18:49:46 dmitch
16 # Trimmed EXAMPLESDIR to comply with reality.
18 # Revision 1.1.1.1 1999/03/16 18:05:49 aram
19 # Originals from SMIME Free Library.
21 # Revision 1.15 1997/08/27 15:53:11 wan
22 # Added generic table decoding, debug routines, berdecode, and asnwish.
24 # Revision 1.14 1997/03/03 11:58:26 wan
25 # Final pre-delivery stuff (I hope).
27 # Revision 1.13 1997/02/16 19:55:22 rj
28 # remove tcl-p when making clobber
30 # Revision 1.12 1997/02/16 18:30:33 rj
31 # correct path to configure script
33 # Revision 1.11 1997/02/16 16:52:05 rj
34 # generate tcl-p before it is needed...
36 # Revision 1.10 1997/02/15 20:33:33 rj
37 # trick to make making clean/clobber working with gmake: set MAKE_CLEAN_HACK (in makefile), and don't include the dependencies files (in maketail) if it is set.
39 # Revision 1.9 1995/07/26 21:16:56 rj
42 # Revision 1.8 1995/07/24 14:54:22 rj
43 # type table tools integrated.
45 # tiny .../tcl-p utility program that returns 0 if snacc's tcl interface is to be made.
47 # dummy action added to config.h.in and config.h rules to trick many makes' overoptimization.
49 # Revision 1.7 1995/02/22 09:49:07 rj
50 # turned the phony target `pack-tar' into a true target: $(VDIR).tar.gz.
52 # Revision 1.6 1995/02/20 11:21:27 rj
53 # use install-sh instead of install.sh.
54 # phony target distclean: don't remove the distributed file configure and stamp-h.in (they cannot be remade everywhere).
56 # Revision 1.5 1995/02/17 14:26:39 rj
57 # adjustments for autoconf 2.x
59 # Revision 1.4 1994/10/08 04:42:56 rj
60 # config.h.bot removed.
61 # snacc.h and policy.h added.
63 # Revision 1.3 1994/09/01 01:34:34 rj
64 # gen-distfiles phony target to generate up-to-date versions of the distfiles.
66 # Revision 1.2 1994/08/31 23:19:22 rj
67 # a lot of enhancements:
68 # - examples integrated, with some phony targets.
69 # - autoconf stuff gets automatically remade.
70 # - dependency boot strapping (some makes need it).
71 # - distributions via file list, therefore no need to clean the tree and to remove private files.
73 # Revision 1.1 1994/08/28 09:20:17 rj
74 # first check-in. for a list of changes to 1.1 please refer to the ChangeLog.
79 include makehead.static
81 SUBDIRS = compiler c-lib c++-lib tbl-tools asn1specs doc
82 XDIRS = tcl-lib tcl-asn
84 # Apple change: the tbl-example doesn't run properly; tcl-example doesn't build Skip them.
85 EXAMPLESDIRS = c-examples c++-examples
86 #EXAMPLESDIRS = c-examples c++-examples tbl-example tcl-example
92 configure.in configure \
93 acconfig.h config.h.in stamp-h.in \
96 makefile makehead.in maketail \
97 mkinstalldirs install-sh
99 #-------------------------------------------------------------------------------
101 .PHONY: default all subdirs $(SUBDIRS) examples $(EXAMPLESDIRS) $(XDIRS) depend c c++ check c-check c++-check install c-install c++-install clean clobber tar
103 default:: compiler c-lib c++-lib tbl-tools tcl-asn
106 $(TCL-P): tcl-p.c snacc.h config.h policy.h
108 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
110 depend $(SUBDIRS) $(EXAMPLESDIRS) $(XDIRS):: config.h version.h
112 # the following hack is needed for older make versions
113 # (gmake doesn't need it):
115 @for dir in $(SUBDIRS) tbl-example; do\
116 test -f $$dir/dependencies || touch $$dir/dependencies;\
118 @for dir in c-examples c++-examples; do\
119 (cd $$dir && $(MAKE) init-depend);\
122 depend install gen-distfiles::
123 $(MAKE) subdirs examples xdirs subtarget=$@
126 $(MAKE) subdirs examples xdirs subtarget=$@ MAKE_CLEAN_HACK=xyzzy
129 examples:: $(EXAMPLESDIRS)
133 cd $@ && $(MAKE) $(subtarget)
136 if $(TCL-P); then cd $@ && $(MAKE) $(subtarget); fi
140 if $(TCL-P); then cd $@ && $(MAKE) $(subtarget); fi
142 # compiler, C runtime libraries and type table tools:
143 c:: compiler c-lib tbl-tools tcl-asn
144 c-check:: c c-lib-check tbl-check
146 $(MAKE) c-examples subtarget=check
148 $(MAKE) tbl-example subtarget=check
150 $(MAKE) c asn1specs subtarget=install
152 # build compiler and C++ runtime library:
153 c++:: compiler c++-lib tcl-lib
156 $(MAKE) c++-examples subtarget=check
158 $(MAKE) c++ asn1specs subtarget=install
160 # create compiler, build C and C++ runtime lib archive, type table tools, run a few checks:
161 all:: compiler c-lib c++-lib tbl-tools tcl-asn check
163 check:: c-check c++-check
165 $(srcdir)/configure: configure.in
167 cd $(srcdir) && autoconf
169 # autoheader might not change config.h.in, so touch a stamp file
170 $(srcdir)/config.h.in: stamp-h.in
172 $(srcdir)/stamp-h.in: configure.in acconfig.h
174 cd ${srcdir} && autoheader
177 # config.status might not change config.h
180 stamp-h: config.h.in config.status
182 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
184 makehead: makehead.in config.status
186 CONFIG_FILES=makehead CONFIG_HEADERS= ./config.status
188 config.status: $(srcdir)/configure
190 ./config.status --recheck
193 $(RM) config.log config.cache config.status config.h stamp-h
196 gen-distfiles:: $(DISTFILES)
199 echo "$(DISTFILES)";\
200 for dir in $(SUBDIRS) $(EXAMPLESDIRS) $(XDIRS); do\
201 subfiles=`cd $$dir && $(MAKE) -s $@`;\
202 for file in $$subfiles; do\
203 echo "$$dir/$$file";\
210 vdir=snacc-`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' -e q version.h`;\
211 distfiles=`$(MAKE) -s distfiles ECHO=:`;\
212 for file in $$distfiles; do\
213 files="$$files $$vdir/$$file";\
215 [ -d $$vdir ] || ln -s . $$vdir;\
216 $(RM) $$vdir.tar.gz;\
217 gtar zcvvhf $$vdir.tar.gz $$files;\
221 # this one is for internal use only:
222 $(VDIR).tar.gz: $(FILES)
225 gtar zcvvhf $@ $(FILES)