SUBDIRS = lib test bash

all:	local

local:	.dev $(SUBDIRS)

lantronix: .dev-lx $(patsubst %,%-lx,$(SUBDIRS))

lx:	lantronix

.PHONY:	$(SUBDIRS) clean config

$(SUBDIRS):
	cd $@ && make local

$(patsubst %,%-lx,$(SUBDIRS)):
	cd $(subst -lx,,$@) && make lantronix

clean:
	rm -f lib/*.o lib/*.a
	rm -f test/freq test/rev test/xdemo test/dline
	rm -f test/freq-lx test/rev-lx test/dline-lx
	rm -f bash/freq bash/capture bash/pulse bash/signal
	rm -f bash/freq-lx bash/capture-lx bash/pulse-lx bash/signal-lx bash/list-lx

cleanall:	clean
	rm -f .dev .dev-lx
	rm -f bash/*cal*

config .dev:
	./config.sh

config-lx .dev-lx:
	./config-lx.sh

install:
	cp bash/capture bash/pulse bash/signal bash/freq /usr/bin
	cp bash/capture-lx bash/pulse-lx bash/signal-lx bash/freq-lx /usr/bin
