headers := $(wildcard include/*.h)

libsg.a: include/sg.h
	$(MAKE)  -C src

opt: include/sg.h
	$(MAKE) CXX="g++ -O3" CC="gcc -O3" -C src

include/sg.h:	$(headers)
	cd include; rm -f sg.h;((sh make-sg_h) > sg.h)


tests: libsg.a
	$(MAKE)  -C tests

clean:
	@$(MAKE) -s -C src clean
	@$(MAKE) -s -C tests clean