-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (72 loc) · 2.29 KB
/
Makefile
File metadata and controls
97 lines (72 loc) · 2.29 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.PHONY: all
#CC=gcc
# Mac OSX differences:
#
# * linker won't accept -allow-multiple-definition, required on Linux
# as a hack for xerbla clash between lapack and blas
# * Accelerate.h headers
MULDEF = -Wl,--allow-multiple-definition
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OS = -DMACOSX
MULDEF =
endif
# Allow large-file seeking with fseeko
LONG_BIT = $(shell getconf LONG_BIT)
CFLAGS = -std=gnu99 -Wall -ggdb3 -g3 \
-O3 \
-msse2 \
-ftree-vectorize \
-fno-omit-frame-pointer \
-funroll-loops -Winline \
-ffast-math \
-fstrict-aliasing \
-D_FILE_OFFSET_BITS=$(LONG_BIT) \
$(OS)
targets = sparsnp scale transpose \
cbind makefolds unpack subsample \
realpath gennetwork_test
all: $(targets)
debug: CFLAGS = -O0 \
-Wall \
-DDEBUG \
-g3 \
-ggdb3 \
-std=gnu99 \
-D_FILE_OFFSET_BITS=$(LONG_BIT) \
$(OS)
debug: $(targets)
# static linking is NOT supported on OSX
static: CFLAGS += -static
static: $(targets)
LIBRARIES = -lpthread -lm
EXTRA_LIBRARIES = -lpthread -llapack -lblas -lm
sparsnp: common.c coder.c ind.c gmatrix.c link.c util.c options.c \
main.c sparsnp.c matrix.c gennetwork.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o sparsnp
scale: common.c coder.c ind.c gmatrix.c sparsnp.c scale.c util.c \
matrix.c gennetwork.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o scale
transpose: common.c coder.c transpose.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o transpose
cbind: common.c cbind.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o cbind
makefolds: common.c util.c ind.c makefolds.c matrix.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o makefolds
unpack: common.c coder.c ind.c gmatrix.c unpack.c util.c \
matrix.c gennetwork.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o unpack
univariable: common.c coder.c ind.c gmatrix.c link.c util.c \
options.c sparsnp.c svd.c matrix.c thin.c \
multivariable.c univariable.c gennetwork.c
$(CC) $(CFLAGS) -llapack -lblas -lm $^ $(EXTRA_LIBRARIES) -o univariable \
$(MULDEF)
subsample: common.c util.c coder.c ind.c gmatrix.c subsample.c \
matrix.c gennetwork.c
$(CC) $(CFLAGS) $^ $(LIBRARIES) -o subsample
realpath: realpath.c
$(CC) $(CFLAGS) $^ -o realpath
gennetwork_test: gennetwork.c gennetwork_test.c matrix.c util.c
$(CC) $(CFLAGS) -ggdb3 $^ $(LIBRARIES) -o gennetwork_test
clean:
/bin/rm -f $(targets)