
# This is the master makefile for VoxBo and the database project

# For best results, edit the following to taste.  They are passed down
# to the lower makefiles.

# binary directory
ROOTDIR ?= /usr/local/VoxBo
BINDIR ?= $(ROOTDIR)/bin
PRODIR ?= $(ROOTDIR)/pros
FFDIR ?= $(ROOTDIR)/etc/fileformats

# Here are our targets

COMMANDLINEDIRS = fileformats munge stats crunch stand_alone utils resample gdscript scheduler scripts
GUIDIRS = qtwidgets qtglm vbview
VOXBODIRS = $(COMMANDLINEDIRS) $(GUIDIRS)
INSTALLDIRS = $(COMMANDLINEDIRS) $(GUIDIRS)
MAKEDIRS = lib $(VOXBODIRS)
CLEANDIRS = $(MAKEDIRS)

# PHONY declaration makes life easier
.PHONY: clean install subdirs lib nogui voxbo $(VOXBODIRS)

subdirs: lib $(VOXBODIRS)

nogui: $(COMMANDLINEDIRS)

voxbo: $(VOXBODIRS)

$(MAKEDIRS):
	+make -C $@

install:
	mkdir -p $(BINDIR)
	+for dir in $(INSTALLDIRS) ; do make -C $$dir install ; done

clean:
	+for dir in $(CLEANDIRS) ; do make -C $$dir clean ; done
	rm -f core *~ */*~ */core */*.o
	rm -f bins/*

# lib must precede all

crunch: lib

scheduler: lib

munge: lib

vbdl: lib

stand_alone: lib

utils: lib

resample: lib

gdscript: lib

fileformats: lib

dlm: lib

qtglm: lib qtwidgets utils

vbview: lib qtwidgets

vbsequence: lib

client: lib qtwidgets vbview

server: lib
