File: make.patch

package info (click to toggle)
spherepack 3.2-7
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,940 kB
  • ctags: 3,045
  • sloc: fortran: 18,323; python: 5,763; makefile: 58
file content (51 lines) | stat: -rw-r--r-- 1,552 bytes parent folder | download
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
Author: Alastair McKinstry <mckinstry@debian.org>
Description: Fix makefile to build shared libs and static lib
Last-Updated: 2014-01-10
Forwarded: no

Index: spherepack-3.2/Src/Makefile
===================================================================
--- spherepack-3.2.orig/Src/Makefile	2013-05-19 07:26:15.000000000 +0100
+++ spherepack-3.2/Src/Makefile	2013-07-02 01:31:48.000000000 +0100
@@ -1,4 +1,31 @@
+FC:=gfortran
+PREFIX:=/usr/local
+LD:=$(LD)
+SONAME=libsphere.so.0d
+SHLIBFLAGS:=  -Wl,--soname,$(SONAME) -Wl,--version-script,spherepack.ver -Wl,--script,aliases.ld -lm
+PIC_OBJS = $(patsubst %.f,%.pic_o, $(wildcard *.f))
+
+all: libsphere.a shlib libsphere.so
+
 libsphere.a:    *.f
-	g77 -c *.f
-	ld -r -o libsphere.a *.o
+	$(FC) --default-real-8 -c $<
+	$(LD) -r -o libsphere.a *.o
+
+libsphere.so: $(SONAME)
+	ln -sf $(SONAME) $@
+
+shlib $(SONAME): $(PIC_OBJS)
+	$(FC) -Wl,--as-needed -shared -o $(SONAME) $(SHLIBFLAGS) $(PIC_OBJS) -lc
+
+install:
+	mkdir -p $(DESTDIR)$(PREFIX)/lib
+	cp libsphere.a $(DESTDIR)$(PREFIX)/lib
+	cp $(SONAME)  $(DESTDIR)$(PREFIX)/lib
+	ln -sf $(SONAME) $(DESTDIR)$(PREFIX)/lib/libsphere.so
+
+clean:
+	rm -f *.o *.pic_o libsphere.a $(SONAME)	 libsphere.so
+
+%.pic_o: %.f
+	$(FC) --default-real-8 -fPIC -c -o $@ $<
 
Index: spherepack-3.2/Src/spherepack.ver
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ spherepack-3.2/Src/spherepack.ver	2013-07-01 01:25:22.000000000 +0100
@@ -0,0 +1,3 @@
+SPHEREPACK_3.2 {
+	global: *;
+	};