File: rules

package info (click to toggle)
stfl 0.22-3
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 408 kB
  • sloc: ansic: 3,344; makefile: 109; perl: 95; ruby: 83; python: 73
file content (75 lines) | stat: -rwxr-xr-x 1,790 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/make -f
#export DH_VERBOSE=1

MAKE_DESTDIR        := $(CURDIR)/debian/tmp
MAKE_FOUND_INTERPR  := FOUND_PERL5=0 FOUND_SWIG=1 FOUND_SPL=0 FOUND_RUBY=0 FOUND_PYTHON=0
MAKE_INSTALL_TARGET := DESTDIR=$(MAKE_DESTDIR) prefix=/usr
CFLAGS += -fPIC

include /usr/share/dpkg/architecture.mk
PERL_VERSION := $(shell perl -MConfig -e 'print $$Config{version}')
PERL_ARCHLIB := $(shell perl -I/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config-$(PERL_VERSION) -MConfig -e 'print $$Config{vendorarch}')

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
	dh_testdir

	$(MAKE) $(MAKE_FOUND_INTERPR)
	# perl
	test ! -f perl5/Makefile || $(MAKE) -C perl5 clean
	cd perl5 && swig -perl5 stfl.i && perl Makefile.PL INSTALLDIRS=vendor
	$(MAKE) -C perl5
	# ruby
	dh_ruby --build

	touch $@

install: build
	dh_testdir
	dh_testroot
	$(MAKE) $(MAKE_INSTALL_TARGET) $(MAKE_FOUND_INTERPR)  install
	# perl
	$(MAKE) -C perl5 install DESTDIR=$(MAKE_DESTDIR) PREFIX=/usr
	sed -e 's;@PERL_ARCHLIB@;$(PERL_ARCHLIB);g' debian/libstfl-perl.install.in > debian/libstfl-perl.install
	# ruby
	dh_ruby --install

clean: $(addprefix clean-ruby-, $(RUBY_VERSIONS))
	dh_testdir
	dh_testroot
	rm -f build-stamp*
	# ruby
	dh_ruby --clean
	# perl
	rm -f debian/libstfl-perl.install

	# Add here commands to clean up after the build process.
	[ ! -f Makefile ] || $(MAKE) clean
	rm -rf debian/tmp

	dh_clean

binary-indep: build install
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installexamples -plibstfl-dev example.c example.stfl
	dh_install
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_perl
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch