This repository has been archived by the owner on Mar 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
103 lines (81 loc) · 2.28 KB
/
Makefile
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
CXX = c++
AR = ar
ARFLAGS = -cr
CXXFLAGS = -O2 -g -Wall -Wextra
CPPFLAGS =
LDFLAGS =
LIBUTREEXO = libutreexo.a
LIBUTREEXO_OBJS =
LIBUTREEXO_OBJS += blockproof.o
LIBUTREEXO_OBJS += forest.o
LIBUTREEXO_OBJS += pollard.o
LIBUTREEXO_OBJS += polnode.o
LIBUTREEXO_OBJS += uint256.o
LIBUTREEXO_OBJS += undo.o
LIBUTREEXO_OBJS += utreexo.o
LIBUTREEXO_OBJS += util/strencodings.o
LIBUTREEXO_OBJS += crypto/sha256.o
LIBUTREEXO_OBJS += crypto/sha256_avx2.o
LIBUTREEXO_OBJS += crypto/sha256_shani.o
LIBUTREEXO_OBJS += crypto/sha256_sse4.o
LIBUTREEXO_OBJS += crypto/sha256_sse41.o
TEST_OBJS =
TEST_OBJS += test_utreexo.o
TEST_UTREEXO = test_utreexo
OBJS =
OBJS += $(LIBUTREEXO_OBJS)
OBJS += $(TEST_OBJS)
LIBS =
LIBS += $(LIBUTREEXO)
PROGS =
PROGS += $(TEST_UTREEXO)
CXXFLAGS_INT = -std=c++11
CPPFLAGS_INT = -I.
LDFLAGS_INT =
SSE41_CXXFLAGS = -msse4.1
AVX2_CXXFLAGS = -mavx -mavx2
SHANI_CXXFLAGS = -msse4 -msha
crypto/sha256_avx2.o: CXXFLAGS_INT += $(AVX2_CXXFLAGS)
crypto/sha256_avx2.o: CPPFLAGS_INT += -DENABLE_AVX2
crypto/sha256_shani.o: CXXFLAGS_INT += $(SHANI_CXXFLAGS)
crypto/sha256_shani.o: CPPFLAGS_INT += -DENABLE_SHANI
crypto/sha256_sse41.o: CXXFLAGS_INT += $(SSE41_CXXFLAGS)
crypto/sha256_sse41.o: CPPFLAGS_INT += -DENABLE_SSE41
crypto/sha256.o: CPPFLAGS_INT += -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DUSE_ASM
V=
_notat_=@
_notat_0=$(_notat_)
_notat_1=@\#
_at_=@
_at_0=$(_at_)
_at_1=
at = $(_at_$(V))
notat = $(_notat_$(V))
DEPDIR=.deps
DEPS = $(addprefix $(DEPDIR)/,$(OBJS:.o=.o.Tpo))
DIRS = $(dir $(DEPS))
DEPDIRSTAMP=$(DEPDIR)/.stamp
all: $(PROGS) $(LIBS)
-include $(DEPS)
$(DEPDIRSTAMP):
@mkdir -p $(dir $(DEPS))
@touch $@
$(OBJS): | $(DEPDIRSTAMP)
%.o: %.cpp
$(notat)echo CXX $<
$(at)$(CXX) $(CPPFLAGS_INT) $(CPPFLAGS) $(CXXFLAGS_INT) $(CXXFLAGS) $(CXXFLAGS_EXTRA) -c -MMD -MP -MF .deps/[email protected] $< -o $@
crypto/%.o: crypto/%.cpp
$(notat)echo CXX $<
$(at)$(CXX) $(CPPFLAGS_INT) $(CPPFLAGS) $(CXXFLAGS_INT) $(CXXFLAGS) -c -MMD -MP -MF .deps/[email protected] $< -o $@
$(LIBUTREEXO): $(LIBUTREEXO_OBJS)
$(notat)echo AR $@
$(at)$(AR) $(ARFLAGS) $@ $^
$(TEST_UTREEXO): $(TEST_OBJS) $(LIBUTREEXO)
$(notat)echo LINK $@
$(at)$(CXX) $(CXXFLAGS_INT) $(CXXFLAGS) $(LDFLAGS_INT) $(LDFLAGS) $^ -o $@
clean:
-rm -f $(PROGS)
-rm -f $(LIBS)
-rm -f $(OBJS)
-rm -f $(DEPS)
-rm -rf $(DEPDIR)