]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/Makefile
allow common makefile options-defines (#635)
[proxmark3-svn] / client / Makefile
index 917dc767f8ee062ca487cc17b55919f34ec07229..2d256b72e46a53e8650c144228a005d798e48db4 100644 (file)
@@ -23,6 +23,10 @@ LDFLAGS = $(ENV_LDFLAGS)
 CFLAGS = $(ENV_CFLAGS) -std=c99 -D_ISOC99_SOURCE -I. -I../include -I../common -I../common/polarssl -I../zlib -I../uart -I/opt/local/include -I../liblua -Wall -g -O3
 CXXFLAGS = -I../include -Wall -O3
 
+APP_CFLAGS =
+include ../common/Makefile_Enabled_Options.common
+CFLAGS += $(APP_CFLAGS)
+
 LUAPLATFORM = generic
 platform = $(shell uname)
 ifneq (,$(findstring MINGW,$(platform)))
@@ -37,32 +41,34 @@ else
        endif
 endif
 
-# Check for correctly configured Qt5
-QTINCLUDES = $(shell pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null)
-QTLDLIBS = $(shell pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
-MOC = $(shell pkg-config --variable=host_bins Qt5Core)/moc
-UIC = $(shell pkg-config --variable=host_bins Qt5Core)/uic
-ifeq ($(QTINCLUDES), )
-# if Qt5 not found check for correctly configured Qt4  
-       QTINCLUDES = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null)
-       QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
-       MOC = $(shell pkg-config --variable=moc_location QtCore)
-       UIC = $(shell pkg-config --variable=uic_location QtCore)
-else
-       CXXFLAGS += -std=c++11 -fPIC
-endif
-ifeq ($(QTINCLUDES), )
-# if both pkg-config commands failed, search in common places
-       ifneq ($(QTDIR), )
-               QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
-               QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
-               ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
-                       QTINCLUDES += -I$(QTDIR)/include/QtWidgets
-                       QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core
-                       CXXFLAGS += -std=c++11 -fPIC
+ifneq (,$(findstring WITH_GUI,$(APP_CFLAGS)))
+       # Check for correctly configured Qt5
+       QTINCLUDES = $(shell pkg-config --cflags Qt5Core Qt5Widgets 2>/dev/null)
+       QTLDLIBS = $(shell pkg-config --libs Qt5Core Qt5Widgets 2>/dev/null)
+       MOC = $(shell pkg-config --variable=host_bins Qt5Core)/moc
+       UIC = $(shell pkg-config --variable=host_bins Qt5Core)/uic
+       ifeq ($(QTINCLUDES), )
+       # if Qt5 not found check for correctly configured Qt4   
+               QTINCLUDES = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null)
+               QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
+               MOC = $(shell pkg-config --variable=moc_location QtCore)
+               UIC = $(shell pkg-config --variable=uic_location QtCore)
+       else
+               CXXFLAGS += -std=c++11 -fPIC
+       endif
+       ifeq ($(QTINCLUDES), )
+       # if both pkg-config commands failed, search in common places
+               ifneq ($(QTDIR), )
+                       QTINCLUDES = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
+                       QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4
+                       ifneq ($(wildcard $(QTDIR)/include/QtWidgets),)
+                               QTINCLUDES += -I$(QTDIR)/include/QtWidgets
+                               QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core
+                               CXXFLAGS += -std=c++11 -fPIC
+                       endif
+                       MOC = $(QTDIR)/bin/moc
+                       UIC = $(QTDIR)/bin/uic
                endif
-               MOC = $(QTDIR)/bin/moc
-               UIC = $(QTDIR)/bin/uic
        endif
 endif
 
@@ -79,6 +85,7 @@ DEPFLAGS = -MT $@ -MMD -MP -MF $(OBJDIR)/$*.Td
 # make temporary to final dependeny files after successful compilation
 POSTCOMPILE = $(MV) -f $(OBJDIR)/$*.Td $(OBJDIR)/$*.d
 
+
 CORESRCS =     uart_posix.c \
                        uart_win32.c \
                        util.c \
@@ -303,6 +310,7 @@ DEPENDENCY_FILES = $(patsubst %.c, $(OBJDIR)/%.d, $(CORESRCS) $(CMDSRCS) $(ZLIBS
        $(patsubst %.cpp, $(OBJDIR)/%.d, $(QTGUISRCS)) \
        $(OBJDIR)/proxmark3.d $(OBJDIR)/flash.d $(OBJDIR)/flasher.d $(OBJDIR)/fpga_compress.d
 
+
 $(DEPENDENCY_FILES): ;
 .PRECIOUS: $(DEPENDENCY_FILES)
 
Impressum, Datenschutz