# MakeFile for QuakeTools

.PHONY:  default profile coverage branch all utils install ansi test \
	clean cleanprofile cleancoverage cleanall distclean backup restore

default profile coverage all clean cleanprofile \
cleancoverage cleanall branch utils %:
	cd ./libqtools; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqbuild; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqdisplay; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqsys; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./util; $(MAKE) -$(MAKEFLAGS) $@;

test:
	cd ./util; $(MAKE) -$(MAKEFLAGS) $@;

distclean: cleanall
	rm -f @top_srcdir@/src/include/config.h
	rm -f Makefile Makefile-rules

backup: Makefile
	cp Makefile Makefile.bak
	cp Makefile-rules Makefile-rules.bak
	cp ./include/config.h ./include/config.bak
	cd ./libqtools; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqbuild; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqdisplay; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqsys; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./util; $(MAKE) -$(MAKEFLAGS) $@;
restore: Makefile.bak
	cp Makefile.bak Makefile
	rm Makefile.bak
	cp Makefile-rules.bak Makefile-rules
	rm Makefile-rules.bak
	cp ./include/config.bak ./include/config.h
	rm ./include/config.bak
	cd ./libqtools; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqbuild; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqdisplay; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./libqsys; $(MAKE) -$(MAKEFLAGS) $@;
	cd ./util; $(MAKE) -$(MAKEFLAGS) $@;
