#------------------------------------------------------------------------------
# Libraries
#------------------------------------------------------------------------------

SHELL=/bin/sh

lib: .license
	@if [ -f .license ]; then cd src;  $(MAKE) -i FLAGS=-O; fi

lib_g: .license
	@if [ -f .license ]; then cd src;  $(MAKE) -i FLAGS="-g -ggdb"; fi

lib_go: .license
	@if [ -f .license ]; then cd src;  $(MAKE) -i FLAGS="-g -O"; fi

lib_w: .license
	@if [ -f .license ]; then cd src;  $(MAKE) -i FLAGS=-Wall; fi


leda: .license
	@if [ -f .license ]; then cd sources;  $(MAKE); fi


touch: .license
	@if [ -f .license ]; then cd src;  $(MAKE) -i touch; fi

.license:
	@confdir/util/unix/license.sh



#------------------------------------------------------------------------------
# Programs
#------------------------------------------------------------------------------

Test:
	cd test; $(MAKE) -i FLAGS=-O

Test_g:
	cd test; $(MAKE) -i FLAGS='-g -ggdb'

Test_g0:
	cd test; $(MAKE) -i FLAGS='-g -O'


#------------------------------------------------------------------------------
# Demos
#------------------------------------------------------------------------------

Demo:
	cd demo; $(MAKE) -i FLAGS=-O

Demo_g:
	cd demo; $(MAKE) -i FLAGS='-g -ggdb'



#------------------------------------------------------------------------------
# Libraries & Programs
#------------------------------------------------------------------------------

all: lib Test Demo

all_g: lib_g Test_g Demo_g



#------------------------------------------------------------------------------
# Cleaning up
#------------------------------------------------------------------------------

del: clean
	rm -f lib*.a lib*.so

clean:
	cd src;  $(MAKE) -i clean
	cd test; $(MAKE) -i clean
	cd demo; $(MAKE) -i clean

