File: Makefile

package info (click to toggle)
plink1.9 1.90~b3.45-170113-1~bpo8+1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 5,692 kB
  • sloc: ansic: 128,258; cpp: 1,108; makefile: 111; sh: 25
file content (91 lines) | stat: -rw-r--r-- 2,847 bytes parent folder | download | duplicates (2)
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
# General-purpose Makefile for PLINK 1.90
#
# Compilation options:
#   Do not link to LAPACK                    NO_LAPACK

# Leave blank after "=" to disable; put "= 1" to enable
# (when enabled, "#define NOLAPACK" must be uncommented in plink_common.h)
NO_LAPACK =

# Variable that allows additional linker flags (e.g., "-L/path/to/libs") to be
# passed into the linker; to use this, invoke 'make LINKFLAGS_EXTRA="<opts>"'.
LINKFLAGS_EXTRA =

# To enable dynamic linking
DYNAMIC_LINK = 1

.PHONY: clean

# should autodetect system
SYS = UNIX
ifdef SystemRoot
  SYS = WIN
else
  UNAME := $(shell uname)
  ifeq ($(UNAME), Darwin)
    SYS = MAC
  endif
endif

CFLAGS+=-Wall -O2
CXXFLAGS+=-Wall -O2
LINKFLAGS=-lm -lpthread -ldl $(LDFLAGS)
ifdef DYNAMIC_LINK
  BLASFLAGS=-llapack -lcblas -latlas
  ZLIB=-lz
  CFLAGS+=-DDYNAMIC_ZLIB
else
  BLASFLAGS=-L/usr/lib64/atlas -llapack -lcblas -latlas
  ZLIB=-L. zlib-1.2.10/libz.so.1.2.10
endif

ifeq ($(SYS), MAC)
  GCC_GTEQ_43 := $(shell expr `g++ -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40300)
  ifeq "$(GCC_GTEQ_43)" "1"
    CFLAGS=-Wall -O2 -flax-vector-conversions
  endif
  BLASFLAGS=-framework Accelerate
  LINKFLAGS=-ldl
  ZLIB=-L. zlib-1.2.10/libz.1.2.10.dylib
endif

ifeq ($(SYS), WIN)
# Note that, unlike the Linux and Mac build processes, this STATICALLY links
# LAPACK, since we have not gotten around to trying dynamically-linked LAPACK
# on Windows.
# If you don't already have LAPACK built, you'll probably want to turn on
# NO_LAPACK.
  BLASFLAGS=-L. lapack/liblapack.a -L. lapack/librefblas.a
  LINKFLAGS=-lm -static-libgcc
  ZLIB=-L. zlib-1.2.10/libz.a
endif

ifdef NO_LAPACK
  BLASFLAGS=
endif

OBJS = plink.o plink_assoc.o plink_calc.o plink_cluster.o plink_cnv.o plink_common.o plink_data.o plink_dosage.o plink_family.o plink_filter.o plink_glm.o plink_help.o plink_homozyg.o plink_lasso.o plink_ld.o plink_matrix.o plink_misc.o plink_perm.o plink_rserve.o plink_set.o plink_stats.o SFMT.o dcdflib.o pigz.o yarn.o Rconnection.o hfile.o bgzf.o

# In the event that you are still concurrently using PLINK 1.07, we suggest
# renaming that binary to "plink107", and this one to "plink1".  (Previously,
# "plink1"/"plink2" was suggested here; that also works for now, but it may
# lead to minor problems when PLINK 2.0 is released.)

plink: $(OBJS)
	g++ $^ $(LINKFLAGS_EXTRA) $(BLASFLAGS) $(LINKFLAGS) $(ZLIB) -o $@

plinkw: $(OBJS)
	gfortran -O2 $^ $(LINKFLAGS_EXTRA) -Wl,-Bstatic $(BLASFLAGS) $(LINKFLAGS) $(ZLIB) -o $@

clean:
	rm -f $(OBJS) plink plinkw


# Pattern-based rules for compiling object (.o) files; basically identical to
# GNU make's built-in rules, except we explicitly use "g++" instead of $(CC).

%.o: %.c
	g++ -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o: %.cc
	g++ -x c++ -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@