forked from DrTimothyAldenDavis/GraphBLAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (54 loc) · 1.51 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
68
#-------------------------------------------------------------------------------
# GraphBLAS/Tcov/Makefile
#-------------------------------------------------------------------------------
# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#-------------------------------------------------------------------------------
UNAME := $(shell uname)
# pick your compiler:
# CC = gcc
# CC = cc
# CC = clang
# CC = xlc
# CC = gcc-8
# CC = icc
ifeq ($(UNAME),Darwin)
CC = gcc-11
else
CC = gcc
endif
SRC = tmp_source/*
INC = tmp_include/*
SRC2 = $(notdir $(wildcard $(SRC)))
OBJ = $(SRC2:.c=.o)
LDFLAGS = -fopenmp
CFLAGS = -g -std=c11 -fopenmp -fexceptions -fPIC -Wno-pragmas
CPPFLAGS = -Itmp_include -DGBCOVER $(RENAME)
SO_OPTS = $(LDFLAGS)
ifeq ($(UNAME),Darwin)
# Mac
CFLAGS += -fno-common
SO_NAME = libgraphblas_tcov.dylib
SO_OPTS += -dynamiclib -shared -Wl,-install_name -Wl,$(SO_NAME) -undefined dynamic_lookup
else
# Linux
SO_NAME = libgraphblas_tcov.so
SO_OPTS += -shared -Wl,-soname -Wl,$(SO_NAME) -Wl,--no-undefined
endif
default: $(SO_NAME)
%.o: tmp_source/%.c $(INC)
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $(notdir $@)
$(SO_NAME): $(OBJ)
$(CC) $(SO_OPTS) $^ -o $@ -lm
.KEEP: $(OBJ)
clean:
$(RM) *.o
distclean: clean
$(RM) *.mex* tmp*/* errlog*.txt grbstat.mat fprint.txt
$(RM) libgraphblas_tcov.*
purge: distclean
$(RM) log.txt
config:
@echo "CFLAGS: " $(CFLAGS)
@echo "CPPFLAGS: " $(CPPFLAGS)
@echo "LDFLAGS: " $(LDFLAGS)