Git init
[framework/uifw/xorg/util/x11-utils.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian xutils package.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
4 # Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
5 # Copyright © 2005 David Nusinow <dnusinow@debian.org>
6
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
9
10 # set this to the name of the main shlib's binary package
11 PACKAGE = x11-utils
12
13 include debian/xsfbs/xsfbs.mk
14
15 # This package contains multiple modules as shipped by upstream. Each module is # contained in a subdirectory in the root dir of the package. You must list each
16 # subdirectory explicitly so that the build system knows what to build
17 DEF_SUBDIRS=appres editres listres luit viewres xdpyinfo xev xfd xfontsel xkill xlsatoms xlsclients xlsfonts xmessage xprop xvinfo xwininfo
18 #DEF_SUBDIRS=appres editres listres luit viewres xdpyinfo xdriinfo xev xfd xfontsel xkill xlsatoms xlsclients xlsfonts xmessage xprop xvinfo xwininfo
19 SUBDIRS=$(DEF_SUBDIRS)
20 BUILD_STAMPS = $(addprefix $(STAMP_DIR)/build-,$(SUBDIRS))
21
22 CFLAGS = -Wall -g
23 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
29         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
30         MAKEFLAGS += -j$(NUMJOBS)
31 endif
32
33 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
34 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
35 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
36 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
37         confflags += --build=$(DEB_HOST_GNU_TYPE)
38 else
39         confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
40 endif
41
42
43 build: build-stamp
44 build-stamp: $(BUILD_STAMPS)
45         >$@
46
47 $(STAMP_DIR)/build-%: $(STAMP_DIR)/genscripts $(STAMP_DIR)/patch
48         dh_testdir
49         mkdir -p $*-obj-$(DEB_BUILD_GNU_TYPE)
50         cd $*-obj-$(DEB_BUILD_GNU_TYPE) && \
51         ../$*/configure --prefix=/usr --mandir=\$${prefix}/share/man \
52                         --infodir=\$${prefix}/share/info $(confflags) \
53                         --disable-xprint \
54                         CFLAGS="$(CFLAGS)" \
55                         RSH=rsh \
56                         MANCONF="/etc/manpath.config"
57         cd $*-obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
58         >$@
59
60 clean: xsfclean
61         dh_testdir
62         dh_testroot
63         rm -f build-stamp
64
65         rm -f config.cache config.log config.status
66         rm -f */config.cache */config.log */config.status
67         rm -f conftest* */conftest*
68         rm -rf autom4te.cache */autom4te.cache
69         rm -rf *-obj-*
70
71         dh_clean
72
73 install: build
74         dh_testdir
75         dh_testroot
76         dh_clean -k
77         dh_installdirs
78
79         for FILE in $(SUBDIRS); do \
80                 cd "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \
81                 cd ..; \
82         done
83
84 # Build architecture-dependent files here.
85 binary-arch: build install
86         dh_testdir
87         dh_testroot
88
89 #       dh_installdocs
90         dh_install --sourcedir=debian/tmp --list-missing
91 #       dh_installmenu
92 #       dh_installchangelogs
93         dh_link
94         dh_strip
95         dh_compress
96         dh_fixperms
97         dh_makeshlibs
98         dh_installdeb
99         dh_shlibdeps
100         dh_makeshlibs
101         dh_gencontrol
102         dh_md5sums
103         dh_builddeb
104
105 # Build architecture-independent files here.
106 binary-indep: build install
107 # Nothing to do
108
109 binary: binary-indep binary-arch
110 .PHONY: build clean binary-indep binary-arch binary install