-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (25 loc) · 973 Bytes
/
Makefile
File metadata and controls
32 lines (25 loc) · 973 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
CXX ?= g++
UNAME_S := $(shell uname -s)
SRC := src/main.cpp
BIN := devanity
PKG_CFLAGS := $(shell pkg-config --cflags libsecp256k1)
PKG_LIBS := $(shell pkg-config --libs libsecp256k1)
ifeq ($(UNAME_S),Darwin)
CXXFLAGS := -std=c++17 -Wall -O9 -pthread $(PKG_CFLAGS)
LDFLAGS := -framework OpenCL -pthread
LDLIBS := $(PKG_LIBS)
else
CXXFLAGS := -std=c++17 -Wall -mmmx -O9 -mcmodel=large -faligned-new \
-DCL_TARGET_OPENCL_VERSION=300 -march=native -mtune=native \
-pthread $(PKG_CFLAGS)
LDFLAGS := -s -lOpenCL -mcmodel=large -pthread
LDLIBS := $(PKG_LIBS)
endif
.PHONY: all test clean format
FORMAT_FILES := $(shell find src -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.cc' -o -name '*.cxx' \) -not -path 'src/precompute/precomp_table.hpp')
all:
@$(MAKE) --no-print-directory $(BIN)
$(BIN): $(SRC)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
clean:
rm -rf $(BIN)