|
|
|
@ -5,6 +5,7 @@
@@ -5,6 +5,7 @@
|
|
|
|
|
# :=1 --> Enable IPv6 support |
|
|
|
|
# :=0 --> Disable IPv6 support |
|
|
|
|
USE_IPV6:=1 |
|
|
|
|
USE_DEBUG:=0 |
|
|
|
|
|
|
|
|
|
LINK:=$(CXX) |
|
|
|
|
|
|
|
|
@ -42,20 +43,16 @@ TESTLIBS += \
@@ -42,20 +43,16 @@ TESTLIBS += \
|
|
|
|
|
-l boost_unit_test_framework$(BOOST_LIB_SUFFIX) |
|
|
|
|
|
|
|
|
|
ifneq (${USE_IPV6}, -) |
|
|
|
|
DEFS += -DUSE_IPV6=$(USE_IPV6) |
|
|
|
|
DEFS += -DUSE_IPV6=$(USE_IPV6) |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
LIBS+= \ |
|
|
|
|
LIBS += \ |
|
|
|
|
-Wl,-B$(LMODE2) \ |
|
|
|
|
-l z \ |
|
|
|
|
-l dl \ |
|
|
|
|
-l pthread \ |
|
|
|
|
-l i2psam |
|
|
|
|
|
|
|
|
|
# I2P Support |
|
|
|
|
DEFS += -DUSE_NATIVE_I2P -I"../i2psam" |
|
|
|
|
LIBS += -L"../i2psam" |
|
|
|
|
|
|
|
|
|
# Hardening |
|
|
|
|
# Make some classes of vulnerabilities unexploitable in case one is discovered. |
|
|
|
|
# |
|
|
|
@ -89,19 +86,21 @@ LIBS += -L"../i2psam"
@@ -89,19 +86,21 @@ LIBS += -L"../i2psam"
|
|
|
|
|
HARDENING+=-D_FORTIFY_SOURCE=2 |
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEBUGFLAGS=-g |
|
|
|
|
ifneq (${USE_DEBUG}, 0) |
|
|
|
|
DEBUGFLAGS=-g |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
# CXXFLAGS can be specified on the make command line, so we use xCXXFLAGS that only |
|
|
|
|
# adds some defaults in front. Unfortunately, CXXFLAGS=... $(CXXFLAGS) does not work. |
|
|
|
|
xCXXFLAGS=-std=c++11 -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \ |
|
|
|
|
xCXXFLAGS = -std=c++11 -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter \ |
|
|
|
|
$(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS) |
|
|
|
|
|
|
|
|
|
# LDFLAGS can be specified on the make command line, so we use xLDFLAGS that only |
|
|
|
|
# adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work. |
|
|
|
|
xLDFLAGS=$(LDHARDENING) $(LDFLAGS) |
|
|
|
|
|
|
|
|
|
OBJS= \ |
|
|
|
|
OBJS = \ |
|
|
|
|
../i2psam/libi2psam.a \ |
|
|
|
|
leveldb/libleveldb.a \ |
|
|
|
|
obj/alert.o \ |
|
|
|
|
obj/version.o \ |
|
|
|
@ -114,7 +113,7 @@ OBJS= \
@@ -114,7 +113,7 @@ OBJS= \
|
|
|
|
|
obj/init.o \ |
|
|
|
|
obj/keystore.o \ |
|
|
|
|
obj/i2p.o \ |
|
|
|
|
obj/Gost.o \ |
|
|
|
|
obj/Gost.o \ |
|
|
|
|
obj/main.o \ |
|
|
|
|
obj/net.o \ |
|
|
|
|
obj/protocol.o \ |
|
|
|
@ -158,6 +157,12 @@ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
@@ -158,6 +157,12 @@ DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
|
|
|
|
|
leveldb/libleveldb.a: |
|
|
|
|
@echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd .. |
|
|
|
|
|
|
|
|
|
# I2P Support |
|
|
|
|
LIBS += -L"../i2psam" |
|
|
|
|
DEFS += -DUSE_NATIVE_I2P -I"../i2psam" |
|
|
|
|
../i2psam/libi2psam.a: |
|
|
|
|
@echo "Building libi2psam ..." && cd ../i2psam && $(MAKE) -f makefile.unix && cd ../src |
|
|
|
|
|
|
|
|
|
# auto-generated dependencies: |
|
|
|
|
-include obj/*.P |
|
|
|
|
-include obj-test/*.P |
|
|
|
@ -182,7 +187,6 @@ obj/%.o: %.cpp
@@ -182,7 +187,6 @@ obj/%.o: %.cpp
|
|
|
|
|
rm -f $(@:%.o=%.d) |
|
|
|
|
|
|
|
|
|
gostcoind: $(OBJS:obj/%=obj/%) |
|
|
|
|
@(cd ../i2psam; make -f makefile.unix ) |
|
|
|
|
$(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) |
|
|
|
|
|
|
|
|
|
TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) |
|
|
|
|