initialize print_context registry on startup
[ginac.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 # This is the debhelper compatability version to use.
7 export DH_COMPAT=4
8 # This has to be exported to make some magic below work.
9 export DH_OPTIONS
10
11 # These are used for cross-compiling and for saving the configure script
12 # from having to guess our platform (since we know it already)
13 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         export CXXFLAGS = -O0
19 else
20         export CXXFLAGS = -O2 -fomit-frame-pointer -finline-limit=1200
21 endif
22 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
23         INSTALL_PROGRAM += -s
24 endif
25
26 config.status: configure
27         dh_testdir
28         # Add here commands to configure the package.
29         ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
30
31 build: build-arch
32
33 build-arch: build-arch-stamp
34 build-arch-stamp:  config.status
35         # Add here commands to compile the arch part of the package.
36         $(MAKE) prefix=$(CURDIR)/debian/tmp/usr infodir=$(CURDIR)/debian/tmp/usr/share/info mandir=$(CURDIR)/debian/tmp/usr/share/man
37
38 clean:
39         dh_testdir
40         dh_testroot
41         rm -f build-arch-stamp config-stamp
42         -$(MAKE) distclean
43         dh_clean
44
45 install: install-arch
46 install-arch:
47         dh_testdir
48         dh_testroot
49         dh_clean -k -a
50         dh_installdirs -a
51         # Add here commands to install the arch part of the package into 
52         # debian/tmp.
53         $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
54         mkdir -p $(CURDIR)/debian/tmp/usr/X11R6/include/X11/pixmaps
55         cp $(CURDIR)/debian/ginac.xpm $(CURDIR)/debian/tmp/usr/X11R6/include/X11/pixmaps/
56
57 # Must not depend on anything. This is to be called by
58 # binary-arch/binary-multi
59 # in another 'make' thread.
60 binary-common:
61         dh_testdir
62         dh_testroot
63         dh_installdocs
64         dh_installmenu
65         dh_installman
66         dh_installinfo
67         dh_installchangelogs ChangeLog
68         dh_movefiles
69         dh_link
70         dh_strip
71         dh_compress
72         dh_fixperms
73         dh_makeshlibs
74         dh_shlibdeps --libpackage=libginac1.1 -l debian/libginac1.1/usr/lib
75         dh_gencontrol
76         dh_installdeb
77         dh_md5sums
78         dh_builddeb
79
80 # Build architecture dependant packages using the common target.
81 binary-arch: build-arch install-arch
82         $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
83
84 binary: binary-arch
85 .PHONY: build clean binary-arch binary install install-arch