File: rules

package info (click to toggle)
libcrypto%2B%2B 5.5.2-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,184 kB
  • ctags: 9,155
  • sloc: cpp: 53,302; asm: 1,889; sh: 472; makefile: 434
file content (138 lines) | stat: -rwxr-xr-x 3,969 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/usr/bin/make -f
# debian/rules for libcrypto++.
# Written by Jens Peter Secher <jps@debian.org>.

# The shared library must be the first listed in debian/control.
package := $(firstword $(shell dh_listpackages))

binarypackages := $(filter-out %-doc,$(shell dh_listpackages))

# Use dpatch.
include /usr/share/dpatch/dpatch.make

# Setup ./configure arguments to fit Debian environment.
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
config_flags := \
	--config-cache \
	--enable-debug \
	--prefix=/usr \
	--sysconfdir=/etc \
	--mandir=/usr/share/man \
	--infodir=/usr/share/info \
	--libexecdir=/usr/lib \
	--build $(DEB_BUILD_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	config_flags += --host $(DEB_HOST_GNU_TYPE)
endif

# General compile options.
cflags := -DNDEBUG -DCRYPTOPP_DISABLE_ASM -g -fno-strict-aliasing -pipe
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	cflags += -O2
else
	cflags += -O0
endif
# Architecture-specific compile options.
ifeq (hppa-linux,$(DEB_BUILD_GNU_TYPE))
	cflags += -ffunction-sections
endif

# Hurd does not have POSIX threads.
ifneq (hurd,$(DEB_HOST_ARCH_OS))
	export LDFLAGS=-pthread
endif

autotools_input := configure.ac Makefile.am config.h.in libcrypto++.pc.in

autoclean:
	-rm -f a.out aclocal.m4 config.log config.sub config.guess	\
	configure cryptopp_config.h.in depcomp install-sh ltmain.sh	\
	Makefile.in missing libcrypto++.pc $(autotools_input)

clean-patched:
	dh_testdir
	dh_testroot
	-rm -f $(CURDIR)/*-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	-rm -rf $(CURDIR)/doc
	dh_clean

clean: clean-patched unpatch autoclean

# Autoreconf needs the automake input to be Makefile.am, so we make
# sure the upstream GNUmakefile do not shadow the resulting Makefile.
config-stamp:
	dh_testdir
	ln -sf /usr/share/misc/config.sub /usr/share/misc/config.guess .
	-rm -f config.cache GNUmakefile
	cp -f $(patsubst %,debian/%,$(autotools_input)) .
	AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 autoreconf --force --install
	$(SHELL) ./configure $(config_flags) CFLAGS="$(cflags)" CXXFLAGS="$(cflags)"
	touch $@

# Build and run the test suite.
build: config-stamp build-stamp
build-stamp: patch-stamp
	$(MAKE)
	$(CURDIR)/cryptestcwd v
	touch $@

# Let Doxygen generate the documentation.
html: config-stamp html-stamp
html-stamp: patch-stamp
	$(MAKE) html
	touch $@

# Put everything of interest in debian/tmp.
destdir=$(CURDIR)/debian/tmp

install-stamp: build
	dh_testdir
	dh_testroot
	dh_clean -k
	$(MAKE) install DESTDIR=$(destdir)
	rm -f $(destdir)/usr/bin/cryptestcwd
	cp -r $(CURDIR)/TestVectors $(destdir)/usr/share/crypto--
	mkdir $(destdir)/usr/lib/pkgconfig
	cp -r $(CURDIR)/*.pc $(destdir)/usr/lib/pkgconfig
	touch $@

binary-indep: html
	dh_testdir
	dh_testroot
	dh_installdocs -plibcrypto++-doc -X.hhc -X.hhp -X.hhk
	dh_installchangelogs -plibcrypto++-doc 
	dh_compress -plibcrypto++-doc 
	dh_fixperms -plibcrypto++-doc 
	dh_installdeb -plibcrypto++-doc 
	dh_gencontrol -plibcrypto++-doc 
	dh_md5sums -plibcrypto++-doc 
	dh_builddeb -plibcrypto++-doc 

binaryargs := $(patsubst %,-p%,$(binarypackages))

binary-arch: install-stamp
	dh_testdir
	dh_testroot
	dh_installdocs $(binaryargs)
	dh_install --list-missing --sourcedir=$(destdir) $(binaryargs)
	dh_link $(binaryargs)
	dh_installchangelogs $(binaryargs)
	dh_installman -plibcrypto++-utils debian/cryptest.1
	dh_installexamples -plibcrypto++-dev test.cpp
	dh_strip $(binaryargs)
	dh_compress $(binaryargs)
	dh_fixperms $(binaryargs)
	dh_makeshlibs $(binaryargs)
	dh_installdeb $(binaryargs)
	dh_shlibdeps -L$(package) -ldebian/$(package)/usr/lib
	dh_gencontrol $(binaryargs)
	dh_md5sums $(binaryargs)
	dh_builddeb $(binaryargs)

binary: binary-indep binary-arch

.PHONY: autoclean binary binary-indep binary-arch bootstrap build	\
	clean clean-patched html