prefix  = @ac_prefix@

name    = qtractor

target  = src/$(name)

headers = \
	src/config.h \
	src/qtractor.h \
	src/qtractorAbout.h \
	src/qtractorAtomic.h \
	src/qtractorActionControl.h \
	src/qtractorAudioBuffer.h \
	src/qtractorAudioClip.h \
	src/qtractorAudioConnect.h \
	src/qtractorAudioEngine.h \
	src/qtractorAudioFile.h \
	src/qtractorAudioListView.h \
	src/qtractorAudioMadFile.h \
	src/qtractorAudioMeter.h \
	src/qtractorAudioMonitor.h \
	src/qtractorAudioPeak.h \
	src/qtractorAudioSndFile.h \
	src/qtractorAudioVorbisFile.h \
	src/qtractorClip.h \
	src/qtractorClipCommand.h \
	src/qtractorClipSelect.h \
	src/qtractorComboBox.h \
	src/qtractorCommand.h \
	src/qtractorConnect.h \
	src/qtractorConnections.h \
	src/qtractorCtlEvent.h \
	src/qtractorCurve.h \
	src/qtractorCurveCommand.h \
	src/qtractorCurveFile.h \
	src/qtractorCurveSelect.h \
	src/qtractorDocument.h \
	src/qtractorDssiPlugin.h \
	src/qtractorEngine.h \
	src/qtractorEngineCommand.h \
	src/qtractorFileList.h \
	src/qtractorFileListView.h \
	src/qtractorFiles.h \
	src/qtractorFileSystem.h \
	src/qtractorInsertPlugin.h \
	src/qtractorInstrument.h \
	src/qtractorInstrumentMenu.h \
	src/qtractorLadspaPlugin.h \
	src/qtractorList.h \
	src/qtractorLv2Plugin.h \
	src/qtractorMessageBox.h \
	src/qtractorMessageList.h \
	src/qtractorMessages.h \
	src/qtractorMeter.h \
	src/qtractorMidiBuffer.h \
	src/qtractorMidiClip.h \
	src/qtractorMidiConnect.h \
	src/qtractorMidiControl.h \
	src/qtractorMidiControlObserver.h \
	src/qtractorMidiControlTypeGroup.h \
	src/qtractorMidiCursor.h \
	src/qtractorMidiEditor.h \
	src/qtractorMidiEditCommand.h \
	src/qtractorMidiEditEvent.h \
	src/qtractorMidiEditList.h \
	src/qtractorMidiEditSelect.h \
	src/qtractorMidiEditTime.h \
	src/qtractorMidiEditView.h \
	src/qtractorMidiEngine.h \
	src/qtractorMidiEvent.h \
	src/qtractorMidiEventList.h \
	src/qtractorMidiFile.h \
	src/qtractorMidiFileTempo.h \
	src/qtractorMidiListView.h \
	src/qtractorMidiManager.h \
	src/qtractorMidiMeter.h \
	src/qtractorMidiMonitor.h \
	src/qtractorMidiRpn.h \
	src/qtractorMidiSequence.h \
	src/qtractorMidiSysex.h \
	src/qtractorMidiThumbView.h \
	src/qtractorMidiTimer.h \
	src/qtractorMixer.h \
	src/qtractorMonitor.h \
	src/qtractorNsmClient.h \
	src/qtractorObserver.h \
	src/qtractorObserverWidget.h \
	src/qtractorOptions.h \
	src/qtractorPaletteForm.h \
	src/qtractorPlugin.h \
	src/qtractorPluginFactory.h \
	src/qtractorPluginCommand.h \
	src/qtractorPluginListView.h \
	src/qtractorPropertyCommand.h \
	src/qtractorRingBuffer.h \
	src/qtractorRubberBand.h \
	src/qtractorScrollView.h \
	src/qtractorSession.h \
	src/qtractorSessionCommand.h \
	src/qtractorSessionCursor.h \
	src/qtractorSpinBox.h \
	src/qtractorThumbView.h \
	src/qtractorTimeScale.h \
	src/qtractorTimeScaleCommand.h \
	src/qtractorTimeStretcher.h \
	src/qtractorTrack.h \
	src/qtractorTrackButton.h \
	src/qtractorTrackCommand.h \
	src/qtractorTrackList.h \
	src/qtractorTrackTime.h \
	src/qtractorTrackView.h \
	src/qtractorTracks.h \
	src/qtractorVstPlugin.h \
	src/qtractorVst3Plugin.h \
	src/qtractorWsolaTimeStretcher.h \
	src/qtractorZipFile.h \
	src/qtractorBusForm.h \
	src/qtractorClipForm.h \
	src/qtractorConnectForm.h \
	src/qtractorEditRangeForm.h \
	src/qtractorExportForm.h \
	src/qtractorInstrumentForm.h \
	src/qtractorMainForm.h \
	src/qtractorMidiControlForm.h \
	src/qtractorMidiControlObserverForm.h \
	src/qtractorMidiEditorForm.h \
	src/qtractorMidiSysexForm.h \
	src/qtractorMidiToolsForm.h \
	src/qtractorOptionsForm.h \
	src/qtractorPasteRepeatForm.h \
	src/qtractorPluginForm.h \
	src/qtractorPluginSelectForm.h \
	src/qtractorSessionForm.h \
	src/qtractorShortcutForm.h \
	src/qtractorTakeRangeForm.h \
	src/qtractorTempoAdjustForm.h \
	src/qtractorTimeScaleForm.h \
	src/qtractorTrackForm.h \
	src/qtractor_plugin_scan.h

sources = \
	src/qtractor.cpp \
	src/qtractorActionControl.cpp \
	src/qtractorAudioBuffer.cpp \
	src/qtractorAudioClip.cpp \
	src/qtractorAudioConnect.cpp \
	src/qtractorAudioEngine.cpp \
	src/qtractorAudioFile.cpp \
	src/qtractorAudioListView.cpp \
	src/qtractorAudioMadFile.cpp \
	src/qtractorAudioMeter.cpp \
	src/qtractorAudioMonitor.cpp \
	src/qtractorAudioPeak.cpp \
	src/qtractorAudioSndFile.cpp \
	src/qtractorAudioVorbisFile.cpp \
	src/qtractorClip.cpp \
	src/qtractorClipCommand.cpp \
	src/qtractorClipSelect.cpp \
	src/qtractorComboBox.cpp \
	src/qtractorCommand.cpp \
	src/qtractorConnect.cpp \
	src/qtractorConnections.cpp \
	src/qtractorCurve.cpp \
	src/qtractorCurveCommand.cpp \
	src/qtractorCurveFile.cpp \
	src/qtractorCurveSelect.cpp \
	src/qtractorDocument.cpp \
	src/qtractorDssiPlugin.cpp \
	src/qtractorEngine.cpp \
	src/qtractorEngineCommand.cpp \
	src/qtractorFileList.cpp \
	src/qtractorFileListView.cpp \
	src/qtractorFiles.cpp \
	src/qtractorFileSystem.cpp \
	src/qtractorInsertPlugin.cpp \
	src/qtractorInstrument.cpp \
	src/qtractorInstrumentMenu.cpp \
	src/qtractorLadspaPlugin.cpp \
	src/qtractorLv2Plugin.cpp \
	src/qtractorMessageBox.cpp \
	src/qtractorMessageList.cpp \
	src/qtractorMessages.cpp \
	src/qtractorMeter.cpp \
	src/qtractorMidiClip.cpp \
	src/qtractorMidiConnect.cpp \
	src/qtractorMidiControl.cpp \
	src/qtractorMidiControlObserver.cpp \
	src/qtractorMidiControlTypeGroup.cpp \
	src/qtractorMidiCursor.cpp \
	src/qtractorMidiEditor.cpp \
	src/qtractorMidiEditCommand.cpp \
	src/qtractorMidiEditEvent.cpp \
	src/qtractorMidiEditList.cpp \
	src/qtractorMidiEditSelect.cpp \
	src/qtractorMidiEditTime.cpp \
	src/qtractorMidiEditView.cpp \
	src/qtractorMidiEngine.cpp \
	src/qtractorMidiEventList.cpp \
	src/qtractorMidiFile.cpp \
	src/qtractorMidiFileTempo.cpp \
	src/qtractorMidiListView.cpp \
	src/qtractorMidiManager.cpp \
	src/qtractorMidiMeter.cpp \
	src/qtractorMidiMonitor.cpp \
	src/qtractorMidiRpn.cpp \
	src/qtractorMidiSequence.cpp \
	src/qtractorMidiThumbView.cpp \
	src/qtractorMidiTimer.cpp \
	src/qtractorMixer.cpp \
	src/qtractorNsmClient.cpp \
	src/qtractorObserver.cpp \
	src/qtractorObserverWidget.cpp \
	src/qtractorOptions.cpp \
	src/qtractorPlugin.cpp \
	src/qtractorPluginFactory.cpp \
	src/qtractorPluginCommand.cpp \
	src/qtractorPluginListView.cpp \
	src/qtractorRubberBand.cpp \
	src/qtractorScrollView.cpp \
	src/qtractorSession.cpp \
	src/qtractorSessionCommand.cpp \
	src/qtractorSessionCursor.cpp \
	src/qtractorSpinBox.cpp \
	src/qtractorThumbView.cpp \
	src/qtractorTimeScale.cpp \
	src/qtractorTimeScaleCommand.cpp \
	src/qtractorTimeStretcher.cpp \
	src/qtractorTrack.cpp \
	src/qtractorTrackButton.cpp \
	src/qtractorTrackCommand.cpp \
	src/qtractorTrackList.cpp \
	src/qtractorTrackTime.cpp \
	src/qtractorTrackView.cpp \
	src/qtractorTracks.cpp \
	src/qtractorVstPlugin.cpp \
	src/qtractorVst3Plugin.cpp \
	src/qtractorWsolaTimeStretcher.cpp \
	src/qtractorZipFile.cpp \
	src/qtractorBusForm.cpp \
	src/qtractorClipForm.cpp \
	src/qtractorConnectForm.cpp \
	src/qtractorEditRangeForm.cpp \
	src/qtractorExportForm.cpp \
	src/qtractorInstrumentForm.cpp \
	src/qtractorMainForm.cpp \
	src/qtractorMidiControlForm.cpp \
	src/qtractorMidiControlObserverForm.cpp \
	src/qtractorMidiEditorForm.cpp \
	src/qtractorMidiSysexForm.cpp \
	src/qtractorMidiToolsForm.cpp \
	src/qtractorOptionsForm.cpp \
	src/qtractorPaletteForm.cpp \
	src/qtractorPasteRepeatForm.cpp \
	src/qtractorPluginForm.cpp \
	src/qtractorPluginSelectForm.cpp \
	src/qtractorSessionForm.cpp \
	src/qtractorShortcutForm.cpp \
	src/qtractorTakeRangeForm.cpp \
	src/qtractorTempoAdjustForm.cpp \
	src/qtractorTimeScaleForm.cpp \
	src/qtractorTrackForm.cpp \
	src/qtractor_plugin_scan.cpp

forms = \
	src/qtractorBusForm.ui \
	src/qtractorClipForm.ui \
	src/qtractorConnectForm.ui \
	src/qtractorEditRangeForm.ui \
	src/qtractorExportForm.ui \
	src/qtractorInstrumentForm.ui \
	src/qtractorMainForm.ui \
	src/qtractorMidiControlForm.ui \
	src/qtractorMidiControlObserverForm.ui \
	src/qtractorMidiEditorForm.ui \
	src/qtractorMidiSysexForm.ui \
	src/qtractorMidiToolsForm.ui \
	src/qtractorOptionsForm.ui \
	src/qtractorPaletteForm.ui \
	src/qtractorPasteRepeatForm.ui \
	src/qtractorPluginForm.ui \
	src/qtractorPluginSelectForm.ui \
	src/qtractorSessionForm.ui \
	src/qtractorShortcutForm.ui \
	src/qtractorTakeRangeForm.ui \
	src/qtractorTempoAdjustForm.ui \
	src/qtractorTimeScaleForm.ui \
	src/qtractorTrackForm.ui

resources = \
	src/qtractor.qrc

translations_sources = \
	src/translations/qtractor_cs.ts \
	src/translations/qtractor_de.ts \
	src/translations/qtractor_es.ts \
	src/translations/qtractor_fr.ts \
	src/translations/qtractor_it.ts \
	src/translations/qtractor_ja.ts \
	src/translations/qtractor_pt.ts \
	src/translations/qtractor_ru.ts

translations_targets = \
	src/translations/qtractor_cs.qm \
	src/translations/qtractor_de.qm \
	src/translations/qtractor_es.qm \
	src/translations/qtractor_fr.qm \
	src/translations/qtractor_it.qm \
	src/translations/qtractor_ja.qm \
	src/translations/qtractor_pt.qm \
	src/translations/qtractor_ru.qm


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

translations_dir = $(datadir)/$(name)/translations


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


all:	$(target)


$(target):	$(name).mak $(resources) ${forms} $(sources) $(headers)
	@$(MAKE) -f $(name).mak

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


translations_lupdate:	$(translations_sources)
	@$(LUPDATE) -verbose -no-obsolete -recursive src -ts $(translations_sources)

translations_lrelease:	translations_lupdate $(translations_targets)

%.qm:	%.ts
	@$(LRELEASE) -verbose $< -qm $@


install:	$(target) translations_lrelease $(name).1
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name).mak install
	@install -d -v -m 0755 $(DESTDIR)$(translations_dir)
	@install -v -m 0644 $(translations_targets) $(DESTDIR)$(translations_dir)
	@install -d -v -m 0755 $(DESTDIR)$(mandir)/man1
	@install -v -m 0644 $(name).1 $(DESTDIR)$(mandir)/man1/$(name).1
	@gzip -nvf $(DESTDIR)$(mandir)/man1/$(name).1
	@install -d -v -m 0755 $(DESTDIR)$(mandir)/fr/man1
	@install -v -m 0644 $(name).fr.1 $(DESTDIR)$(mandir)/fr/man1/$(name).1
	@gzip -nvf $(DESTDIR)$(mandir)/fr/man1/$(name).1

uninstall:	$(DESTDIR)$(prefix)/bin/$(name)
	@$(MAKE) INSTALL_ROOT=$(DESTDIR) -f $(name).mak uninstall
	@rm -rvf $(DESTDIR)$(translations_dir)
	@rm -vf $(DESTDIR)$(mandir)/man1/$(name).1.gz
	@rm -vf $(DESTDIR)$(mandir)/fr/man1/$(name).1.gz


clean:	$(name).mak
	@$(MAKE) -f $(name).mak distclean || true
	@rm -f $(target) $(name).mak
	@rm -rf *.cache *.log *.status $(translations_targets)
