SUBDIRS = examples src 

PLATFORMS = linux-gcc freebsd-gcc solaris-gcc solaris-cc 

ALL: library $(SUBDIRS) 

$(SUBDIRS):  FORCE
	(cd $@; $(MAKE))

lib: 
	mkdir lib; chmod u+rw lib

library: lib src

staticlib:
	(cd src; make staticlib)

clean:
	rm -f include/moc_*
	(for i in $(SUBDIRS); do cd $$i; $(MAKE) clean; cd ..; done)

tmake:
	(cd src; tmake -o Makefile Makefile.pro )
	(cd examples; $(MAKE) tmake )
	(cd apps/linux; $(MAKE) tmake )

no-tmake:
	rm -f include/moc_*
	(cd src; cp Makefile.orig Makefile )
	(cd examples; $(MAKE) no-tmake )
	(cd apps/linux; $(MAKE) no-tmake )

$(PLATFORMS): no-tmake
	cp makefiles/$@/Makefile.* .

FORCE:
