-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmakefile.unix
73 lines (56 loc) · 2.05 KB
/
makefile.unix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright (c) Videlicet[2014]++
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
DEFS=-DBOOST_SPIRIT_THREADSAFE -DBOOST_THREAD_USE_LIB
DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/build $(CURDIR)/hash $(BOOST_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
#For Boost 1.55 Builds Uncomment the Following
#BOOST_LIB_PATH=/usr/local/lib
#BOOST_INCLUDE_PATH=/usr/include/boost
LIBS += \
-l boost_system$(BOOST_LIB_SUFFIX) \
-l boost_filesystem$(BOOST_LIB_SUFFIX) \
-l boost_program_options$(BOOST_LIB_SUFFIX) \
-l boost_thread$(BOOST_LIB_SUFFIX) \
-l crypto \
-l gmp
DEBUGFLAGS=-g
CXXFLAGS=-O2
xCXXFLAGS=-pthread -static-libgcc -static-libstdc++ -Wall -Wextra -Wno-sign-compare -Wno-invalid-offsetof -Wno-unused-parameter -Wformat -Wformat-security \
$(DEBUGFLAGS) $(DEFS) $(CXXFLAGS)
HEADERS = $(wildcard *.h)
OBJS= \
build/skein.o \
build/skein_block.o \
build/KeccakDuplex.o \
build/KeccakSponge.o \
build/Keccak-compact64.o \
build/KeccakHash.o \
build/util.o \
build/prime.o \
build/miner.o
all: miner
build/%.o: %.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -fpermissive -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
build/%.o: hash/%.c $(HEADERS)
$(CXX) -c $(xCXXFLAGS) -MMD -fpermissive -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
build/%.o: hash/%.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
miner: $(OBJS:obj/%=build/%)
$(CXX) $(xCXXFLAGS) -rdynamic -o $@ $^ $(LDFLAGS) $(LIBS)
clean:
-rm -f miner
-rm -f build/*.o
FORCE: