#!/usr/bin/make -f
# Makefile for jackmeter #
# -------------------------------- #
# Created by falkTX
#

CXX ?= g++

BASE_FLAGS   = -O0 -g -Wall

BUILD_FLAGS  = $(BASE_FLAGS) -std=c++0x $(CXXFLAGS)
BUILD_FLAGS += $(shell pkg-config --cflags QtCore QtGui jack)
BUILD_FLAGS += -DDEBUG

LINK_FLAGS   = $(LDFLAGS)
LINK_FLAGS  += $(shell pkg-config --libs QtCore QtGui jack)

ifeq ($(shell pkg-config --atleast-version=0.121.0 jack && echo true),true)
BUILD_FLAGS += -DHAVE_JACKSESSION
endif

OBJS = jackmeter.o \
	../widgets/digitalpeakmeter.o

# --------------------------------------------------------------

all: cadence-jackmeter

cadence-jackmeter: $(OBJS)
	$(CXX) $^ $(LINK_FLAGS) -o $@

cadence-jackmeter.exe: $(OBJS)
	$(CXX) $^ -static -mwindows $(LINK_FLAGS) -o $@

# --------------------------------------------------------------

.cpp.o:
	$(CXX) -c $< $(BUILD_FLAGS) -o $@

clean:
	rm -f $(OBJS) cadence-jackmeter*
