|
|
|
# Build application with GUI (tray, main window)
|
|
|
|
USE_WIN32_APP := yes
|
|
|
|
|
|
|
|
WINDRES = windres
|
|
|
|
|
|
|
|
CXXFLAGS := $(CXX_DEBUG) -fPIC -msse
|
|
|
|
INCFLAGS := -I$(DAEMON_SRC_DIR) -IWin32
|
|
|
|
LDFLAGS := ${LD_DEBUG} -static -fPIC -msse
|
|
|
|
|
|
|
|
NEEDED_CXXFLAGS += -std=c++17
|
|
|
|
DEFINES += -DWIN32_LEAN_AND_MEAN
|
|
|
|
|
|
|
|
# UPNP Support
|
|
|
|
ifeq ($(USE_UPNP),yes)
|
|
|
|
DEFINES += -DUSE_UPNP -DMINIUPNP_STATICLIB
|
|
|
|
LDLIBS = -lminiupnpc
|
|
|
|
endif
|
|
|
|
|
|
|
|
LDLIBS += \
|
|
|
|
$(MINGW_PREFIX)/lib/libboost_system-mt.a \
|
|
|
|
$(MINGW_PREFIX)/lib/libboost_date_time-mt.a \
|
|
|
|
$(MINGW_PREFIX)/lib/libboost_filesystem-mt.a \
|
|
|
|
$(MINGW_PREFIX)/lib/libboost_program_options-mt.a \
|
|
|
|
$(MINGW_PREFIX)/lib/libssl.a \
|
|
|
|
$(MINGW_PREFIX)/lib/libcrypto.a \
|
|
|
|
$(MINGW_PREFIX)/lib/libz.a \
|
|
|
|
-lwsock32 \
|
|
|
|
-lws2_32 \
|
|
|
|
-liphlpapi \
|
|
|
|
-lcrypt32 \
|
|
|
|
-lgdi32 \
|
|
|
|
-lole32 \
|
|
|
|
-luuid \
|
|
|
|
-lpthread
|
|
|
|
|
|
|
|
ifeq ($(USE_WIN32_APP), yes)
|
|
|
|
DEFINES += -DWIN32_APP
|
|
|
|
LDFLAGS += -mwindows
|
|
|
|
DAEMON_RC += Win32/Resource.rc
|
|
|
|
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_WINXP_FLAGS), yes)
|
|
|
|
DEFINES += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_AESNI),yes)
|
|
|
|
NEEDED_CXXFLAGS += -maes
|
|
|
|
LDFLAGS += -maes
|
|
|
|
DEFINES += -D__AES__
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_ASLR),yes)
|
|
|
|
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
|
|
|
|
endif
|
|
|
|
|
|
|
|
obj/%.o : %.rc | mk_obj_dir
|
|
|
|
$(WINDRES) $(DEFINES) $(INCFLAGS) --preprocessor-arg=-MMD --preprocessor-arg=-MP --preprocessor-arg=-MF$@.d -i $< -o $@
|