File: rules

package info (click to toggle)
openjpeg 1.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,584 kB
  • ctags: 5,140
  • sloc: ansic: 38,348; cpp: 6,559; tcl: 677; makefile: 276; sh: 85; csh: 17
file content (93 lines) | stat: -rwxr-xr-x 2,040 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/make -f

include /usr/share/dpatch/dpatch.make

# used as trailer in the generated manpages
UVERSION = $(shell dpkg-parsechangelog | perl -ne 'print "$$1\n" if (/^Version: (.*?)(?:\.dfsg)?\-.*?$$/)')

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	EXTRA_CFLAGS += -O0
else
	# Upstream default optimisation level
	EXTRA_CFLAGS += -O3
endif

build: build-stamp
build-stamp: patch
	dh_testdir

	# build all library targets
	$(MAKE) OpenJPEG
	$(MAKE) -C codec
	$(MAKE) -C indexer_JPIP

	# build manpages
	for i in debian/*.pod; do \
		pod2man --center 'OPENJPEG TOOLS' \
			--release $(UVERSION) \
			$$i $${i%%.pod}.1 ; \
	done

	touch $@

clean: realclean unpatch
realclean:
	dh_testdir
	dh_testroot

	# Remove execute permission since upstreams ships all files with +x
	chmod -R a-x .
	chmod -R a+X .
	chmod a+x debian/rules

	[ ! -f  codec/*.o ] || $(MAKE) -C codec clean
	[ ! -f  indexer_JPIP/*.o ] || $(MAKE) -C indexer_JPIP clean

	$(MAKE) clean

	# delete the manpages which were built from perlpod (not using *.1,
	# in case a later file is added and not checked in)
	for i in debian/*.pod; do \
		rm -f $${i%%.pod}.1; \
	done

	dh_clean indexer_JPIP/index_create codec/image_to_j2k codec/j2k_to_image libopenjpeg.a.nopic libopenjpeg.so build-stamp

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) dist
	# The libraries and header file are in dist/
	# So we'll dump the binaries there too
	cp codec/j2k_to_image codec/image_to_j2k dist/
	cp indexer_JPIP/index_create dist/

binary-indep: build install
# We have nothing to do by default.

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
	dh_install --sourcedir=dist/
	dh_installman
	dh_link
	dh_strip --dbg-package=libopenjpeg2-dbg
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: build clean realclean binary-indep binary-arch binary install
.SUFFIXES: .1 .help