File: rules

package info (click to toggle)
g2 0.72-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,632 kB
  • ctags: 3,135
  • sloc: ansic: 9,772; sh: 2,734; python: 235; perl: 228; makefile: 193; fortran: 183; cpp: 33
file content (43 lines) | stat: -rwxr-xr-x 1,573 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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for libg2
# Author: Andreas Tille <tille@debian.org>

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

pkglib=libg20
pkgdev=libg2-dev

%:
	dh $@ --with autotools_dev,autoreconf

# Compile with -fPIC on all platforms
#override_dh_auto_configure:
#        dh_auto_configure -- CFLAGS="$(dpkg-buildflags --get CFLAGS) -fPIC" FFLAGS="$(dpkg-buildflags --get FFLAGS) -fPIC"

# Use the latest version number in the CHANGES file 
version:=$(shell head -n 1 CHANGES | \
 awk '{if (match($$0,/^[0-9]+\.[0-9]+[A-Za-z]/)) print substr($$0,RSTART,RLENGTH)}')
rversion:=$(shell head -n 1 CHANGES | \
 awk '{if (match($$0,/^[0-9]+\.[0-9]+/)) print substr($$0,RSTART,RLENGTH)}')
major:=$(shell head -n 1 CHANGES | \
 awk '{if (match($$0,/^[0-9]+/)) print substr($$0,RSTART,RLENGTH)}')

override_dh_auto_clean:
	dh_auto_clean
	rm -f libg*.a lib*.so.0

override_dh_auto_build:
	$(MAKE) depend
	$(MAKE) libg2.a DEBCFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
	# clean up and build the shared lib
	-rm -f src/*.o src/*/*.o
	$(MAKE) PICFLAG="-fPIC" RVERSION=$(rversion) MVERSION=$(major) DEBCFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" shared
	(cd ./g2_perl && perl Makefile.PL INSTALLDIRS=vendor LIBS="-L$(CURDIR) -lg2")
	$(MAKE) -C ./g2_perl LD_RUN_PATH=""

override_dh_auto_install:
	$(MAKE) RVERSION=$(rversion) MVERSION=$(major) install prefix=$(CURDIR)/debian/libg2-dev
	mv $(CURDIR)/debian/$(pkgdev)/usr/lib/lib*.so.0* $(CURDIR)/debian/$(pkglib)/usr/lib
	$(MAKE) -C ./g2_perl install DESTDIR=$(CURDIR)/debian/libg2$(major)-perl