summaryrefslogtreecommitdiff
blob: 1fdbd946e99ef9d56ff4ffd93541326f1e1a8875 (plain)
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
diff --git a/Makefile b/Makefile
index f9dbe86..2b11b59 100644
--- a/Makefile
+++ b/Makefile
@@ -32,22 +32,22 @@ help:
 	@echo "   make install - installs everything"
 
 lib:
-	make -C src/ lib
+	$(MAKE) -C src lib
 solib:
-	make -C src/ solib
+	$(MAKE) -C src solib
 test: lib
-	make -C test/
+	$(MAKE) -C test
 
 clean:
 	rm -f libqrupdate.a libqrupdate.so
-	make -C src/ clean
-	make -C test/ clean
+	$(MAKE) -C src clean
+	$(MAKE) -C test clean
 
 install:
-	make -C src/ install
+	$(MAKE) -C src install
 
 install-shlib:
-	make -C src/ install-shlib
+	$(MAKE) -C src install-shlib
 
 install-staticlib:
-	make -C src/ install-staticlib
+	$(MAKE) -C src install-staticlib
diff --git a/src/Makefile b/src/Makefile
index 65ef49a..c338882 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -34,6 +34,8 @@ clup1up.f dlup1up.f slup1up.f zlup1up.f
 
 OBJS = $(SRC:%.f=%.o)
 
+PICOBJS = $(SRC:%.f=%.lo)
+
 lib: ../libqrupdate.a
 
 ifeq ($(shell uname),Darwin)
@@ -46,19 +48,22 @@ solib: ../libqrupdate$(SOEXT)
 ../libqrupdate.a: $(OBJS)
 	ar -cr $@ $(OBJS)
 
-../libqrupdate.so: $(OBJS)
-	$(FC) $(FFLAGS) -shared -o $@ -Wl,-soname=libqrupdate.so.$(MAJOR) $(OBJS) \
+../libqrupdate.so: $(PICOBJS)
+	$(FC) $(LDFLAGS) -shared -o $@ -Wl,-soname=libqrupdate.so.$(MAJOR) $(PICOBJS) \
 		$(BLAS) $(LAPACK)
 
-../libqrupdate.dylib: $(OBJS)
-	$(FC) $(FFLAGS) $(LDFLAGS) -dynamiclib -o $@ -install_name $(PREFIX)/$(LIBDIR)/libqrupdate.$(MAJOR).dylib $(OBJS) \
+../libqrupdate.dylib: $(PICOBJS)
+	$(FC) $(LDFLAGS) -dynamiclib -o $@ -install_name $(PREFIX)/$(LIBDIR)/libqrupdate.$(MAJOR).dylib $(PICOBJS) \
 		$(BLAS) $(LAPACK)
 
+$(PICOBJS): %.lo: %.f
+	$(FC) $(FFLAGS) $(FPICFLAGS) -c $< -o $@
+
 $(OBJS): %.o: %.f
-	$(FC) $(FFLAGS) $(FPICFLAGS) -c $<
+	$(FC) $(FFLAGS) -c $<
 
 clean:
-	rm -f $(OBJS)
+	rm -f $(OBJS) $(PICOBJS)
 
 install: install-shlib install-staticlib
 
diff --git a/test/Makefile b/test/Makefile
index 45a843d..3be917f 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -41,7 +41,7 @@ utils.o: utils.f
 	$(FC) $(FFLAGS) -c $<
 
 ../libqrupdate.a:
-	make -C ../ lib
-	
+	$(MAKE) -C .. lib
+
 clean: 
 	rm -f *.o $(PROGS) $(OUTS)