diff --git a/Build-gcc/makefile b/Build-gcc/makefile index 684687e..5e8c05d 100644 --- a/Build-gcc/makefile +++ b/Build-gcc/makefile @@ -12,6 +12,11 @@ RM := rm -include subdir.mk -include objects.mk +DEBUG_FLAGS= -g +CXXFLAGS= -std=c++11 -fopenmp -I/opt/local/include -I/usr/local/include -Wall -fpic +LDFLAGS= -L /opt/local/lib -L /usr/local/lib + + ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) -include $(C++_DEPS) @@ -35,53 +40,32 @@ endif -include ../makefile.defs -.DEFAULT_GOAL := libzerocoin +.DEFAULT_GOAL := libzerocoin.so # Add inputs and outputs from these tool invocations to the build variables # All Target -all: libzerocoin test tutorial +all: libzerocoin.so test tutorial # Tool invocations -libzerocoin: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: Cross G++ Linker' - g++ -fopenmp -L/opt/local/lib -shared -o "libzerocoin.so" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' +libzerocoin.so: $(OBJS) $(USER_OBJS) + ${CXX} ${LDFLAGS} -shared -o "libzerocoin.so" $(OBJS) $(USER_OBJS) $(LIBS) test: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: Cross G++ Linker' - g++ -fopenmp -L/opt/local/lib -o "tests" ../Tests.cpp $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' + ${CXX} ${LDFLAGS} -o "tests" ../Tests.cpp $(OBJS) $(USER_OBJS) $(LIBS) paramgen: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: Cross G++ Linker' - g++ -fopenmp -L/opt/local/lib -o "paramgen" ../paramgen.cpp $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' + ${CXX} ${LDFLAGS} -o "paramgen" ../paramgen.cpp $(OBJS) $(USER_OBJS) $(LIBS) benchmark: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: Cross G++ Linker' - g++ -fopenmp -L/opt/local/lib -o "benchmark" ../Benchmark.cpp $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' + ${CXX} ${LDFLAGS} -o "benchmark" ../Benchmark.cpp $(OBJS) $(USER_OBJS) $(LIBS) tutorial: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: Cross G++ Linker' - g++ -fopenmp -L/opt/local/lib -o "tutorial" ../Tutorial.cpp $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' + ${CXX} ${LDFLAGS} -o "tutorial" ../Tutorial.cpp $(OBJS) $(USER_OBJS) $(LIBS) # Other Targets clean: - -$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(LIBRARIES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libzerocoin.so tests benchmark paramgen - -@echo ' ' + -$(RM) -f $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(LIBRARIES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libzerocoin.so tests benchmark paramgen .PHONY: all clean dependents .SECONDARY: diff --git a/Build-gcc/objects.mk b/Build-gcc/objects.mk index 02799e3..90d640b 100644 --- a/Build-gcc/objects.mk +++ b/Build-gcc/objects.mk @@ -4,5 +4,5 @@ USER_OBJS := -LIBS := -I/opt/local/include -lboost_system-mt -lcrypto +LIBS := -I/opt/local/include -lboost_system -lcrypto diff --git a/Build-gcc/subdir.mk b/Build-gcc/subdir.mk index c18b53f..6e68ae7 100644 --- a/Build-gcc/subdir.mk +++ b/Build-gcc/subdir.mk @@ -38,10 +38,6 @@ CPP_DEPS += \ # Each subdirectory must supply rules for building sources it contributes %.o: ../%.cpp - @echo 'Building file: $<' - @echo 'Invoking: Cross G++ Compiler' - g++ -fopenmp -g -L/opt/local/lib -I/opt/local/include -g -Wall -fpic -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' + ${CXX} ${CXXFLAGS} ${DEBUG_FLAGS} -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" diff --git a/bitcoin_bignum/serialize.h b/bitcoin_bignum/serialize.h index e3d9939..eac4e06 100644 --- a/bitcoin_bignum/serialize.h +++ b/bitcoin_bignum/serialize.h @@ -895,19 +895,6 @@ class CDataStream iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); } void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); } - void insert(iterator it, const_iterator first, const_iterator last) - { - assert(last - first >= 0); - if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos) - { - // special case for inserting at the front when there's room - nReadPos -= (last - first); - memcpy(&vch[nReadPos], &first[0], last - first); - } - else - vch.insert(it, first, last); - } - void insert(iterator it, std::vector::const_iterator first, std::vector::const_iterator last) { assert(last - first >= 0);