-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
49 lines (38 loc) · 960 Bytes
/
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
PREFIX=/usr/local
LIBDIR=$(PREFIX)/lib
CFLAGS=-O
NAME=vecLibFort
SOURCE=$(NAME).c
OBJECT=$(NAME).o
LIBRARY=lib$(NAME)
STATIC=$(LIBRARY).a
DYNAMIC=$(LIBRARY).dylib
PRELOAD=$(LIBRARY)I.dylib
INCLUDES=cloak.h static.h
DEPEND=$(INCLUDES) Makefile
all: static dynamic preload
static: $(STATIC)
dynamic: $(DYNAMIC)
preload: $(PRELOAD)
$(OBJECT): $(DEPEND)
$(STATIC): $(OBJECT)
ar -cru $@ $^
ranlib $@
$(DYNAMIC): $(OBJECT)
clang -shared -o $@ $^ \
-Wl,-reexport_framework -Wl,Accelerate \
-install_name $(LIBDIR)/$@
$(PRELOAD): $(SOURCE) $(DEPEND)
clang -shared $(CFLAGS) -DVECLIBFORT_INTERPOSE -o $@ -O $(SOURCE) \
-Wl,-reexport_framework -Wl,Accelerate \
-install_name $(LIBDIR)/$@
install: all
mkdir -p $(LIBDIR)
cp -f $(STATIC) $(LIBDIR)
cp -f $(DYNAMIC) $(LIBDIR)
cp -f $(PRELOAD) $(LIBDIR)
clean:
rm -f $(OBJECT) $(STATIC) $(DYNAMIC) $(PRELOAD)
check: tester.f90 $(OBJECT)
gfortran -o tester -O $^ -framework Accelerate
./tester