Merge pull request #2593 from Akury83/master
[RRG-proxmark3.git] / tools / hitag2crack / crack5opencl / Makefile
blob6d1c84e6c07dabc51ce8ec2154ea9a3981485786
1 MYSRCS = queue.c threads.c opencl.c hitag2.c
2 MYCFLAGS =
3 MYDEFS = -D TEST_UNIT=0
5 platform = $(shell uname)
7 ifeq ($(platform),Darwin)
8 MYLDLIBS ?= -framework OpenCL
9 else
10 #MYINCLUDES ?=-I/usr/local/cuda-7.5/include
11 #MYINCLUDES ?=-I/opt/nvidia/cuda/include
12 #MYLDLIBS ?= -L/usr/local/cuda-7.5/lib64 -lOpenCL
13 MYLDLIBS ?= -L/opt/nvidia/cuda/lib64 -lOpenCL
14 endif
15 MYLDLIBS += -lpthread
17 MYINCLUDES +=-I ../common
18 MYINCLUDES +=-I ../common/OpenCL-Headers
20 BINS = ht2crack5opencl
21 INSTALLTOOLS = $(BINS)
23 include ../../../Makefile.host
25 # checking platform can be done only after Makefile.host
26 ifneq (,$(findstring MINGW,$(platform)))
27 # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
28 # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
29 CFLAGS += -D_ISOC99_SOURCE
30 endif
32 WITH_CLANG=$(shell $(CC) --version 2>&1 | grep -c "clang")
34 # disable sanitize on Linux
35 ifeq ($(SANITIZE),1)
36 ifeq ($(platform),Linux)
38 CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
39 CFLAGS := $(filter-out -fno-omit-frame-pointer,$(CFLAGS))
40 LDFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
42 define errMsg
43 Disabling SANITIZE here, is incompatibe with OpenCL on Linux, due to a bug.
44 Check this (https://github.com/google/sanitizers/issues/611).
45 endef
46 $(warning $(errMsg))
47 endif
48 endif
50 # clang
51 ifeq ($(WITH_CLANG),1)
52 ifeq ($(platform),Linux)
53 CFLAGS += -fPIE
54 endif
55 endif
57 # if debug and clang, add more CFLAGS
58 ifeq ($(DEBUG),1)
59 ifeq ($(WITH_CLANG),1)
60 CFLAGS += -Weverything
61 CFLAGS += -Wno-reserved-id-macro
62 ifeq ($(platform),Linux)
63 CFLAGS += -Wno-error=reserved-id-macro
64 CFLAGS += -Wno-error=disabled-macro-expansion
65 endif
66 endif
67 $(info CFLAGS are: $(CFLAGS))
68 endif
70 ht2crack5opencl : $(OBJDIR)/ht2crack5opencl.o ${MYOBJS}
72 ifeq ($(platform),Darwin)
73 ht2crack5opencl_clean:
74 @rm -rf *.dSYM
76 clean: ht2crack5opencl_clean
77 endif