-
+ 4A2115CE3CE2B98AE23245857C1139DBAC9FB43F018ABC961D873096A17BD42CEF99945DC7C60873D14274B2A29BFB45CABF8654ADEDD05248A4D39B3FE28824
bitcoin/src/makefile.unix
(0 . 0)(1 . 192)
15357 # /****************************\
15358 # * EXPERIMENTAL BRANCH. *
15359 # * FOR LABORATORY USE ONLY. *
15360 # ********************************
15361 # ************
15362 # **************
15363 # ****************
15364 # **** **** ****
15365 # *** *** ***
15366 # *** *** ***
15367 # *** * * **
15368 # ******** ********
15369 # ******* ******
15370 # *** **
15371 # * ******* **
15372 # ** * * * * *
15373 # ** * * ***
15374 # **** * * * * ****
15375 # **** *** * * ** ***
15376 # **** ********* ******
15377 # ******* ***** *******
15378 # ********* ****** **
15379 # ** ****** ******
15380 # ** ******* **
15381 # ** ******* ***
15382 # **** ******** ************
15383 # ************ ************
15384 # ******** *******
15385 # ****** ****
15386 # *** ***
15387 # ********************************
15388 # Copyright (c) 2009-2010 Satoshi Nakamoto
15389 # Distributed under the MIT/X11 software license, see the accompanying
15390 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
15391
15392 USE_UPNP:=0
15393
15394 DEFS=-DNOPCH
15395
15396 DEFS += $(addprefix -I,$(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
15397 LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
15398
15399 LMODE = dynamic
15400 LMODE2 = dynamic
15401 ifdef STATIC
15402 LMODE = static
15403 ifeq (${STATIC}, all)
15404 LMODE2 = static
15405 endif
15406 else
15407 TESTDEFS += -DBOOST_TEST_DYN_LINK
15408 endif
15409
15410 # for boost 1.37, add -mt to the boost libraries
15411 LIBS += \
15412 -Wl,-B$(LMODE) \
15413 -l boost_system$(BOOST_LIB_SUFFIX) \
15414 -l boost_filesystem$(BOOST_LIB_SUFFIX) \
15415 -l boost_program_options$(BOOST_LIB_SUFFIX) \
15416 -l boost_thread$(BOOST_LIB_SUFFIX) \
15417 -l db_cxx$(BDB_LIB_SUFFIX) \
15418 -l ssl \
15419 -l crypto
15420
15421 ifndef USE_UPNP
15422 override USE_UPNP = -
15423 endif
15424 ifneq (${USE_UPNP}, -)
15425 LIBS += -l miniupnpc
15426 DEFS += -DUSE_UPNP=$(USE_UPNP)
15427 endif
15428
15429 ifneq (${USE_SSL}, 0)
15430 DEFS += -DUSE_SSL
15431 endif
15432
15433 LIBS+= \
15434 -Wl,-B$(LMODE2) \
15435 -l z \
15436 -l dl \
15437 -l pthread
15438
15439
15440 # Hardening
15441 # Make some classes of vulnerabilities unexploitable in case one is discovered.
15442 #
15443 # This is a workaround for Ubuntu bug #691722, the default -fstack-protector causes
15444 # -fstack-protector-all to be ignored unless -fno-stack-protector is used first.
15445 # see: https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/691722
15446 HARDENING=-fno-stack-protector
15447
15448 # Stack Canaries
15449 # Put numbers at the beginning of each stack frame and check that they are the same.
15450 # If a stack buffer if overflowed, it writes over the canary number and then on return
15451 # when that number is checked, it won't be the same and the program will exit with
15452 # a "Stack smashing detected" error instead of being exploited.
15453 HARDENING+=-fstack-protector-all -Wstack-protector
15454
15455 # Make some important things such as the global offset table read only as soon as
15456 # the dynamic linker is finished building it. This will prevent overwriting of addresses
15457 # which would later be jumped to.
15458 HARDENING+=-Wl,-z,relro -Wl,-z,now
15459
15460 # Build position independent code to take advantage of Address Space Layout Randomization
15461 # offered by some kernels.
15462 # see doc/build-unix.txt for more information.
15463 ifdef PIE
15464 HARDENING+=-fPIE -pie
15465 endif
15466
15467 # -D_FORTIFY_SOURCE=2 does some checking for potentially exploitable code patterns in
15468 # the source such overflowing a statically defined buffer.
15469 HARDENING+=-D_FORTIFY_SOURCE=2
15470 #
15471
15472
15473 DEBUGFLAGS=-g
15474 CXXFLAGS=-O2
15475 xCXXFLAGS=-pthread -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(HARDENING) $(CXXFLAGS)
15476 HEADERS = \
15477 base58.h \
15478 bignum.h \
15479 checkpoints.h \
15480 crypter.h \
15481 db.h \
15482 headers.h \
15483 init.h \
15484 irc.h \
15485 key.h \
15486 keystore.h \
15487 main.h \
15488 net.h \
15489 noui.h \
15490 protocol.h \
15491 bitcoinrpc.h \
15492 script.h \
15493 serialize.h \
15494 strlcpy.h \
15495 uint256.h \
15496 util.h \
15497 wallet.h
15498
15499 OBJS= \
15500 obj/checkpoints.o \
15501 obj/crypter.o \
15502 obj/db.o \
15503 obj/init.o \
15504 obj/irc.o \
15505 obj/keystore.o \
15506 obj/main.o \
15507 obj/net.o \
15508 obj/protocol.o \
15509 obj/bitcoinrpc.o \
15510 obj/script.o \
15511 obj/util.o \
15512 obj/wallet.o
15513
15514
15515 all: bitcoind
15516
15517 # auto-generated dependencies:
15518 -include obj/nogui/*.P
15519 -include obj-test/*.P
15520
15521 obj/nogui/%.o: %.cpp
15522 $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
15523 @cp $(@:%.o=%.d) $(@:%.o=%.P); \
15524 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
15525 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
15526 rm -f $(@:%.o=%.d)
15527
15528 bitcoind: $(OBJS:obj/%=obj/nogui/%)
15529 $(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
15530
15531 obj-test/%.o: test/%.cpp
15532 $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $<
15533 @cp $(@:%.o=%.d) $(@:%.o=%.P); \
15534 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
15535 -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
15536 rm -f $(@:%.o=%.d)
15537
15538 test_bitcoin: obj-test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
15539 $(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
15540
15541 clean:
15542 -rm -f bitcoind test_bitcoin
15543 -rm -f obj/*.o
15544 -rm -f obj/nogui/*.o
15545 -rm -f obj-test/*.o
15546 -rm -f obj/*.P
15547 -rm -f obj/nogui/*.P
15548 -rm -f obj-test/*.P