#
#  Builds and installs the snacc ASN.1 compiler and libraries.
#
#  MS 92
#

# create compiler, build  C runtime lib archive, then junks .o's etc
c:
	make compiler
	make clib
	make clean
	echo "finished install"

# create compiler, build  C++ runtime lib archive, then junks .o's etc
c++:
	make compiler
	make c++lib
	make clean
	echo "finished install"

# create compiler, build C and C++ runtime lib archive, then junks .o's etc
both:
	make compiler
	make clib
	make c++lib
	make clean
	echo "finished install"

# make C runtime library
clib:
	cd c_lib; make
	echo "snacc C lib is installed"

# make C++ runtime library
c++lib:
	cd c++_lib; make
	echo "snacc C++ lib is installed"

# make ASN.1 compiler
compiler:
	cd src; make
	echo "snacc compiler is installed"

# removes all object files, and other junk
# in library, src and example directories
clean:
	cd src; make clean
	cd c_lib; make clean
	cd c++_lib; make clean
	cd c_examples/simple; make clean
	cd c_examples/snmp; make clean
	cd c_examples/test_lib; make clean
	cd c_examples/any; make clean
	cd c++_examples/simple; make clean
	cd c++_examples/snmp; make clean
	cd c++_examples/any; make clean
	cd c++_examples/test_lib; make clean
	cd doc; make clean
	rm -f *~ .emacs* 
	cd c_include; rm -f *~ .emacs* 
	cd c++_include; rm -f *~ .emacs* 
	cd asn1specs; rm -f *~ .emacs* 
	cd bin; rm -f *~ .emacs* 



# removes junk files and executables, then tars and compresses
# all of the snacc compiler release into file called ../snacc.tar.Z 
#
tar:
	make clean
	rm -f bin/snacc c_lib/*.a c++_lib/*.a
	cd ..; tar -cvf - snacc | compress > snacc.tar.Z



