mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-04 06:00:37 +00:00
bc330ff0ea
Signed-off-by: R4SAS <r4sas@i2pmail.org>
66 lines
1.5 KiB
Makefile
66 lines
1.5 KiB
Makefile
# Build application with GUI (tray, main window)
|
|
USE_WIN32_APP := yes
|
|
|
|
WINDRES = windres
|
|
|
|
CXXFLAGS := $(CXX_DEBUG) -D_MT -DWIN32_LEAN_AND_MEAN -fPIC -msse
|
|
INCFLAGS = -I$(DAEMON_SRC_DIR) -IWin32
|
|
LDFLAGS := ${LD_DEBUG} -Wl,-Bstatic -static-libgcc
|
|
|
|
# detect proper flag for c++11 support by compilers
|
|
CXXVER := $(shell $(CXX) -dumpversion)
|
|
ifeq ($(shell expr match ${CXXVER} "[4]\.[7-9]\|4\.1[0-9]\|[5-6]"),4) # gcc 4.7 - 6
|
|
NEEDED_CXXFLAGS += -std=c++11
|
|
else ifeq ($(shell expr match ${CXXVER} "[1,7-9]"),1) # gcc >= 7
|
|
NEEDED_CXXFLAGS += -std=c++17
|
|
else # not supported
|
|
$(error Compiler too old)
|
|
endif
|
|
|
|
# Boost libraries suffix
|
|
BOOST_SUFFIX = -mt
|
|
|
|
# UPNP Support
|
|
ifeq ($(USE_UPNP),yes)
|
|
CXXFLAGS += -DUSE_UPNP -DMINIUPNP_STATICLIB
|
|
LDLIBS = -lminiupnpc
|
|
endif
|
|
|
|
LDLIBS += \
|
|
-lboost_system$(BOOST_SUFFIX) \
|
|
-lboost_date_time$(BOOST_SUFFIX) \
|
|
-lboost_filesystem$(BOOST_SUFFIX) \
|
|
-lboost_program_options$(BOOST_SUFFIX) \
|
|
-lssl \
|
|
-lcrypto \
|
|
-lz \
|
|
-lwsock32 \
|
|
-lws2_32 \
|
|
-lgdi32 \
|
|
-liphlpapi \
|
|
-lole32 \
|
|
-luuid \
|
|
-lpthread
|
|
|
|
ifeq ($(USE_WIN32_APP), yes)
|
|
NEEDED_CXXFLAGS += -DWIN32_APP
|
|
LDFLAGS += -mwindows
|
|
DAEMON_RC += Win32/Resource.rc
|
|
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
|
endif
|
|
|
|
ifeq ($(USE_WINXP_FLAGS), yes)
|
|
NEEDED_CXXFLAGS += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
|
endif
|
|
|
|
ifeq ($(USE_AESNI),yes)
|
|
NEEDED_CXXFLAGS += -D__AES__ -maes
|
|
endif
|
|
|
|
ifeq ($(USE_ASLR),yes)
|
|
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
|
|
endif
|
|
|
|
obj/%.o : %.rc
|
|
$(WINDRES) -i $< -o $@
|