-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
130 lines (103 loc) · 3.17 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env make
#
# sts - Stastical Test Suite
# This code has been heavily modified by the following people:
#
# Landon Curt Noll
# Tom Gilgan
# Riccardo Paccagnella
#
# See the README.md and the initial comment in sts.c for more information.
#
# WE (THOSE LISTED ABOVE WHO HEAVILY MODIFIED THIS CODE) DISCLAIM ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL WE (THOSE LISTED ABOVE
# WHO HEAVILY MODIFIED THIS CODE) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
#
# Share and enjoy! :-)
SHELL= bash
MAKE= make
# HomeBrew on macOS overrides (or lack of override is not found)
#
ifeq ($(homebrew_fftw),)
homebrew_fftw=$(shell echo $$(brew --cellar fftw 2>/dev/null)/$$(brew list --versions fftw 2>/dev/null| tr ' ' '\n' | tail -1))
endif
# if the above fails, it will set to /, so we turn / into empty string
ifeq ($(homebrew_fftw),/)
homebrew_fftw=
endif
ifeq ($(homebrew_fftw),)
LIBS= -lm -L/usr/local/lib -lfftw3 -pthread
LOC_INC= -I /usr/include -I /usr/global/include -I /usr/local/include
else
LIBS= -lm -L${homebrew_fftw}/lib -lfftw3 -pthread
LOC_INC= -I /usr/include -I ${homebrew_fftw}/include
endif
# make variables we pass down to override make variables set in the lower level makefile
#
PASSDOWN_VARS= LIBS='${LIBS}' homebrew_fftw='${homebrew_fftw}' LOC_INC='${LOC_INC}'
SRC= src
# default rules
#
all: sts
# debug_make allows you to deterlime how HomeBrew (or lack) impacts compilation
#
debug_make:
@echo DEBUG: top level makefile debug:
@echo
@echo DEBUG: homebrew_fftw: ${homebrew_fftw}
@echo DEBUG: LIBS: ${LIBS}
@echo DEBUG: LOC_INC: ${LOC_INC}
@echo DEBUG: PASSDOWN_VARS: ${PASSDOWN_VARS}
@echo
@echo DEBUG: calling lower level makefile debug:
@echo
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
@echo
@echo DEBUG: end of top level makefile debug
legacy:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
sts: ${SRC}/sts
cd ${SRC}; $(MAKE) ../sts ${PASSDOWN_VARS}
sts_legacy_fft: ${SRC}/sts_legacy_fft
cd ${SRC}; $(MAKE) ../sts_legacy_fft ${PASSDOWN_VARS}
${SRC}/sts:
cd ${SRC}; $(MAKE) all ${PASSDOWN_VARS}
${SRC}/sts_legacy_fft:
cd ${SRC}; $(MAKE) sts_legacy_fft ${PASSDOWN_VARS}
# utility rules
#
clean:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
clobber:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
tags:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
ctags:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
picky:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
indent:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
valgrind:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
valgrindeach:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
minivalgrind:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
osxtest:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
mimiosxtest:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
rebuild:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
depend:
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}
install: all
cd ${SRC}; $(MAKE) $@ ${PASSDOWN_VARS}