File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Installation path
22PREFIX ?= /usr/local
3+ TARGET = prmers
34KERNEL_PATH ?= $(PREFIX ) /share/$(TARGET ) /
45
5- # Compiler and compilation options
6+ # Source and kernel files
7+ SRC = prmers.cpp proof/common.cpp proof/proof.cpp proof/md5.cpp proof/sha3.cpp
8+ KERNELS = prmers.cl
9+
10+ # Compiler
611CXX = g++
12+
13+ # Default flags
714CXXFLAGS = -std=c++20 -O3 -Wall
8- LDFLAGS = -lOpenCL
915
10- # Target executable and source/kernel files
11- TARGET = prmers
12- SRC = prmers.cpp proof/common.cpp proof/proof.cpp proof/md5.cpp proof/sha3.cpp
13- KERNELS = prmers.cl prmers_vload2.cl
16+ # Platform-specific OpenCL flags
17+ UNAME_S := $(shell uname -s)
18+
19+ ifeq ($(UNAME_S ) ,Darwin) # macOS
20+ OPENCL_CFLAGS = -I/System/Library/Frameworks/OpenCL.framework/Headers
21+ OPENCL_LDFLAGS = -framework OpenCL
22+ else
23+ OPENCL_CFLAGS =
24+ OPENCL_LDFLAGS = -lOpenCL
25+ endif
1426
1527all : $(TARGET )
1628
1729$(TARGET ) : $(SRC )
18- $(CXX ) $(CXXFLAGS ) -DKERNEL_PATH=" \" $( KERNEL_PATH) \" " -o $(TARGET ) $(SRC ) $(LDFLAGS )
30+ $(CXX ) $(CXXFLAGS ) $( OPENCL_CFLAGS ) -DKERNEL_PATH=" \" $( KERNEL_PATH) \" " -o $(TARGET ) $(SRC ) $(OPENCL_LDFLAGS )
1931
2032install : $(TARGET )
2133 @echo " Installing $( TARGET) ..."
@@ -35,4 +47,4 @@ uninstall:
3547clean :
3648 rm -f $(TARGET )
3749
38- .PHONY : all install uninstall clean
50+ .PHONY : all install uninstall clean
You can’t perform that action at this time.
0 commit comments