Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openbios / utils / dist / debian / rules
1 #! /usr/bin/make -f
2 # Generated automatically from debian/packages
3 # by yada v0.9.9, of Tue, 07 Dec 1999
4 # Modified by Piotr Roszatycki <dexter@debian.org>, Mon,  1 Oct 2001 13:14:11 +0200
5
6 DEB_HOST_GNU_CPU    := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
7 DEB_HOST_GNU_TYPE   := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8 DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
9
10 DEB_BUILD_GNU_CPU    := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
11 DEB_BUILD_GNU_TYPE   := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12 DEB_BUILD_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
13
14 VERSION:=$(shell LC_ALL=C dpkg-parsechangelog | sed -ne 's/^Version: *\([^2]*\)/\1/p')
15
16 SHELL=/bin/bash
17
18 .PHONY: default
19 default:
20         @echo "Specify a target:"; \
21         echo " build              compile the package"; \
22         echo " binary             make all binary packages"; \
23         echo " binary-arch        make all architecture-dependent binary packages"; \
24         echo " binary-indep       make all architecture-independent binary packages"; \
25         echo " clean              clean up the source package"; \
26         echo; \
27         echo " depends            check build-time dependencies"; \
28         echo " install-tree       compile the package and create the install trees"; \
29         echo " clean-install-tree clean up only under debian/"; \
30         echo
31
32 # Check build dependencies and conflicts
33
34 .PHONY: depends
35 depends: chmod-yada debian/depends-stamp
36 debian/depends-stamp:
37         @echo 'Checking build conflicts and dependencies; just a minute...'
38         @echo -n 'grep-dctrl...'; v=$$(grep-status -X -F Package 'grep-dctrl' | grep Version | head -1 | sed -e 's/^Version: //'); \
39         if test ! "$$v"; then echo -n 'grep-dctrl (virtual package)...'; v=$$(grep-status -e -F Provides '(^grep-dctrl, |, grep-dctrl$$|^grep-dctrl$$)' | grep Version | head -1 | sed -e 's/^Version: //'); fi; \
40         if test "$$v"; then \
41             exit 0; \
42         fi; \
43         echo 'Build depends on `grep-dctrl'\'' (any version), which is not satisfied' | fmt; exit 1
44         @echo -n 'yada...'; v=$$(grep-status -X -F Package 'yada' | grep Version | head -1 | sed -e 's/^Version: //'); \
45         if test ! "$$v"; then echo -n 'yada (virtual package)...'; v=$$(grep-status -e -F Provides '(^yada, |, yada$$|^yada$$)' | grep Version | head -1 | sed -e 's/^Version: //'); fi; \
46         if test "$$v"; then \
47           if dpkg --compare-versions "$$v" '>=' '0.9.9'; then \
48             exit 0; \
49           fi; \
50         fi; \
51         echo 'Build depends on `yada'\'' (version >= 0.9.9), which is not satisfied' | fmt; exit 1
52         @echo
53         @echo 'Conflicts and dependencies all satisfied!'
54         touch debian/depends-stamp
55
56 # Build the package and prepare the install tree
57
58 .PHONY: build-only build
59 build-only: debian/build-stamp
60 build: chmod-yada build-only
61
62 # Make sure these rules and the control file are up-to-date
63
64 .PHONY: rules control
65 rules: debian/rules
66 debian/rules: $(shell which yada) debian/packages
67         $(shell which yada) rebuild rules
68
69 control: debian/control
70 debian/control: $(shell which yada) debian/packages
71         $(shell which yada) rebuild control
72
73 debian/build-stamp: debian/depends-stamp
74         @[ -f $(shell which yada) -a -f debian/rules ]
75         @umask 022 \
76             && export PACKAGE="openbios" \
77             && export VERSION="$(VERSION)" \
78             && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
79             && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
80             && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
81             && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
82             && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
83             && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" \
84  && (\
85         echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
86         echo -E 'CC=gcc';\
87         echo -E 'CFLAGS="-O2 -Wall"';\
88         echo -E 'cd toke; make; strip toke; cd ..';\
89         echo -E 'cd detok; make; strip detok; cd ..';\
90         echo -E 'cd paflof; make; strip paflof; cd ..';\
91         echo -E 'find toke/examples -name .cvsignore | xargs rm -f') | /bin/sh
92         touch debian/build-stamp
93
94 .PHONY: install-tree
95 install-tree: chmod-yada install-tree-any
96 install-tree-any: \
97         debian/tmp-openbios/DEBIAN/control
98
99 debian/tmp-openbios/DEBIAN/control: debian/build-stamp debian/control
100         rm -rf debian/tmp-openbios
101         umask 022 && install -d debian/tmp-openbios/DEBIAN
102         install -d debian/tmp-openbios/usr/share/doc/openbios
103         umask 022; $(shell which yada) generate copyright \
104                                >debian/tmp-openbios/usr/share/doc/openbios/copyright
105         install -m 644 -p debian/changelog \
106                           debian/tmp-openbios/usr/share/doc/openbios/changelog.Debian
107         @umask 022 \
108             && export PACKAGE="openbios" \
109             && export ROOT="$$(pwd)/debian/tmp-openbios" \
110             && export CONTROL="$$(pwd)/debian/tmp-openbios/DEBIAN" \
111             && export VERSION="$(VERSION)" \
112             && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
113             && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
114             && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
115             && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
116             && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
117             && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" \
118  && (\
119         echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
120         echo -E 'mkdir -p $$ROOT/usr/bin';\
121         echo -E 'mkdir -p $$ROOT/usr/share/openbios';\
122         echo -E 'mkdir -p $$ROOT/usr/share/doc/packages/openbios';\
123         echo -E 'cp toke/toke $$ROOT/usr/bin';\
124         echo -E 'cp detok/detok $$ROOT/usr/bin';\
125         echo -E 'cp paflof/paflof $$ROOT/usr/bin';\
126         echo -E 'cp -a toke/examples $$ROOT/usr/share/doc/openbios';\
127         echo -E 'cp -a forth $$ROOT/usr/share/openbios';\
128         echo -E 'cp toke/README $$ROOT/usr/share/doc/openbios/README.toke';\
129         echo -E 'cp detok/README $$ROOT/usr/share/doc/openbios/README.detok') | /bin/sh
130         LD_LIBRARY_PATH="debian/tmp-openbios/lib:debian/tmp-openbios/usr/lib:$$LD_LIBRARY_PATH" dpkg-shlibdeps -pshlibs:openbios -dDepends debian/tmp-openbios/usr/bin/*
131         $(shell which yada) compress openbios
132         $(shell which yada) generate maintscripts openbios
133         find debian/tmp-openbios -type f -print \
134           | sed -n 's/^debian\/tmp-openbios\(\/etc\/.*\)$$/\1/p' \
135             > debian/tmp-openbios/DEBIAN/conffiles
136         if test ! -s debian/tmp-openbios/DEBIAN/conffiles; then rm -f debian/tmp-openbios/DEBIAN/conffiles; fi
137         $(shell which yada) rebuild control
138         $(shell which yada) generate substvars openbios
139         umask 022 && dpkg-gencontrol -isp -popenbios -Pdebian/tmp-openbios
140
141 # Build package files
142
143 .PHONY: binary binary-arch binary-indep
144 binary: binary-arch binary-indep
145 binary-arch: chmod-yada binary-arch-any
146
147 .PHONY: binary-arch-any
148 binary-arch-any: \
149         binary-package-openbios
150 binary-indep: chmod-yada
151
152 .PHONY: binary-package-openbios
153 binary-package-openbios: check-root debian/tmp-openbios/DEBIAN/control
154         @[ -f $(shell which yada) -a -f debian/rules ]
155         chown -R 0.0 debian/tmp-openbios
156         chmod -R u=rwX,go=rX debian/tmp-openbios
157         @if [ -d debian/tmp-openbios/usr/doc/openbios ]; then \
158           echo "*** Yada warning: /usr/doc/openbios should be /usr/share/doc/openbios";\
159         fi
160         dpkg-deb --build debian/tmp-openbios ..
161
162 .PHONY: check-root
163 check-root:
164         @[ `id -u` = 0 ] || (echo "You must be root to do this!"; false)
165
166 .PHONY: chmod-yada
167 chmod-yada:
168         @if [ -f debian/yada -a ! -x debian/yada ]; then \
169           chmod +x debian/yada; \
170         fi
171
172 # Clean up afterwards
173
174 .PHONY: clean clean-install-tree clean-build
175 clean: chmod-yada clean-install-tree clean-build debian/control debian/rules
176
177 clean-build:
178         @[ -f $(shell which yada) -a -f debian/rules ]
179         rm -f debian/build-stamp debian/depends-stamp
180         @umask 022 && (\
181         echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
182         echo -E 'cd toke; make clean; cd ..';\
183         echo -E 'cd detok; make clean; cd ..';\
184         echo -E 'cd paflof; make clean; cd ..') | /bin/sh
185
186 clean-install-tree: chmod-yada debian/rules
187         @[ -f $(shell which yada) -a -f debian/rules ]
188         rm -f debian/install-tree-stamp
189         rm -rf debian/tmp* debian/files* debian/substvars