#
# Toplevel Makefile for the ntcodec-project
#
# jw, 12.12.97

# Targets:
#              : same as 'depend' + 'install'
# all          : same as 'depend' + 'install'
# proto        : the prototype files are generated by $(CPROTO)
# depend       : the dependencies are updated
# install-libs : compile all modules and move the libs to the lib dir
# install      : 'install-libs' + binaries are copied to the bin dir
# complete     : 'proto' + 'depend' + 'install'
# clean        : 'rm *~ *.o core' + libs and binaries in the src dirs
# clean-all    : 'clean' + libs in the lib dir + binaries in the bin dir
# tar          : 'clean-all' + tar the complete tree
#
# The above list is not yet implemented. Plugin generation and Compilation of 
# Uwe's source is not really integrated. Compilation of PyramidUwe/decoder works
# by selecting a $(ARCH) dependant Makefile in this directory. Integration is 
# expensive and has no benefit except beauty of the source tree.
# 
# Plugins for PyramidUwe/decoder and pyra/decoder are built by running the Makefile 
# in the plugin directory. This build is extremely slow and may exceed compiler 
# capacity on your machine. Integration is simple, but not desirable for the 
# normal developers compule cycle.
#
# Nevertheless, the following procedure is supposed to create all binaries and all
# plugins from scratch:
#
# cd .../NTCODEC
# vi Machine.mk		(select architecture: sun4.sos5 and sun4u.sos5 are well tested)
# gmake clean-all
# gmake
# cp bin/$(ARCH)/*Dec* /proj/i4www/IMMD-IV/Projects/ScalVico/arch.os/$(ARCH)/
#
# Mon Jun 15, 1998, jw:



TOP	= .
include Machine.mk

default: depend install
ifeq ($(MAKE_PYRA_UWE),TRUE)
	cd src/PyramidUwe/decoder; $(MAKE) -f Makefile.$(ARCH)
endif
ifeq ($(MAKE_PLUGIN),TRUE)
	cd src/plugin; $(MAKE) install
endif

all install-libs install clean proto depend complete:
	cd src; $(MAKE) $@

clean-all: clean
	rm -f lib/$(ARCH)/lib*.a
	rm -f lib/$(ARCH)/lib*.so
	rm -f bin/$(ARCH)/H263*
	rm -f bin/$(ARCH)/HP*
	rm -f bin/$(ARCH)/P*
	rm -f bin/$(ARCH)/np*.so

tar: clean-all
	tar cvf - bin lib src doc include Makefile Machine.mk*| gzip > ntcodec-src.tgz
tar-src: clean
	tar cvf - src doc include Makefile Machine.mk*| gzip > ntcodec-src.tgz

tar-bin: clean
	tar cvf - bin lib include | gzip > ntcodec-bin.tgz

tgz tar-all: clean-all
	rm -f ntcodec-src.tgz
	rm -f ntcodec-bin.tgz
	rm -f ntcodec.tgz
	(cd ..;tar cvf - NTCODEC | gzip > ntcodec.tgz)
