-
Notifications
You must be signed in to change notification settings - Fork 72
/
Makefile
56 lines (46 loc) · 997 Bytes
/
Makefile
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
# C
CC = gcc
CFLAGS = -O2 -std=c99 -Wall -DUNIX -g -DDEBUG
# Fortran
FC = gfortran
FFLAGS = -O
# Additional libraries and source files
LIBS = -lm -lclRNG
SRCS = clbuild.c
# Check for 32-bit vs 64-bit
PROC_TYPE = $(strip $(shell uname -m | grep 64))
# Check for Mac OS
OS = $(shell uname -s 2>/dev/null | tr [:lower:] [:upper:])
DARWIN = $(strip $(findstring DARWIN, $(OS)))
# MacOS System
ifneq ($(DARWIN),)
CFLAGS += -DMAC
LIBS += -framework OpenCL
else
# Linux OS
LIBS += -lOpenCL
ifeq ($(PROC_TYPE),)
CFLAGS+=-m32
else
CFLAGS+=-m64
endif
# Check for Linux-AMD
ifdef AMDAPPSDKROOT
INC_DIRS=. $(AMDAPPSDKROOT)/include
ifeq ($(PROC_TYPE),)
LIB_DIRS=$(AMDAPPSDKROOT)/lib/x86
else
LIB_DIRS=$(AMDAPPSDKROOT)/lib/x86_64
endif
else
# Check for Linux-Nvidia
ifdef CUDA
INC_DIRS=. $(CUDA)/OpenCL/common/inc
endif
endif
endif
all: augerOCL
augerOCL: main.c
$(CC) $(CFLAGS) $^ $(SRCS) $(INC_DIRS:%=-I%) $(LIB_DIRS:%=-L%) -o $@ $(LIBS)
clean:
rm -f *.o *.mod augerOCL