From 0f632fde02ce3f10b6c0b58911c2f20270304693 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 18:13:27 -0800 Subject: [PATCH 1/9] Initial support for scons. --- SConstruct | 44 +++++++++++++++++ site_scons/site_tools/protoc.py | 84 +++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 SConstruct create mode 100644 site_scons/site_tools/protoc.py diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000000..953d4fd604 --- /dev/null +++ b/SConstruct @@ -0,0 +1,44 @@ +# +# Newcoin - SConstruct +# + +import glob + +env = Environment( + tools = ['default', 'protoc'] + ) + +# Use openssl +env.ParseConfig('pkg-config --cflags --libs openssl') + +env.Append(LIBS = [ + 'boost_system-mt', + 'boost_filesystem-mt', + 'boost_program_options-mt', + 'boost_thread-mt', + 'protobuf', + 'dl', # dynamic linking + 'z' + ]) + +DEBUGFLAGS = ['-g', '-DDEBUG'] + +env.Append(LINKFLAGS = ['-rdynamic', '-pthread']) +env.Append(CCFLAGS = ['-pthread', '-Wall', '-Wno-sign-compare', '-Wno-char-subscripts']) +env.Append(CXXFLAGS = ['-O0', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+DEBUGFLAGS) + +DB_SRCS = glob.glob('database/*.c*') +JSON_SRCS = glob.glob('json/*.cpp') +NEWCOIN_SRCS = glob.glob('*.cpp') +PROTO_SRCS = env.Protoc([], 'newcoin.proto', PROTOCPYTHONOUTDIR=None) +UTIL_SRCS = glob.glob('util/*.cpp') + +UNUSED_SRCS = ['HttpReply.cpp', 'ValidationCollection.cpp'] + +for file in UNUSED_SRCS: + NEWCOIN_SRCS.remove(file) + +NEWCOIN_SRCS += DB_SRCS + JSON_SRCS + UTIL_SRCS + PROTO_SRCS + +env.Program('newcoind', NEWCOIN_SRCS) + diff --git a/site_scons/site_tools/protoc.py b/site_scons/site_tools/protoc.py new file mode 100644 index 0000000000..dc47634d4f --- /dev/null +++ b/site_scons/site_tools/protoc.py @@ -0,0 +1,84 @@ +#!python +""" +protoc.py: Protoc Builder for SCons + +This Builder invokes protoc to generate C++ and Python +from a .proto file. + +NOTE: Java is not currently supported. + +From: http://www.scons.org/wiki/ProtocBuilder +""" + +__author__ = "Scott Stafford" + +import SCons.Action +import SCons.Builder +import SCons.Defaults +import SCons.Node.FS +import SCons.Util + +from SCons.Script import File, Dir + +import os.path + +protocs = 'protoc' + +ProtocAction = SCons.Action.Action('$PROTOCCOM', '$PROTOCCOMSTR') +def ProtocEmitter(target, source, env): + dirOfCallingSConscript = Dir('.').srcnode() + env.Prepend(PROTOCPROTOPATH = dirOfCallingSConscript.path) + + source_with_corrected_path = [] + for src in source: + commonprefix = os.path.commonprefix([dirOfCallingSConscript.path, src.srcnode().path]) + if len(commonprefix)>0: + source_with_corrected_path.append( src.srcnode().path[len(commonprefix + os.sep):] ) + else: + source_with_corrected_path.append( src.srcnode().path ) + + source = source_with_corrected_path + + for src in source: + modulename = os.path.splitext(src)[0] + + if env['PROTOCOUTDIR']: + base = os.path.join(env['PROTOCOUTDIR'] , modulename) + target.extend( [ base + '.pb.cc', base + '.pb.h' ] ) + + if env['PROTOCPYTHONOUTDIR']: + base = os.path.join(env['PROTOCPYTHONOUTDIR'] , modulename) + target.append( base + '_pb2.py' ) + + try: + target.append(env['PROTOCFDSOUT']) + except KeyError: + pass + + #~ print "PROTOC SOURCE:", [str(s) for s in source] + #~ print "PROTOC TARGET:", [str(s) for s in target] + + return target, source + +ProtocBuilder = SCons.Builder.Builder(action = ProtocAction, + emitter = ProtocEmitter, + srcsuffix = '$PROTOCSRCSUFFIX') + +def generate(env): + """Add Builders and construction variables for protoc to an Environment.""" + try: + bld = env['BUILDERS']['Protoc'] + except KeyError: + bld = ProtocBuilder + env['BUILDERS']['Protoc'] = bld + + env['PROTOC'] = env.Detect(protocs) or 'protoc' + env['PROTOCFLAGS'] = SCons.Util.CLVar('') + env['PROTOCPROTOPATH'] = SCons.Util.CLVar('') + env['PROTOCCOM'] = '$PROTOC ${["-I%s"%x for x in PROTOCPROTOPATH]} $PROTOCFLAGS --cpp_out=$PROTOCCPPOUTFLAGS$PROTOCOUTDIR ${PROTOCPYTHONOUTDIR and ("--python_out="+PROTOCPYTHONOUTDIR) or ""} ${PROTOCFDSOUT and ("-o"+PROTOCFDSOUT) or ""} ${SOURCES}' + env['PROTOCOUTDIR'] = '${SOURCE.dir}' + env['PROTOCPYTHONOUTDIR'] = "python" + env['PROTOCSRCSUFFIX'] = '.proto' + +def exists(env): + return env.Detect(protocs) From 82af29a21d7b7909070641c2901f37212fccb453 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 20:27:01 -0800 Subject: [PATCH 2/9] Fix scons globing of foo.c~ --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 953d4fd604..e554f082b1 100644 --- a/SConstruct +++ b/SConstruct @@ -27,7 +27,7 @@ env.Append(LINKFLAGS = ['-rdynamic', '-pthread']) env.Append(CCFLAGS = ['-pthread', '-Wall', '-Wno-sign-compare', '-Wno-char-subscripts']) env.Append(CXXFLAGS = ['-O0', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+DEBUGFLAGS) -DB_SRCS = glob.glob('database/*.c*') +DB_SRCS = glob.glob('database/*.c') + glob.glob('database/*.cpp') JSON_SRCS = glob.glob('json/*.cpp') NEWCOIN_SRCS = glob.glob('*.cpp') PROTO_SRCS = env.Protoc([], 'newcoin.proto', PROTOCPYTHONOUTDIR=None) From c513e45754c83dbc8295f242f4301fcb3eaccd6e Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 22:43:06 -0800 Subject: [PATCH 3/9] Move sources to src and build objs in obj. --- SConstruct | 26 +++++++++++++++---- database/database.h | 2 +- AccountState.cpp => src/AccountState.cpp | 0 AccountState.h => src/AccountState.h | 2 +- Application.cpp => src/Application.cpp | 4 +-- Application.h => src/Application.h | 2 +- Avalanche.h => src/Avalanche.h | 0 BinaryFormats.h => src/BinaryFormats.h | 0 BitcoinUtil.cpp => src/BitcoinUtil.cpp | 0 BitcoinUtil.h => src/BitcoinUtil.h | 0 CallRPC.cpp => src/CallRPC.cpp | 4 +-- CallRPC.h => src/CallRPC.h | 2 +- Config.cpp => src/Config.cpp | 2 +- Config.h => src/Config.h | 0 Confirmation.h => src/Confirmation.h | 2 +- ConnectionPool.cpp => src/ConnectionPool.cpp | 0 ConnectionPool.h => src/ConnectionPool.h | 0 Conversion.cpp => src/Conversion.cpp | 0 Conversion.h => src/Conversion.h | 0 DBInit.cpp => src/DBInit.cpp | 0 .../DeterministicKeys.cpp | 0 Hanko.cpp => src/Hanko.cpp | 0 Hanko.h => src/Hanko.h | 0 HashedObject.cpp => src/HashedObject.cpp | 0 HashedObject.h => src/HashedObject.h | 0 HttpReply.cpp => src/HttpReply.cpp | 0 HttpReply.h => src/HttpReply.h | 0 HttpRequest.h => src/HttpRequest.h | 0 KnownNodeList.cpp => src/KnownNodeList.cpp | 4 +-- KnownNodeList.h => src/KnownNodeList.h | 0 Ledger.cpp => src/Ledger.cpp | 2 +- Ledger.h => src/Ledger.h | 2 +- LedgerAcquire.cpp => src/LedgerAcquire.cpp | 0 LedgerAcquire.h => src/LedgerAcquire.h | 2 +- LedgerHistory.cpp => src/LedgerHistory.cpp | 0 LedgerHistory.h => src/LedgerHistory.h | 0 LedgerMaster.cpp => src/LedgerMaster.cpp | 0 LedgerMaster.h => src/LedgerMaster.h | 0 LocalAccount.h => src/LocalAccount.h | 0 .../LocalTransaction.cpp | 2 +- LocalTransaction.h => src/LocalTransaction.h | 2 +- NetworkOPs.cpp => src/NetworkOPs.cpp | 0 NetworkOPs.h => src/NetworkOPs.h | 0 NetworkStatus.h => src/NetworkStatus.h | 0 NewcoinAddress.cpp => src/NewcoinAddress.cpp | 0 NewcoinAddress.h => src/NewcoinAddress.h | 0 PackedMessage.cpp => src/PackedMessage.cpp | 0 PackedMessage.h => src/PackedMessage.h | 2 +- Peer.cpp => src/Peer.cpp | 2 +- Peer.h => src/Peer.h | 2 +- PeerDoor.cpp => src/PeerDoor.cpp | 0 PeerDoor.h => src/PeerDoor.h | 0 PubKeyCache.cpp => src/PubKeyCache.cpp | 0 PubKeyCache.h => src/PubKeyCache.h | 0 RPC.h => src/RPC.h | 2 +- RPCCommands.cpp => src/RPCCommands.cpp | 0 RPCCommands.h => src/RPCCommands.h | 0 RPCDoor.cpp => src/RPCDoor.cpp | 0 RPCDoor.h => src/RPCDoor.h | 0 RPCServer.cpp => src/RPCServer.cpp | 6 ++--- RPCServer.h => src/RPCServer.h | 2 +- RequestParser.cpp => src/RequestParser.cpp | 0 RequestParser.h => src/RequestParser.h | 0 SHAMap.cpp => src/SHAMap.cpp | 0 SHAMap.h => src/SHAMap.h | 0 SHAMapDiff.cpp => src/SHAMapDiff.cpp | 0 SHAMapNodes.cpp => src/SHAMapNodes.cpp | 0 SHAMapSync.cpp => src/SHAMapSync.cpp | 0 ScopedLock.h => src/ScopedLock.h | 0 SecureAllocator.h => src/SecureAllocator.h | 0 Serializer.cpp => src/Serializer.cpp | 0 Serializer.h => src/Serializer.h | 0 TaggedCache.h => src/TaggedCache.h | 0 TimingService.cpp => src/TimingService.cpp | 0 TimingService.h => src/TimingService.h | 0 Transaction.cpp => src/Transaction.cpp | 0 Transaction.h => src/Transaction.h | 4 +-- .../TransactionMaster.cpp | 0 .../TransactionMaster.h | 0 UniqueNodeList.cpp => src/UniqueNodeList.cpp | 0 UniqueNodeList.h => src/UniqueNodeList.h | 4 +-- .../ValidationCollection.cpp | 0 .../ValidationCollection.h | 4 +-- Wallet.cpp => src/Wallet.cpp | 0 Wallet.h => src/Wallet.h | 2 +- base58.h => src/base58.h | 0 bignum.h => src/bignum.h | 0 key.h => src/key.h | 0 keystore.cpp => src/keystore.cpp | 0 keystore.h => src/keystore.h | 0 main.cpp => src/main.cpp | 0 rpc.cpp => src/rpc.cpp | 4 +-- script.h => src/script.h | 0 types.h => src/types.h | 0 uint256.h => src/uint256.h | 0 95 files changed, 55 insertions(+), 39 deletions(-) rename AccountState.cpp => src/AccountState.cpp (100%) rename AccountState.h => src/AccountState.h (97%) rename Application.cpp => src/Application.cpp (98%) rename Application.h => src/Application.h (98%) rename Avalanche.h => src/Avalanche.h (100%) rename BinaryFormats.h => src/BinaryFormats.h (100%) rename BitcoinUtil.cpp => src/BitcoinUtil.cpp (100%) rename BitcoinUtil.h => src/BitcoinUtil.h (100%) rename CallRPC.cpp => src/CallRPC.cpp (98%) rename CallRPC.h => src/CallRPC.h (85%) rename Config.cpp => src/Config.cpp (96%) rename Config.h => src/Config.h (100%) rename Confirmation.h => src/Confirmation.h (96%) rename ConnectionPool.cpp => src/ConnectionPool.cpp (100%) rename ConnectionPool.h => src/ConnectionPool.h (100%) rename Conversion.cpp => src/Conversion.cpp (100%) rename Conversion.h => src/Conversion.h (100%) rename DBInit.cpp => src/DBInit.cpp (100%) rename DeterministicKeys.cpp => src/DeterministicKeys.cpp (100%) rename Hanko.cpp => src/Hanko.cpp (100%) rename Hanko.h => src/Hanko.h (100%) rename HashedObject.cpp => src/HashedObject.cpp (100%) rename HashedObject.h => src/HashedObject.h (100%) rename HttpReply.cpp => src/HttpReply.cpp (100%) rename HttpReply.h => src/HttpReply.h (100%) rename HttpRequest.h => src/HttpRequest.h (100%) rename KnownNodeList.cpp => src/KnownNodeList.cpp (95%) rename KnownNodeList.h => src/KnownNodeList.h (100%) rename Ledger.cpp => src/Ledger.cpp (99%) rename Ledger.h => src/Ledger.h (99%) rename LedgerAcquire.cpp => src/LedgerAcquire.cpp (100%) rename LedgerAcquire.h => src/LedgerAcquire.h (98%) rename LedgerHistory.cpp => src/LedgerHistory.cpp (100%) rename LedgerHistory.h => src/LedgerHistory.h (100%) rename LedgerMaster.cpp => src/LedgerMaster.cpp (100%) rename LedgerMaster.h => src/LedgerMaster.h (100%) rename LocalAccount.h => src/LocalAccount.h (100%) rename LocalTransaction.cpp => src/LocalTransaction.cpp (98%) rename LocalTransaction.h => src/LocalTransaction.h (98%) rename NetworkOPs.cpp => src/NetworkOPs.cpp (100%) rename NetworkOPs.h => src/NetworkOPs.h (100%) rename NetworkStatus.h => src/NetworkStatus.h (100%) rename NewcoinAddress.cpp => src/NewcoinAddress.cpp (100%) rename NewcoinAddress.h => src/NewcoinAddress.h (100%) rename PackedMessage.cpp => src/PackedMessage.cpp (100%) rename PackedMessage.h => src/PackedMessage.h (98%) rename Peer.cpp => src/Peer.cpp (99%) rename Peer.h => src/Peer.h (98%) rename PeerDoor.cpp => src/PeerDoor.cpp (100%) rename PeerDoor.h => src/PeerDoor.h (100%) rename PubKeyCache.cpp => src/PubKeyCache.cpp (100%) rename PubKeyCache.h => src/PubKeyCache.h (100%) rename RPC.h => src/RPC.h (97%) rename RPCCommands.cpp => src/RPCCommands.cpp (100%) rename RPCCommands.h => src/RPCCommands.h (100%) rename RPCDoor.cpp => src/RPCDoor.cpp (100%) rename RPCDoor.h => src/RPCDoor.h (100%) rename RPCServer.cpp => src/RPCServer.cpp (99%) rename RPCServer.h => src/RPCServer.h (98%) rename RequestParser.cpp => src/RequestParser.cpp (100%) rename RequestParser.h => src/RequestParser.h (100%) rename SHAMap.cpp => src/SHAMap.cpp (100%) rename SHAMap.h => src/SHAMap.h (100%) rename SHAMapDiff.cpp => src/SHAMapDiff.cpp (100%) rename SHAMapNodes.cpp => src/SHAMapNodes.cpp (100%) rename SHAMapSync.cpp => src/SHAMapSync.cpp (100%) rename ScopedLock.h => src/ScopedLock.h (100%) rename SecureAllocator.h => src/SecureAllocator.h (100%) rename Serializer.cpp => src/Serializer.cpp (100%) rename Serializer.h => src/Serializer.h (100%) rename TaggedCache.h => src/TaggedCache.h (100%) rename TimingService.cpp => src/TimingService.cpp (100%) rename TimingService.h => src/TimingService.h (100%) rename Transaction.cpp => src/Transaction.cpp (100%) rename Transaction.h => src/Transaction.h (98%) rename TransactionMaster.cpp => src/TransactionMaster.cpp (100%) rename TransactionMaster.h => src/TransactionMaster.h (100%) rename UniqueNodeList.cpp => src/UniqueNodeList.cpp (100%) rename UniqueNodeList.h => src/UniqueNodeList.h (91%) rename ValidationCollection.cpp => src/ValidationCollection.cpp (100%) rename ValidationCollection.h => src/ValidationCollection.h (97%) rename Wallet.cpp => src/Wallet.cpp (100%) rename Wallet.h => src/Wallet.h (99%) rename base58.h => src/base58.h (100%) rename bignum.h => src/bignum.h (100%) rename key.h => src/key.h (100%) rename keystore.cpp => src/keystore.cpp (100%) rename keystore.h => src/keystore.h (100%) rename main.cpp => src/main.cpp (100%) rename rpc.cpp => src/rpc.cpp (99%) rename script.h => src/script.h (100%) rename types.h => src/types.h (100%) rename uint256.h => src/uint256.h (100%) diff --git a/SConstruct b/SConstruct index e554f082b1..b739cbcb56 100644 --- a/SConstruct +++ b/SConstruct @@ -3,6 +3,11 @@ # import glob +import re + +# Put objects files in their own directory. +for dir in ['src', 'database', 'json', 'util']: + VariantDir('obj/'+dir, dir, duplicate=0) env = Environment( tools = ['default', 'protoc'] @@ -29,16 +34,27 @@ env.Append(CXXFLAGS = ['-O0', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+D DB_SRCS = glob.glob('database/*.c') + glob.glob('database/*.cpp') JSON_SRCS = glob.glob('json/*.cpp') -NEWCOIN_SRCS = glob.glob('*.cpp') -PROTO_SRCS = env.Protoc([], 'newcoin.proto', PROTOCPYTHONOUTDIR=None) +NEWCOIN_SRCS = glob.glob('src/*.cpp') +PROTO_SRCS = env.Protoc([], 'newcoin.proto', PROTOCOUTDIR='obj/src', PROTOCPYTHONOUTDIR=None) UTIL_SRCS = glob.glob('util/*.cpp') -UNUSED_SRCS = ['HttpReply.cpp', 'ValidationCollection.cpp'] +env.Clean(PROTO_SRCS, 'site_scons/site_tools/protoc.pyc') + +# Remove unused source files. +UNUSED_SRCS = ['src/HttpReply.cpp', 'src/ValidationCollection.cpp'] for file in UNUSED_SRCS: NEWCOIN_SRCS.remove(file) -NEWCOIN_SRCS += DB_SRCS + JSON_SRCS + UTIL_SRCS + PROTO_SRCS +NEWCOIN_SRCS += DB_SRCS + JSON_SRCS + UTIL_SRCS -env.Program('newcoind', NEWCOIN_SRCS) +# Derive the object files from the source files. +NEWCOIN_OBJS = [] + +for file in NEWCOIN_SRCS: + NEWCOIN_OBJS.append('obj/' + file) + +NEWCOIN_OBJS += PROTO_SRCS + +env.Program('newcoind', NEWCOIN_OBJS) diff --git a/database/database.h b/database/database.h index 6db45f5a47..d06ac10c89 100644 --- a/database/database.h +++ b/database/database.h @@ -3,7 +3,7 @@ #include #include -#include "../types.h" +#include "../src/types.h" /* this maintains the connection to the database diff --git a/AccountState.cpp b/src/AccountState.cpp similarity index 100% rename from AccountState.cpp rename to src/AccountState.cpp diff --git a/AccountState.h b/src/AccountState.h similarity index 97% rename from AccountState.h rename to src/AccountState.h index 7459f3b52a..c8075dd0b0 100644 --- a/AccountState.h +++ b/src/AccountState.h @@ -7,7 +7,7 @@ #include -#include "json/value.h" +#include "../json/value.h" #include "types.h" #include "uint256.h" diff --git a/Application.cpp b/src/Application.cpp similarity index 98% rename from Application.cpp rename to src/Application.cpp index 78dc6fb6cc..008ec922a9 100644 --- a/Application.cpp +++ b/src/Application.cpp @@ -3,7 +3,7 @@ //#include -#include "database/SqliteDatabase.h" +#include "../database/SqliteDatabase.h" #include "Application.h" #include "Config.h" @@ -104,4 +104,4 @@ Application::~Application() delete mWalletDB; delete mHashNodeDB; delete mNetNodeDB; -} \ No newline at end of file +} diff --git a/Application.h b/src/Application.h similarity index 98% rename from Application.h rename to src/Application.h index 39cbb762ba..0f84c0b899 100644 --- a/Application.h +++ b/src/Application.h @@ -12,7 +12,7 @@ #include "Wallet.h" #include "Peer.h" #include "NetworkOPs.h" -#include "database/database.h" +#include "../database/database.h" #include diff --git a/Avalanche.h b/src/Avalanche.h similarity index 100% rename from Avalanche.h rename to src/Avalanche.h diff --git a/BinaryFormats.h b/src/BinaryFormats.h similarity index 100% rename from BinaryFormats.h rename to src/BinaryFormats.h diff --git a/BitcoinUtil.cpp b/src/BitcoinUtil.cpp similarity index 100% rename from BitcoinUtil.cpp rename to src/BitcoinUtil.cpp diff --git a/BitcoinUtil.h b/src/BitcoinUtil.h similarity index 100% rename from BitcoinUtil.h rename to src/BitcoinUtil.h diff --git a/CallRPC.cpp b/src/CallRPC.cpp similarity index 98% rename from CallRPC.cpp rename to src/CallRPC.cpp index 6094a5bfbb..11a3bc297d 100644 --- a/CallRPC.cpp +++ b/src/CallRPC.cpp @@ -11,8 +11,8 @@ #include #include -#include "json/value.h" -#include "json/reader.h" +#include "../json/value.h" +#include "../json/reader.h" #include "CallRPC.h" #include "RPC.h" diff --git a/CallRPC.h b/src/CallRPC.h similarity index 85% rename from CallRPC.h rename to src/CallRPC.h index 39cf76a6df..03b90511ba 100644 --- a/CallRPC.h +++ b/src/CallRPC.h @@ -1,7 +1,7 @@ #include -#include "json/value.h" +#include "../json/value.h" extern int commandLineRPC(int argc, char *argv[]); extern Json::Value callRPC(const std::string& strMethod, const Json::Value& params); diff --git a/Config.cpp b/src/Config.cpp similarity index 96% rename from Config.cpp rename to src/Config.cpp index 05edebda01..1a69b73d73 100644 --- a/Config.cpp +++ b/src/Config.cpp @@ -1,5 +1,5 @@ #include "Config.h" -#include "util/pugixml.hpp" +#include "../util/pugixml.hpp" #include diff --git a/Config.h b/src/Config.h similarity index 100% rename from Config.h rename to src/Config.h diff --git a/Confirmation.h b/src/Confirmation.h similarity index 96% rename from Confirmation.h rename to src/Confirmation.h index 665e7a3cd3..1695e60aa3 100644 --- a/Confirmation.h +++ b/src/Confirmation.h @@ -1,7 +1,7 @@ #ifndef __CONFIRMATION__ #define __CONFIRMATION__ -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" #include "uint256.h" #include diff --git a/ConnectionPool.cpp b/src/ConnectionPool.cpp similarity index 100% rename from ConnectionPool.cpp rename to src/ConnectionPool.cpp diff --git a/ConnectionPool.h b/src/ConnectionPool.h similarity index 100% rename from ConnectionPool.h rename to src/ConnectionPool.h diff --git a/Conversion.cpp b/src/Conversion.cpp similarity index 100% rename from Conversion.cpp rename to src/Conversion.cpp diff --git a/Conversion.h b/src/Conversion.h similarity index 100% rename from Conversion.h rename to src/Conversion.h diff --git a/DBInit.cpp b/src/DBInit.cpp similarity index 100% rename from DBInit.cpp rename to src/DBInit.cpp diff --git a/DeterministicKeys.cpp b/src/DeterministicKeys.cpp similarity index 100% rename from DeterministicKeys.cpp rename to src/DeterministicKeys.cpp diff --git a/Hanko.cpp b/src/Hanko.cpp similarity index 100% rename from Hanko.cpp rename to src/Hanko.cpp diff --git a/Hanko.h b/src/Hanko.h similarity index 100% rename from Hanko.h rename to src/Hanko.h diff --git a/HashedObject.cpp b/src/HashedObject.cpp similarity index 100% rename from HashedObject.cpp rename to src/HashedObject.cpp diff --git a/HashedObject.h b/src/HashedObject.h similarity index 100% rename from HashedObject.h rename to src/HashedObject.h diff --git a/HttpReply.cpp b/src/HttpReply.cpp similarity index 100% rename from HttpReply.cpp rename to src/HttpReply.cpp diff --git a/HttpReply.h b/src/HttpReply.h similarity index 100% rename from HttpReply.h rename to src/HttpReply.h diff --git a/HttpRequest.h b/src/HttpRequest.h similarity index 100% rename from HttpRequest.h rename to src/HttpRequest.h diff --git a/KnownNodeList.cpp b/src/KnownNodeList.cpp similarity index 95% rename from KnownNodeList.cpp rename to src/KnownNodeList.cpp index b70d2e77c1..e170935bc4 100644 --- a/KnownNodeList.cpp +++ b/src/KnownNodeList.cpp @@ -1,5 +1,5 @@ #include "KnownNodeList.h" -#include "util/pugixml.hpp" +#include "../util/pugixml.hpp" using namespace pugi; @@ -35,4 +35,4 @@ KnownNode* KnownNodeList::getNextNode() mTriedIndex++; return(&(mNodes[mTriedIndex-1])); } -} \ No newline at end of file +} diff --git a/KnownNodeList.h b/src/KnownNodeList.h similarity index 100% rename from KnownNodeList.h rename to src/KnownNodeList.h diff --git a/Ledger.cpp b/src/Ledger.cpp similarity index 99% rename from Ledger.cpp rename to src/Ledger.cpp index 469053b6d1..0a41ef5c27 100644 --- a/Ledger.cpp +++ b/src/Ledger.cpp @@ -7,7 +7,7 @@ #include "Application.h" #include "Ledger.h" -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" #include "PackedMessage.h" #include "Config.h" #include "Conversion.h" diff --git a/Ledger.h b/src/Ledger.h similarity index 99% rename from Ledger.h rename to src/Ledger.h index 23b408d595..b1869875b3 100644 --- a/Ledger.h +++ b/src/Ledger.h @@ -7,7 +7,7 @@ #include #include -#include "json/value.h" +#include "../json/value.h" #include "Transaction.h" #include "types.h" diff --git a/LedgerAcquire.cpp b/src/LedgerAcquire.cpp similarity index 100% rename from LedgerAcquire.cpp rename to src/LedgerAcquire.cpp diff --git a/LedgerAcquire.h b/src/LedgerAcquire.h similarity index 98% rename from LedgerAcquire.h rename to src/LedgerAcquire.h index c1b5866391..4508a2d83f 100644 --- a/LedgerAcquire.h +++ b/src/LedgerAcquire.h @@ -9,7 +9,7 @@ #include "Ledger.h" #include "Peer.h" -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" class LedgerAcquire : public boost::enable_shared_from_this { // A ledger we are trying to acquire diff --git a/LedgerHistory.cpp b/src/LedgerHistory.cpp similarity index 100% rename from LedgerHistory.cpp rename to src/LedgerHistory.cpp diff --git a/LedgerHistory.h b/src/LedgerHistory.h similarity index 100% rename from LedgerHistory.h rename to src/LedgerHistory.h diff --git a/LedgerMaster.cpp b/src/LedgerMaster.cpp similarity index 100% rename from LedgerMaster.cpp rename to src/LedgerMaster.cpp diff --git a/LedgerMaster.h b/src/LedgerMaster.h similarity index 100% rename from LedgerMaster.h rename to src/LedgerMaster.h diff --git a/LocalAccount.h b/src/LocalAccount.h similarity index 100% rename from LocalAccount.h rename to src/LocalAccount.h diff --git a/LocalTransaction.cpp b/src/LocalTransaction.cpp similarity index 98% rename from LocalTransaction.cpp rename to src/LocalTransaction.cpp index 5a1196956a..beb1133cb9 100644 --- a/LocalTransaction.cpp +++ b/src/LocalTransaction.cpp @@ -1,7 +1,7 @@ #include -#include "json/writer.h" +#include "../json/writer.h" #include "LocalTransaction.h" #include "Application.h" diff --git a/LocalTransaction.h b/src/LocalTransaction.h similarity index 98% rename from LocalTransaction.h rename to src/LocalTransaction.h index 051d129293..2089aefa06 100644 --- a/LocalTransaction.h +++ b/src/LocalTransaction.h @@ -7,7 +7,7 @@ #include -#include "json/value.h" +#include "../json/value.h" #include "uint256.h" #include "Transaction.h" diff --git a/NetworkOPs.cpp b/src/NetworkOPs.cpp similarity index 100% rename from NetworkOPs.cpp rename to src/NetworkOPs.cpp diff --git a/NetworkOPs.h b/src/NetworkOPs.h similarity index 100% rename from NetworkOPs.h rename to src/NetworkOPs.h diff --git a/NetworkStatus.h b/src/NetworkStatus.h similarity index 100% rename from NetworkStatus.h rename to src/NetworkStatus.h diff --git a/NewcoinAddress.cpp b/src/NewcoinAddress.cpp similarity index 100% rename from NewcoinAddress.cpp rename to src/NewcoinAddress.cpp diff --git a/NewcoinAddress.h b/src/NewcoinAddress.h similarity index 100% rename from NewcoinAddress.h rename to src/NewcoinAddress.h diff --git a/PackedMessage.cpp b/src/PackedMessage.cpp similarity index 100% rename from PackedMessage.cpp rename to src/PackedMessage.cpp diff --git a/PackedMessage.h b/src/PackedMessage.h similarity index 98% rename from PackedMessage.h rename to src/PackedMessage.h index 0c1a134d11..16363d0c1c 100644 --- a/PackedMessage.h +++ b/src/PackedMessage.h @@ -14,7 +14,7 @@ #include #include -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" // The header size for packed messages // len(4)+type(2) diff --git a/Peer.cpp b/src/Peer.cpp similarity index 99% rename from Peer.cpp rename to src/Peer.cpp index 6c50720642..8726284e9d 100644 --- a/Peer.cpp +++ b/src/Peer.cpp @@ -6,7 +6,7 @@ #include #include -#include "json/writer.h" +#include "../json/writer.h" #include "Peer.h" #include "KnownNodeList.h" diff --git a/Peer.h b/src/Peer.h similarity index 98% rename from Peer.h rename to src/Peer.h index f874bbd46d..a85d9f7cde 100644 --- a/Peer.h +++ b/src/Peer.h @@ -6,7 +6,7 @@ #include #include -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" #include "PackedMessage.h" #include "Ledger.h" #include "Transaction.h" diff --git a/PeerDoor.cpp b/src/PeerDoor.cpp similarity index 100% rename from PeerDoor.cpp rename to src/PeerDoor.cpp diff --git a/PeerDoor.h b/src/PeerDoor.h similarity index 100% rename from PeerDoor.h rename to src/PeerDoor.h diff --git a/PubKeyCache.cpp b/src/PubKeyCache.cpp similarity index 100% rename from PubKeyCache.cpp rename to src/PubKeyCache.cpp diff --git a/PubKeyCache.h b/src/PubKeyCache.h similarity index 100% rename from PubKeyCache.h rename to src/PubKeyCache.h diff --git a/RPC.h b/src/RPC.h similarity index 97% rename from RPC.h rename to src/RPC.h index ccfdf9650c..f4f75f79f7 100644 --- a/RPC.h +++ b/src/RPC.h @@ -1,7 +1,7 @@ #include #include -#include "json/value.h" +#include "../json/value.h" enum http_status_type { diff --git a/RPCCommands.cpp b/src/RPCCommands.cpp similarity index 100% rename from RPCCommands.cpp rename to src/RPCCommands.cpp diff --git a/RPCCommands.h b/src/RPCCommands.h similarity index 100% rename from RPCCommands.h rename to src/RPCCommands.h diff --git a/RPCDoor.cpp b/src/RPCDoor.cpp similarity index 100% rename from RPCDoor.cpp rename to src/RPCDoor.cpp diff --git a/RPCDoor.h b/src/RPCDoor.h similarity index 100% rename from RPCDoor.h rename to src/RPCDoor.h diff --git a/RPCServer.cpp b/src/RPCServer.cpp similarity index 99% rename from RPCServer.cpp rename to src/RPCServer.cpp index abe10c7314..67017af4fe 100644 --- a/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -5,9 +5,9 @@ #include #include -#include "json/value.h" -#include "json/reader.h" -#include "json/writer.h" +#include "../json/value.h" +#include "../json/reader.h" +#include "../json/writer.h" #include "RPCServer.h" #include "RequestParser.h" diff --git a/RPCServer.h b/src/RPCServer.h similarity index 98% rename from RPCServer.h rename to src/RPCServer.h index 7787b30a42..eb9bee52cf 100644 --- a/RPCServer.h +++ b/src/RPCServer.h @@ -3,7 +3,7 @@ #include #include -#include "json/value.h" +#include "../json/value.h" #include "HttpRequest.h" #include "RequestParser.h" diff --git a/RequestParser.cpp b/src/RequestParser.cpp similarity index 100% rename from RequestParser.cpp rename to src/RequestParser.cpp diff --git a/RequestParser.h b/src/RequestParser.h similarity index 100% rename from RequestParser.h rename to src/RequestParser.h diff --git a/SHAMap.cpp b/src/SHAMap.cpp similarity index 100% rename from SHAMap.cpp rename to src/SHAMap.cpp diff --git a/SHAMap.h b/src/SHAMap.h similarity index 100% rename from SHAMap.h rename to src/SHAMap.h diff --git a/SHAMapDiff.cpp b/src/SHAMapDiff.cpp similarity index 100% rename from SHAMapDiff.cpp rename to src/SHAMapDiff.cpp diff --git a/SHAMapNodes.cpp b/src/SHAMapNodes.cpp similarity index 100% rename from SHAMapNodes.cpp rename to src/SHAMapNodes.cpp diff --git a/SHAMapSync.cpp b/src/SHAMapSync.cpp similarity index 100% rename from SHAMapSync.cpp rename to src/SHAMapSync.cpp diff --git a/ScopedLock.h b/src/ScopedLock.h similarity index 100% rename from ScopedLock.h rename to src/ScopedLock.h diff --git a/SecureAllocator.h b/src/SecureAllocator.h similarity index 100% rename from SecureAllocator.h rename to src/SecureAllocator.h diff --git a/Serializer.cpp b/src/Serializer.cpp similarity index 100% rename from Serializer.cpp rename to src/Serializer.cpp diff --git a/Serializer.h b/src/Serializer.h similarity index 100% rename from Serializer.h rename to src/Serializer.h diff --git a/TaggedCache.h b/src/TaggedCache.h similarity index 100% rename from TaggedCache.h rename to src/TaggedCache.h diff --git a/TimingService.cpp b/src/TimingService.cpp similarity index 100% rename from TimingService.cpp rename to src/TimingService.cpp diff --git a/TimingService.h b/src/TimingService.h similarity index 100% rename from TimingService.h rename to src/TimingService.h diff --git a/Transaction.cpp b/src/Transaction.cpp similarity index 100% rename from Transaction.cpp rename to src/Transaction.cpp diff --git a/Transaction.h b/src/Transaction.h similarity index 98% rename from Transaction.h rename to src/Transaction.h index 04a72b2be9..1f0501b508 100644 --- a/Transaction.h +++ b/src/Transaction.h @@ -7,11 +7,11 @@ #include #include -#include "json/value.h" +#include "../json/value.h" #include "key.h" #include "uint256.h" -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" #include "Hanko.h" #include "Serializer.h" #include "SHAMap.h" diff --git a/TransactionMaster.cpp b/src/TransactionMaster.cpp similarity index 100% rename from TransactionMaster.cpp rename to src/TransactionMaster.cpp diff --git a/TransactionMaster.h b/src/TransactionMaster.h similarity index 100% rename from TransactionMaster.h rename to src/TransactionMaster.h diff --git a/UniqueNodeList.cpp b/src/UniqueNodeList.cpp similarity index 100% rename from UniqueNodeList.cpp rename to src/UniqueNodeList.cpp diff --git a/UniqueNodeList.h b/src/UniqueNodeList.h similarity index 91% rename from UniqueNodeList.h rename to src/UniqueNodeList.h index dc7d311f02..9727cb7c98 100644 --- a/UniqueNodeList.h +++ b/src/UniqueNodeList.h @@ -1,6 +1,6 @@ #ifndef __UNIQUE_NODE_LIST__ #define __UNIQUE_NODE_LIST__ -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" #include "uint256.h" class UniqueNodeList @@ -22,4 +22,4 @@ public: }; -#endif \ No newline at end of file +#endif diff --git a/ValidationCollection.cpp b/src/ValidationCollection.cpp similarity index 100% rename from ValidationCollection.cpp rename to src/ValidationCollection.cpp diff --git a/ValidationCollection.h b/src/ValidationCollection.h similarity index 97% rename from ValidationCollection.h rename to src/ValidationCollection.h index db3c06fdd3..eb25be859e 100644 --- a/ValidationCollection.h +++ b/src/ValidationCollection.h @@ -1,7 +1,7 @@ #ifndef __VALIDATION_COLLECTION__ #define __VALIDATION_COLLECTION__ -#include "newcoin.pb.h" +#include "../obj/src/newcoin.pb.h" #include "uint256.h" #include "types.h" #include "Ledger.h" @@ -53,4 +53,4 @@ public: int getSeqNum(uint32 ledgerIndex); }; -#endif \ No newline at end of file +#endif diff --git a/Wallet.cpp b/src/Wallet.cpp similarity index 100% rename from Wallet.cpp rename to src/Wallet.cpp diff --git a/Wallet.h b/src/Wallet.h similarity index 99% rename from Wallet.h rename to src/Wallet.h index 0e8d22b666..112a88a2cd 100644 --- a/Wallet.h +++ b/src/Wallet.h @@ -10,7 +10,7 @@ #include "openssl/ec.h" -#include "json/value.h" +#include "../json/value.h" #include "uint256.h" #include "Serializer.h" diff --git a/base58.h b/src/base58.h similarity index 100% rename from base58.h rename to src/base58.h diff --git a/bignum.h b/src/bignum.h similarity index 100% rename from bignum.h rename to src/bignum.h diff --git a/key.h b/src/key.h similarity index 100% rename from key.h rename to src/key.h diff --git a/keystore.cpp b/src/keystore.cpp similarity index 100% rename from keystore.cpp rename to src/keystore.cpp diff --git a/keystore.h b/src/keystore.h similarity index 100% rename from keystore.h rename to src/keystore.h diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp diff --git a/rpc.cpp b/src/rpc.cpp similarity index 99% rename from rpc.cpp rename to src/rpc.cpp index c06997cee6..e15d955f0e 100644 --- a/rpc.cpp +++ b/src/rpc.cpp @@ -8,8 +8,8 @@ #include #include -#include "json/value.h" -#include "json/writer.h" +#include "../json/value.h" +#include "../json/writer.h" #include "RPC.h" #include "BitcoinUtil.h" diff --git a/script.h b/src/script.h similarity index 100% rename from script.h rename to src/script.h diff --git a/types.h b/src/types.h similarity index 100% rename from types.h rename to src/types.h diff --git a/uint256.h b/src/uint256.h similarity index 100% rename from uint256.h rename to src/uint256.h From b8d23f9f9825773d5fdf75a5dc2ea4280d596d6e Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 22:45:53 -0800 Subject: [PATCH 4/9] Initial .gitignore. --- .gitignore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..2c459dad09 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# .gitignore + +# Ignore vim swap files. +*.swp + +# Ignore SCons support files. +.sconsign.dblite + +# Ignore python compiled files. +*.pyc + +# Ignore object fiels. +*.o +obj/* + +newcoind + From 84505623da63a14db352860162d8ba405ae18efb Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 22:47:14 -0800 Subject: [PATCH 5/9] Remove unnecessary include from SConstruct. --- SConstruct | 1 - 1 file changed, 1 deletion(-) diff --git a/SConstruct b/SConstruct index b739cbcb56..cf7e75ef03 100644 --- a/SConstruct +++ b/SConstruct @@ -3,7 +3,6 @@ # import glob -import re # Put objects files in their own directory. for dir in ['src', 'database', 'json', 'util']: From 99735d92fdb119f0f9bbf1adfe7b836e64f525c5 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 22:49:26 -0800 Subject: [PATCH 6/9] Fix typo. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2c459dad09..12994b8846 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ # Ignore python compiled files. *.pyc -# Ignore object fiels. +# Ignore object files. *.o obj/* From c57ba4976a3d583d264ca515b14b33709dd65d82 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 22:54:19 -0800 Subject: [PATCH 7/9] Move newcoin.proto to src/ --- SConstruct | 2 +- newcoin.proto => src/newcoin.proto | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename newcoin.proto => src/newcoin.proto (100%) diff --git a/SConstruct b/SConstruct index cf7e75ef03..8b11942f9c 100644 --- a/SConstruct +++ b/SConstruct @@ -34,7 +34,7 @@ env.Append(CXXFLAGS = ['-O0', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+D DB_SRCS = glob.glob('database/*.c') + glob.glob('database/*.cpp') JSON_SRCS = glob.glob('json/*.cpp') NEWCOIN_SRCS = glob.glob('src/*.cpp') -PROTO_SRCS = env.Protoc([], 'newcoin.proto', PROTOCOUTDIR='obj/src', PROTOCPYTHONOUTDIR=None) +PROTO_SRCS = env.Protoc([], 'src/newcoin.proto', PROTOCOUTDIR='obj', PROTOCPYTHONOUTDIR=None) UTIL_SRCS = glob.glob('util/*.cpp') env.Clean(PROTO_SRCS, 'site_scons/site_tools/protoc.pyc') diff --git a/newcoin.proto b/src/newcoin.proto similarity index 100% rename from newcoin.proto rename to src/newcoin.proto From 2e268d90a49f9ca87721d12acd1714e143f01f37 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 6 Mar 2012 23:06:08 -0800 Subject: [PATCH 8/9] Remove obsolete Makefile. --- Makefile | 119 ------------------------------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index dd05707875..0000000000 --- a/Makefile +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright (c) 2009-2010 Satoshi Nakamoto -# Distributed under the MIT/X11 software license, see the accompanying -# file license.txt or http://www.opensource.org/licenses/mit-license.php. - -CXX=g++ -I/packages/openssl-1.0.0/include -Wall -Wno-sign-compare -Wno-char-subscripts - -DEFS= - -LIBS= \ - -pthread \ - -Wl,-Bstatic \ - -l boost_system-mt \ - -l boost_filesystem-mt \ - -l boost_program_options-mt \ - -l boost_thread-mt \ - -l protobuf \ - /packages/openssl-1.0.0/libssl.a /packages/openssl-1.0.0/libcrypto.a - -ifdef USE_UPNP - LIBS += -l miniupnpc DEFS += -DUSE_UPNP=$(USE_UPNP) -endif - -LIBS+= \ - -Wl,-Bdynamic \ - -l z \ - -l dl - -DEBUGFLAGS=-g -DDEBUG -CXXFLAGS=-O0 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) -HEADERS = \ - Application.h \ - base58.h \ - bignum.h \ - BitcoinUtil.h \ - CallRPC.h \ - Config.h \ - ConnectionPool.h \ - Conversion.h \ - HttpReply.h \ - HttpRequest.h \ - key.h \ - keystore.h \ - KnownNodeList.h \ - Ledger.h \ - LedgerHistory.h \ - LedgerMaster.h \ - NetworkThread.h \ - NewcoinAddress.h \ - PackedMessage.h \ - PeerDoor.h \ - Peer.h \ - RequestParser.h \ - RPCCommands.h \ - RPCDoor.h \ - RPC.h \ - RPCServer.h \ - script.h \ - SecureAllocator.h \ - TimingService.h \ - TransactionBundle.h \ - Transaction.h \ - types.h \ - uint256.h \ - UniqueNodeList.h \ - ValidationCollection.h \ - Wallet.h - -SRCS= keystore.cpp BitcoinUtil.cpp \ - main.cpp Hanko.cpp Transaction.cpp SHAMap.cpp SHAMapNodes.cpp Serializer.cpp Ledger.cpp \ - AccountState.cpp Wallet.cpp NewcoinAddress.cpp Config.cpp PackedMessage.cpp SHAMapSync.cpp \ - Application.cpp TimingService.cpp KnownNodeList.cpp ConnectionPool.cpp Peer.cpp LedgerAcquire.cpp \ - PeerDoor.cpp RPCDoor.cpp RPCServer.cpp rpc.cpp Conversion.cpp RequestParser.cpp HashedObject.cpp \ - UniqueNodeList.cpp PubKeyCache.cpp SHAMapDiff.cpp DeterministicKeys.cpp LedgerMaster.cpp \ - LedgerHistory.cpp NetworkOPs.cpp CallRPC.cpp DBInit.cpp LocalTransaction.cpp TransactionMaster.cpp - -DBSRCS= SqliteDatabase.cpp database.cpp -DBSRCC= sqlite3.c - -UTILSRCS= pugixml.cpp - -JSONSRCS= json_reader.cpp json_value.cpp json_writer.cpp - -# Application.cpp HttpReply.cpp main.cpp RPCCommands.cpp \ -# BitcoinUtil.cpp keystore.cpp NewcoinAddress.cpp rpc.cpp UniqueNodeList.cpp \ -# CallRPC.cpp KnownNodeList.cpp PackedMessage.cpp RPCDoor.cpp ValidationCollection.cpp \ -# Config.cpp Ledger.cpp Peer.cpp RPCServer.cpp Wallet.cpp \ -#ConnectionPool.cpp LedgerHistory.cpp PeerDoor.cpp TimingService.cpp \ -# Conversion.cpp LedgerMaster.cpp RequestParser.cpp TransactionBundle.cpp util/pugixml.o \ -# database/SqliteDatabase.cpp database/database.cpp -# database/linux/mysqldatabase.cpp database/database.cpp database/SqliteDatabase.cpp - -OBJS= $(SRCS:%.cpp=%.o) $(DBSRCS:%.cpp=database/%.o) $(DBSRCC:%.c=database/%.o) -OBJS+= $(UTILSRCS:%.cpp=util/%.o) newcoin.pb.o -OBJS+= $(JSONSRCS:%.cpp=json/%.o) -#cryptopp/obj/sha.o cryptopp/obj/cpu.o - -all: newcoind - -newcoin.pb.h: newcoin.proto - protoc --cpp_out=. newcoin.proto - -%.o: %.cpp - $(CXX) -c $(CXXFLAGS) -o $@ $< - - -newcoind: $(OBJS) - $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) - -.dep: newcoin.pb.h - $(CXX) -M $(SRCS) $(CXXFLAGS) > .dep - -clean: - -rm -f newcoind - -rm -f *.o database/*.o util/*.o - -rm -f headers.h.gch - -rm -f newcoin.pb.* - -rm -f .dep - -include .dep From af929c7d49485778eff407e0076434f6af85c536 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Wed, 7 Mar 2012 14:54:44 -0800 Subject: [PATCH 9/9] Kudge protoc builder to work for us. --- site_scons/site_tools/protoc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site_scons/site_tools/protoc.py b/site_scons/site_tools/protoc.py index dc47634d4f..e3458bcf2a 100644 --- a/site_scons/site_tools/protoc.py +++ b/site_scons/site_tools/protoc.py @@ -54,7 +54,11 @@ def ProtocEmitter(target, source, env): target.append(env['PROTOCFDSOUT']) except KeyError: pass - + + # XXX KLUDGE: Force things to be right. + env['PROTOCOUTDIR'] = 'obj/src' + env['PROTOCPROTOPATH'] = ['src'] + #~ print "PROTOC SOURCE:", [str(s) for s in source] #~ print "PROTOC TARGET:", [str(s) for s in target]