File: rules

package info (click to toggle)
slicot 5.0%2B20101122-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 21,816 kB
  • sloc: fortran: 122,030; makefile: 1,098
file content (82 lines) | stat: -rwxr-xr-x 2,283 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
#!/usr/bin/make -f
# -*- makefile -*-

# Get compilation flags from dpkg-buildflags
include /usr/share/dpkg/default.mk

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	MAKEFLAGS += -j$(NUMJOBS)
endif

%:
	dh $@ 

F77=gfortran
LDFLAGS += -Wl,--as-needed

SO=0
VERS=$(SO).0

SLICOT_SRC=$(sort $(shell echo src/*.f))
SLICOT_OBJ=$(SLICOT_SRC:.f=.o)

debian/shared_dir debian/static_dir debian/shared64_dir:
	mkdir -p $(subst _dir,,$(@))
	touch $@

$(subst src/,debian/static/,$(SLICOT_OBJ)): \
  debian/static/%.o : src/%.f debian/static_dir

	$(F77) $(FFLAGS) -c $< -o $@

$(subst src/,debian/shared/,$(SLICOT_OBJ)): \
  debian/shared/%.o : src/%.f debian/shared_dir

	$(F77) $(FFLAGS) -fPIC -c $< -o $@

$(subst src/,debian/shared64/,$(SLICOT_OBJ)): \
  debian/shared64/%.o : src/%.f debian/shared64_dir

	$(F77) $(FFLAGS) -fPIC -fdefault-integer-8 -c $< -o $@

libslicot.so: libslicot.so.$(SO)
	ln -snf $< $@

libslicot.so.$(SO): libslicot.so.$(VERS)
	ln -snf $< $@

libslicot.so.$(VERS): $(subst src/,debian/shared/,$(SLICOT_OBJ))
	$(F77) $(LDFLAGS) -shared -Wl,-soname=libslicot.so.$(SO) -o $@ $^ -lblas -llapack

libslicot.a: $(subst src/,debian/static/,$(SLICOT_OBJ))
	ar r $@ $^

libslicot_pic.a: $(subst src/,debian/shared/,$(SLICOT_OBJ))
	ar r $@ $^

libslicot64_pic.a: $(subst src/,debian/shared64/,$(SLICOT_OBJ))
	ar r $@ $^

override_dh_auto_build-arch: libslicot.so libslicot.a libslicot_pic.a libslicot64_pic.a

override_dh_auto_build-indep:

override_dh_auto_install:

override_dh_strip-arch:
	dh_strip -a --dbgsym-migration='libslicot-dbg (<< 5.0+20101122-3~)'

override_dh_installexamples-indep:
	mkdir -p debian/libslicot-doc/usr/share/doc/libslicot-doc/examples
	cp -a examples77 debian/libslicot-doc/usr/share/doc/libslicot-doc/examples/fortran77
	cp -a examples debian/libslicot-doc/usr/share/doc/libslicot-doc/examples/fortran90
	find debian/libslicot-doc/usr/share/doc/libslicot-doc/examples -type f -exec chmod -x '{}' ';'

override_dh_auto_clean:
	rm -f libslicot.* libslicot_pic.a libslicot64_pic.a
	rm -f debian/static_dir debian/shared_dir debian/shared64_dir
	rm -rf debian/shared debian/static debian/shared64