prefix    = @ac_prefix@

name      = samplv1

name_ui   = $(name)_ui

name_lv2  = $(name)_lv2
name_jack = $(name)_jack

headers = \
	src/config.h \
	src/$(name).h \
	src/$(name)_fx.h \
	src/$(name)_filter.h \
	src/$(name)_formant.h \
	src/$(name)_resampler.h \
	src/$(name)_reverb.h \
	src/$(name)_ramp.h \
	src/$(name)_sample.h \
	src/$(name)_wave.h \
	src/$(name)_list.h \
	src/$(name)_config.h \
	src/$(name)_param.h \
	src/$(name)_sched.h \
	src/$(name)_programs.h \
	src/$(name)_controls.h

sources = \
	src/$(name).cpp \
	src/$(name)_sample.cpp \
	src/$(name)_wave.cpp \
	src/$(name)_config.cpp \
	src/$(name)_formant.cpp \
	src/$(name)_resampler.cpp \
	src/$(name)_param.cpp \
	src/$(name)_sched.cpp \
	src/$(name)_programs.cpp \
	src/$(name)_controls.cpp

headers_ui = \
	src/$(name)widget.h \
	src/$(name)widget_env.h \
	src/$(name)widget_filt.h \
	src/$(name)widget_param.h \
	src/$(name)widget_preset.h \
	src/$(name)widget_status.h \
	src/$(name)widget_sample.h \
	src/$(name)widget_config.h \
	src/$(name)widget_programs.h \
	src/$(name)widget_controls.h \
	src/$(name)widget_control.h

sources_ui = \
	src/$(name)widget.cpp \
	src/$(name)widget_env.cpp \
	src/$(name)widget_filt.cpp \
	src/$(name)widget_param.cpp \
	src/$(name)widget_preset.cpp \
	src/$(name)widget_status.cpp \
	src/$(name)widget_sample.cpp \
	src/$(name)widget_config.cpp \
	src/$(name)widget_programs.cpp \
	src/$(name)widget_controls.cpp \
	src/$(name)widget_control.cpp

forms = \
	src/$(name)widget.ui \
	src/$(name)widget_config.ui \
	src/$(name)widget_control.ui

resources = \
	src/$(name).qrc


headers_lv2 = \
	$(headers) \
	$(headers_ui) \
	src/$(name)_lv2.h \
	src/$(name)_param.h \
	src/$(name)widget_lv2.h

sources_lv2 = \
	$(sources) \
	$(sources_ui) \
	src/$(name)_lv2.cpp \
	src/$(name)widget_lv2.cpp


headers_jack = \
	$(headers) \
	$(headers_ui) \
	src/$(name)_nsm.h \
	src/$(name)_jack.h \
	src/$(name)_param.h \
	src/$(name)widget_jack.h

sources_jack = \
	$(sources) \
	$(sources_ui) \
	src/$(name)_nsm.cpp \
	src/$(name)_jack.cpp \
	src/$(name)widget_jack.cpp


export datadir = @ac_datadir@
export mandir = @ac_mandir@


export QMAKE = @ac_qmake@
export LUPDATE = @ac_lupdate@
export LRELEASE = @ac_lrelease@


all:	core ui @ac_all_targets@

core:	$(name).mak $(sources) $(headers)
	@$(MAKE) -f $(name).mak

ui:	$(name_ui).mak $(sources_ui) $(headers_ui) $(resources) ${forms}
	@$(MAKE) -f $(name_ui).mak

lv2:	$(name_lv2).mak $(sources_lv2) $(headers_lv2) ui core
	@$(MAKE) -f $(name_lv2).mak

jack:	$(name_jack).mak $(sources_jack) $(headers_jack) ui core
	@$(MAKE) -f $(name_jack).mak


$(name).mak:	$(name).pro
	@$(QMAKE) -o $(name).mak $(name).pro

$(name_ui).mak:	$(name_ui).pro
	@$(QMAKE) -o $(name_ui).mak $(name_ui).pro

$(name_lv2).mak:	$(name_lv2).pro
	@$(QMAKE) -o $(name_lv2).mak $(name_lv2).pro

$(name_jack).mak:	$(name_jack).pro
	@$(QMAKE) -o $(name_jack).mak $(name_jack).pro


install_core:	core
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name).mak install

install_ui:	ui
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name_ui).mak install

install_lv2:	lv2
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name_lv2).mak install

install_jack:	jack $(name).1
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name_jack).mak install
	@install -d -v -m 0755 $(DESTDIR)$(mandir)/man1
	@install -v -m 0644 $(name)*.1 $(DESTDIR)$(mandir)/man1
	@gzip -vf $(DESTDIR)$(mandir)/man1/$(name)*.1


uninstall_core:	core
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name).mak uninstall

uninstall_ui:	ui
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name_ui).mak uninstall

uninstall_lv2:	lv2
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name_lv2).mak uninstall

uninstall_jack:	jack
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name_jack).mak uninstall
	@rm -vf $(DESTDIR)$(mandir)/man1/$(name)*.1.gz


clean_core:	$(name).mak
	@$(MAKE) -f $(name).mak distclean
	@rm -f $(name).mak

clean_ui:	$(name_ui).mak
	@$(MAKE) -f $(name_ui).mak distclean
	@rm -f $(name_ui).mak

clean_lv2:	$(name_lv2).mak
	@$(MAKE) -f $(name_lv2).mak distclean
	@rm -f $(name_lv2).mak

clean_jack:	$(name_jack).mak
	@$(MAKE) -f $(name_jack).mak distclean
	@rm -f $(name_jack).mak


install:	install_core install_ui @ac_install_targets@

uninstall:	uninstall_core uninstall_ui @ac_uninstall_targets@

clean:	clean_core clean_ui @ac_clean_targets@
