File: rules

package info (click to toggle)
flexpart 9.02-26
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,944 kB
  • sloc: f90: 14,310; makefile: 28; sh: 18
file content (41 lines) | stat: -rwxr-xr-x 1,079 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

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

CPU:=$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

FC:=$(shell basename $(shell readlink -f /usr/bin/f95)) 
FMODDIR:= /usr/lib/$(DEB_HOST_MULTIARCH)/fortran/$(FC)
FCFLAGS:= -I$(FMODDIR)

ifeq ($(CPU), amd64)
  export FCFLAGS:= $(FCFLAGS) -mcmodel=medium 
endif
ifeq ($(CPU), arm64)
  export FCFLAGS:= $(FCFLAGS) -mcmodel=large -fno-pie
endif
ifeq ($(CPU), ppc64el)
  export FCFLAGS:= $(FCFLAGS) -mcmodel=large
endif

LC_ALL=C
export LC_ALL

# magic debhelper rule
%:
	dh $@

override_dh_auto_build:
	$(MAKE) -f makefile.gfs_gfortran LDFLAGS="$(LDFLAGS)" FCFLAGS="$(FCFLAGS)"
	rm -f *.o *.mod
	$(MAKE) -f makefile.ecmwf_gfortran LDFLAGS="$(LDFLAGS)" FCFLAGS="$(FCFLAGS)"
	rm -f ./options/SPECIES/spec_overview
	find options -type f -exec chmod -x {} \;

override_dh_auto_clean:
	$(MAKE) -f makefile.gfs_gfortran clean
	$(MAKE) -f makefile.ecmwf_gfortran clean
	rm -f *.mod erf.f90.185r.combine flexpart.gfs flexpart.ecmwf