@@ -18,49 +18,50 @@ GCC_IS_CLANG=$(shell $(CC) --version | grep -i clang >/dev/null && echo yes || e
18
18
CLANG_IS_GCC =$(shell $(CC ) --version | grep -i GCC >/dev/null && echo yes || echo no)
19
19
ifeq ($(CC ) , gcc)
20
20
ifeq ($(GCC_IS_CLANG ) , yes)
21
- $(info Using clang instead of gcc. gcc is aliased to clang on your system.)
22
- CC = clang
21
+ $(info Using clang instead of gcc. gcc is aliased to clang on your system.)
22
+ _CC = clang
23
23
endif
24
24
endif
25
25
26
26
ifeq ($(CC ) , clang)
27
27
ifeq ($(CLANG_IS_GCC ) , yes)
28
- $(info Using gcc instead of clang. clang is aliased to gcc on your system.)
29
- CC = clang
28
+ $(info Using gcc instead of clang. clang is aliased to gcc on your system.)
29
+ _CC = gcc
30
30
endif
31
31
endif
32
32
33
- ifeq ($(CC ) , gcc)
34
- CFLAGS_RELEASE += -fopenmp -DOMP
35
- CFLAGS_DEBUG += -fopenmp -DOMP
36
- LDFLAGS += -lgomp
33
+ ifeq ($(_CC ) , gcc)
34
+ CFLAGS_RELEASE += -fopenmp -DOMP
35
+ CFLAGS_DEBUG += -fopenmp -DOMP
36
+ LDLIBS += -lgomp
37
37
endif
38
38
39
- ifeq ($(CC ) ,clang)
40
- LDFLAGS += -lomp
39
+ ifeq ($(_CC ) ,clang)
40
+ LDLIBS += -lomp
41
41
endif
42
42
43
- ifeq ($(PLATFORM ) ,Darwin)
44
- SHARED_SUFFIX =dylib
45
- BREW_PATH=$(shell brew --prefix)
46
- INCLUDES += -I $(BREW_PATH)/opt/libomp/include -I $(BREW_PATH)/opt/argp-standalone/include
47
- LDFLAGS += -L $(BREW_PATH)/opt/libomp/lib -L $(BREW_PATH)/opt/argp-standalone/lib
43
+ ifeq ($(PLATFORM ) , Darwin)
44
+ SHARED_SUFFIX = dylib
45
+ BREW_PATH = $(shell brew --prefix)
46
+ INCLUDES += -I $(BREW_PATH ) /opt/libomp/include -I $(BREW_PATH ) /opt/argp-standalone/include
47
+ LDFLAGS += -L $(BREW_PATH ) /opt/libomp/lib -L $(BREW_PATH ) /opt/argp-standalone/lib
48
+ LDLIBS += -largp
48
49
endif
49
50
50
- ifeq ($(PLATFORM ) ,Linux)
51
- SHARED_SUFFIX = so
52
- ifeq ($(CC), clang)
53
- CFLAGS_RELEASE += -Xclang -fopenmp -DOMP
54
- CFLAGS_DEBUG += -Xclang -fopenmp -DOMP
55
- endif
51
+ ifeq ($(PLATFORM ) , Linux)
52
+ SHARED_SUFFIX = so
53
+ ifeq ($(_CC ) , clang)
54
+ CFLAGS_RELEASE += -Xclang -fopenmp -DOMP
55
+ CFLAGS_DEBUG += -Xclang -fopenmp -DOMP
56
+ endif
56
57
endif
57
58
58
59
ifeq ($(BUILD ) , release)
59
- CFLAGS = $(CFLAGS_RELEASE)
60
+ CFLAGS = $(CFLAGS_RELEASE )
60
61
else ifeq ($(BUILD), debug)
61
- CFLAGS = $(CFLAGS_DEBUG)
62
+ CFLAGS = $(CFLAGS_DEBUG )
62
63
else
63
- $(error Invalid BUILD '$(BUILD)', expected 'release' or 'debug')
64
+ $(error Invalid BUILD '$(BUILD)', expected 'release' or 'debug')
64
65
endif
65
66
66
67
SHARED_LIB = lib$(LIBRARY_NAME ) .$(SHARED_SUFFIX )
0 commit comments