Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 DEB_BUILD_MAINT_OPTIONS=hardening=+all
4 include /usr/share/dpkg/architecture.mk
5 include /usr/share/dpkg/buildflags.mk
6
7 ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
8 BUILD_SYSTEM = --build $(DEB_BUILD_GNU_TYPE)
9 else
10 BUILD_SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
11 endif
12 CONFFLAGS = --enable-scrollbar-code --enable-signal-handler --without-libzio \
13 --disable-setenv-code --enable-off_t --enable-largefile
14 # some flags need to be given to make:
15 DIRFLAGS = appdefaultsdir=/etc/X11/app-defaults sysdocdir=/usr/share/doc
16
17 CFLAGS += -Wall -Wmissing-prototypes -Wshadow -std=gnu17
18 LDFLAGS += -Wl,-z,defs
19 ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
20 CPPFLAGS += -DMESSAGES
21 endif
22 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
23 MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
24 endif
25
26 clean:
27 dh_testdir
28 # run distclean if configure was completed or attempted
29 if [ -f config.status -o -f config.log ] ; then $(MAKE) distclean ; fi
30 test ! -f config.status
31 rm -f config.guess config.sub
32 dh_clean
33 rm -f build-arch-stamp
34
35 config.status: configure
36 dh_testdir
37 cp -f /usr/share/misc/config.guess config.guess
38 cp -f /usr/share/misc/config.sub config.sub
39 # touch files to avoid recreating files in case of timestamp issues
40 touch src/gv-i18n.h doc/gv.1
41 ./configure $(BUILD_SYSTEM) \
42 $(CONFFLAGS) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' \
43 LDFLAGS='$(LDFLAGS)' \
44 --bindir=/usr/bin --datarootdir=/usr/share \
45 --mandir=/usr/share/man --infodir=/usr/share/info \
46 || ( echo configure failed with $$? ; cat config.log ; exit 1 )
47
48 build-arch: build-arch-stamp
49 build-arch-stamp: config.status
50 dh_testdir
51 $(MAKE) $(DIRFLAGS) LIBS="-lXaw3d -lXmu -lXt -lX11 -lm -lXinerama"
52 touch $@
53
54 binary-arch: build-arch-stamp
55 dh_testdir
56 dh_testroot
57 dh_prep
58 $(MAKE) $(DIRFLAGS) install DESTDIR=${CURDIR}/debian/gv
59 dh_install
60 dh_installchangelogs ChangeLog
61 dh_installdocs AUTHORS NEWS README
62 dh_installinfo doc/gv.info
63 dh_installmime
64 dh_strip
65 dh_compress
66 find debian/gv -name "dir.gz" -print -delete
67 dh_fixperms
68 dh_md5sums
69 dh_shlibdeps
70 dh_installdeb
71 dh_gencontrol
72 dh_builddeb
73
74 build-indep:
75 binary-indep:
76 # nothing to do...
77
78 build: build-arch
79 binary: binary-arch
80
81 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean