#master makefile

include Makefile-includes

all: ppc mips x86

ppc:
	make -f Makefile-ppc

mips:
	make -f Makefile-mips

x86:
	make -f Makefile-x86

distribution: 
	make all
	make distribution_only
	
distribution_only:
	make distribution_binaries
	make distribution_sources
	make -f Makefile-packages

distribution_binaries:
	rm -f rqcamd-$(VERSION)-binaries.tar.gz
	tar -cf rqcamd-$(VERSION)-binaries.tar rqcamd.ppc rqcamd.mips rqcamd.x86 rqcamd.conf rqcamd-readme.txt
	gzip rqcamd-$(VERSION)-binaries.tar
	
distribution_sources:
	rm -f rqcamd-$(VERSION)-sources.tar.gz
	tar -cf rqcamd-$(VERSION)-sources.tar *.cpp *.h rqcamd.conf rqcamd-readme.txt Makefile* webif/*.cpp webif/*.h webif/*.inc webif/Makefile* webif/content/*
	gzip rqcamd-$(VERSION)-sources.tar

clean:
	rm -f *.o
	rm -f rqcamd.ppc
	rm -f rqcamd.mips
	rm -f rqcamd.x86
	rm -f rqcamd-$(VERSION)-binaries.tar.gz
	rm -f rqcamd-$(VERSION)-sources.tar.gz
	rm -f rqcamd-$(VERSION)-packages.tar
	
	rm -f webif/*.o
	rm -f webif/rqsp-content.cpp
	cd webif; make -f Makefile-rqsp-preprocess clean;
