2020-11-23 01:44:21 +03:00
|
|
|
# Build application with GUI (tray, main window)
|
|
|
|
USE_WIN32_APP := yes
|
|
|
|
|
2018-07-20 22:55:41 +03:00
|
|
|
WINDRES = windres
|
2020-11-23 01:44:21 +03:00
|
|
|
|
2022-05-31 21:59:14 +03:00
|
|
|
CXXFLAGS := $(CXX_DEBUG) -fPIC -msse
|
2023-02-26 23:38:23 +03:00
|
|
|
INCFLAGS := -I$(DAEMON_SRC_DIR) -IWin32
|
2023-12-17 22:30:55 +03:00
|
|
|
LDFLAGS := ${LD_DEBUG} -static -fPIC -msse
|
2018-07-20 22:55:41 +03:00
|
|
|
|
2023-02-26 23:38:23 +03:00
|
|
|
NEEDED_CXXFLAGS += -std=c++17
|
|
|
|
DEFINES += -DWIN32_LEAN_AND_MEAN
|
2020-05-14 21:52:33 +03:00
|
|
|
|
2018-07-20 22:55:41 +03:00
|
|
|
# UPNP Support
|
|
|
|
ifeq ($(USE_UPNP),yes)
|
2023-02-26 23:38:23 +03:00
|
|
|
DEFINES += -DUSE_UPNP -DMINIUPNP_STATICLIB
|
2018-07-20 22:55:41 +03:00
|
|
|
LDLIBS = -lminiupnpc
|
|
|
|
endif
|
|
|
|
|
|
|
|
LDLIBS += \
|
2023-12-17 22:30:55 +03:00
|
|
|
$(MINGW_PREFIX)/lib/libboost_system-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 \
|
2018-07-20 22:55:41 +03:00
|
|
|
-lwsock32 \
|
|
|
|
-lws2_32 \
|
|
|
|
-liphlpapi \
|
2023-12-17 22:30:55 +03:00
|
|
|
-lcrypt32 \
|
|
|
|
-lgdi32 \
|
2020-04-12 05:25:22 +03:00
|
|
|
-lole32 \
|
2023-12-17 22:41:28 +03:00
|
|
|
-luuid \
|
|
|
|
-lpthread
|
2018-07-20 22:55:41 +03:00
|
|
|
|
|
|
|
ifeq ($(USE_WIN32_APP), yes)
|
2023-02-26 23:38:23 +03:00
|
|
|
DEFINES += -DWIN32_APP
|
2018-07-20 22:55:41 +03:00
|
|
|
LDFLAGS += -mwindows
|
|
|
|
DAEMON_RC += Win32/Resource.rc
|
|
|
|
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
|
|
|
endif
|
|
|
|
|
2019-11-19 13:50:16 +03:00
|
|
|
ifeq ($(USE_WINXP_FLAGS), yes)
|
2023-02-26 23:38:23 +03:00
|
|
|
DEFINES += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
2019-11-19 13:50:16 +03:00
|
|
|
endif
|
|
|
|
|
2020-11-15 01:31:20 +03:00
|
|
|
ifeq ($(USE_AESNI),yes)
|
2023-02-26 23:38:23 +03:00
|
|
|
NEEDED_CXXFLAGS += -maes
|
2023-12-17 22:30:55 +03:00
|
|
|
LDFLAGS += -maes
|
2023-02-26 23:38:23 +03:00
|
|
|
DEFINES += -D__AES__
|
2018-07-20 22:55:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_ASLR),yes)
|
|
|
|
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
|
|
|
|
endif
|
|
|
|
|
2021-08-07 01:38:35 +03:00
|
|
|
obj/%.o : %.rc | mk_obj_dir
|
2023-02-26 23:38:23 +03:00
|
|
|
$(WINDRES) $(DEFINES) $(INCFLAGS) --preprocessor-arg=-MMD --preprocessor-arg=-MP --preprocessor-arg=-MF$@.d -i $< -o $@
|