#
# source Makefile for ntcodec project
#
# 12.12.97, jw
#

TOP	= ..
include Machine.mk

#SUBDIRS	= audio grabber common display bitIn bitOut filter \
#	h263/decoder h263/encoder \
#	pyra/Codebooks pyra/decoder/HuffDecode pyra/decoder pyra/encoder \
#	PyramidUwe plugin
ifeq ($(ARCH),linux)
SUBDIRS	= common display bitIn bitOut filter \
	h263/decoder h263/encoder \
	pyra/Codebooks pyra/decoder/HuffDecode \
	pyra/decoder pyra/encoder \
	rtp/pyrapackdec rtp/pyra2rtp rt/checkpack
else
SUBDIRS	= common display bitIn bitOut filter openurl \
	h263/decoder h263/encoder \
	pyra/Codebooks pyra/decoder/HuffDecode
ifneq ($(WITHOUT_GRABBER),TRUE)
	SUBDIRS += grabber
endif
ifneq ($(WITHOUT_CHACODEC),TRUE)
	SUBDIRS += chacodec
endif
SUBDIRS += pyra/decoder pyra/encoder #pyra/addlayer
ifeq ($(MAKE_PYRA_UWE),TRUE)
	SUBDIRS += PyramidUwe
endif
ifeq ($(MAKE_PLUGIN),TRUE)
	SUBIDRS += plugin
endif
endif


all install-libs install complete proto depend:
	@echo Building $@ for Architecture $(ARCH)
ifneq ($(WITHOUT_JLIB),TRUE)
	(cd jlib; $(MAKE) install)
endif
	for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) $@ ) ; done

#
# clean
#
clean clean-all:
	@echo Cleaning for Architecture $(ARCH)
ifeq ($(MAKE_PYRA_UWE),TRUE)
	cd PyramidUwe/decoder; $(MAKE) -f Makefile.$(ARCH) clean
endif
ifneq ($(WITHOUT_GRABBER),TRUE)
	(cd grabber; $(MAKE) clean)
endif
ifneq ($(WITHOUT_CHACODEC),TRUE)
	(cd chacodec; $(MAKE) clean)
endif
ifneq ($(WITHOUT_JLIB),TRUE)
	(cd jlib; $(MAKE) clean)
endif
	for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) $@ ) ; done
ifdef $(MAKE_PLUGIN)
	( cd plugin; $(MAKE) clean )
endif
