-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (43 loc) · 1013 Bytes
/
Makefile
File metadata and controls
60 lines (43 loc) · 1013 Bytes
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
OPT_LEVEL ?=
USE_SSE2 ?=
CFLAGS = -I. -Wall -Werror -fno-strict-aliasing $(OPT_LEVEL)
CXXFLAGS = -I. -Wall -Werror --std=c++11 $(OPT_LEVEL)
ifeq ($(USE_SSE2),1)
CFLAGS += -msse2
endif
PROGS = test/hash \
test/hash.js \
test/vectest \
test/vectest.js
all: $(PROGS)
OBJS = keccak/keccak.o \
blake/blake.o \
skein/skein.o \
groestl/groestl.o \
oaes/oaes_lib.o \
cryptonight/cryptonight.o
ifeq ($(USE_SSE2),1)
OBJS += jh/jh_sse2_opt64.o
else
OBJS += jh/jh_ansi_opt64.o
endif
EM_OBJS = $(OBJS:.o=.js.o)
# emscripten docker
EM_DOCKER = docker run -v $(CURDIR):/src:z,rw \
trzeci/emscripten:sdk-tag-1.37.21-64bit
EMCC = $(EM_DOCKER) emcc
EM++ = $(EM_DOCKER) em++
$(EM_OBJS): %.js.o: %.c
$(EMCC) $(CFLAGS) -o $@ $<
%.js: %.cc
$(EM++) $(CXXFLAGS) -o $@ $^
%.js: %.c
$(EMCC) $(CFLAGS) -o $@ $^
test/hash: $(OBJS)
test/hash.js: $(EM_OBJS)
test/vectest: $(OBJS)
test/vectest.js: $(EM_OBJS)
test: all
(cd test && ./test.sh)
clean:
rm -f $(OBJS) $(EM_OBJS) $(PROGS)