diff --git a/Makefile b/Makefile index 5f6f6e2d..e53d6f0e 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ ALIB=libdarknet.a EXEC=darknet OBJDIR=./obj/ +OS=$(shell uname -s) CC=gcc NVCC=nvcc AR=ar @@ -48,7 +49,12 @@ endif ifeq ($(GPU), 1) COMMON+= -DGPU -I/usr/local/cuda/include/ CFLAGS+= -DGPU -LDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand +ifeq ($(OS), Darwin) +LDFLAGS+= -L/usr/local/cuda/lib +else +LDFLAGS+= -L/usr/local/cuda/lib64 +endif +LDFLAGS+=-lcuda -lcudart -lcublas -lcurand endif ifeq ($(CUDNN), 1)