-CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall
-QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+ifneq (,$(findstring MINGW,$(platform)))
+ CXXFLAGS = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
+ MOC = $(QTDIR)/bin/moc
+ LUAPLATFORM = mingw
+ ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
+ CXXFLAGS += -I$(QTDIR)/include/QtWidgets
+ QTLDLIBS = -L$(QTDIR)/lib -lQt5Core -lQt5Gui -lQt5Widgets
+ else
+ QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
+ endif
+else ifeq ($(platform),Darwin)
+ CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
+ QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+ MOC = $(shell pkg-config --variable=moc_location QtCore)
+ LUAPLATFORM = macosx
+else
+ CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O4
+ QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+ LUALIB += -ldl
+ LDLIBS += -ltermcap -lncurses
+ MOC = $(shell pkg-config --variable=moc_location QtCore)
+ # Below is a variant you can use if you have problems compiling with QT5 on ubuntu. see http://www.proxmark.org/forum/viewtopic.php?id=1661 for more info.
+ #MOC = /usr/lib/x86_64-linux-gnu/qt4/bin/moc
+ LUAPLATFORM = linux
+endif