Move sources to src and build objs in obj.

This commit is contained in:
Arthur Britto
2012-03-06 22:43:06 -08:00
parent 82af29a21d
commit c513e45754
95 changed files with 55 additions and 39 deletions

View File

@@ -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)

View File

@@ -3,7 +3,7 @@
#include <string>
#include <vector>
#include "../types.h"
#include "../src/types.h"
/*
this maintains the connection to the database

View File

@@ -7,7 +7,7 @@
#include <boost/shared_ptr.hpp>
#include "json/value.h"
#include "../json/value.h"
#include "types.h"
#include "uint256.h"

View File

@@ -3,7 +3,7 @@
//#include <boost/log/trivial.hpp>
#include "database/SqliteDatabase.h"
#include "../database/SqliteDatabase.h"
#include "Application.h"
#include "Config.h"

View File

@@ -12,7 +12,7 @@
#include "Wallet.h"
#include "Peer.h"
#include "NetworkOPs.h"
#include "database/database.h"
#include "../database/database.h"
#include <boost/asio.hpp>

View File

@@ -11,8 +11,8 @@
#include <openssl/buffer.h>
#include <openssl/evp.h>
#include "json/value.h"
#include "json/reader.h"
#include "../json/value.h"
#include "../json/reader.h"
#include "CallRPC.h"
#include "RPC.h"

View File

@@ -1,7 +1,7 @@
#include <string>
#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);

View File

@@ -1,5 +1,5 @@
#include "Config.h"
#include "util/pugixml.hpp"
#include "../util/pugixml.hpp"
#include <boost/lexical_cast.hpp>

View File

@@ -1,7 +1,7 @@
#ifndef __CONFIRMATION__
#define __CONFIRMATION__
#include "newcoin.pb.h"
#include "../obj/src/newcoin.pb.h"
#include "uint256.h"
#include <boost/shared_ptr.hpp>

View File

@@ -1,5 +1,5 @@
#include "KnownNodeList.h"
#include "util/pugixml.hpp"
#include "../util/pugixml.hpp"
using namespace pugi;

View File

@@ -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"

View File

@@ -7,7 +7,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include "json/value.h"
#include "../json/value.h"
#include "Transaction.h"
#include "types.h"

View File

@@ -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<LedgerAcquire>
{ // A ledger we are trying to acquire

View File

@@ -1,7 +1,7 @@
#include <boost/lexical_cast.hpp>
#include "json/writer.h"
#include "../json/writer.h"
#include "LocalTransaction.h"
#include "Application.h"

View File

@@ -7,7 +7,7 @@
#include <boost/shared_ptr.hpp>
#include "json/value.h"
#include "../json/value.h"
#include "uint256.h"
#include "Transaction.h"

View File

@@ -14,7 +14,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/cstdint.hpp>
#include "newcoin.pb.h"
#include "../obj/src/newcoin.pb.h"
// The header size for packed messages
// len(4)+type(2)

View File

@@ -6,7 +6,7 @@
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#include "json/writer.h"
#include "../json/writer.h"
#include "Peer.h"
#include "KnownNodeList.h"

View File

@@ -6,7 +6,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio.hpp>
#include "newcoin.pb.h"
#include "../obj/src/newcoin.pb.h"
#include "PackedMessage.h"
#include "Ledger.h"
#include "Transaction.h"

View File

@@ -1,7 +1,7 @@
#include <string>
#include <map>
#include "json/value.h"
#include "../json/value.h"
enum http_status_type
{

View File

@@ -5,9 +5,9 @@
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#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"

View File

@@ -3,7 +3,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio.hpp>
#include "json/value.h"
#include "../json/value.h"
#include "HttpRequest.h"
#include "RequestParser.h"

View File

@@ -7,11 +7,11 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/cstdint.hpp>
#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"

View File

@@ -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

View File

@@ -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"

View File

@@ -10,7 +10,7 @@
#include "openssl/ec.h"
#include "json/value.h"
#include "../json/value.h"
#include "uint256.h"
#include "Serializer.h"

View File

View File

@@ -8,8 +8,8 @@
#include <openssl/buffer.h>
#include <openssl/evp.h>
#include "json/value.h"
#include "json/writer.h"
#include "../json/value.h"
#include "../json/writer.h"
#include "RPC.h"
#include "BitcoinUtil.h"