File: rules

package info (click to toggle)
bochs 2.6-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,484 kB
  • sloc: cpp: 180,816; ansic: 17,482; sh: 8,228; makefile: 3,812; yacc: 1,179; asm: 385; perl: 379; lex: 286; csh: 3
file content (246 lines) | stat: -rwxr-xr-x 5,564 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#!/usr/bin/make -f
#
# Copyright © 1997-1999 Joey Hess <joeyh@debian.org>
# Copyright © 2002-2004 Robert Millan <rmh@debian.org>
# Copyright © 2004-2012 Guillem Jover <guillem@debian.org>
#

tmpdir := $(CURDIR)/debian/tmp
pkg_bochs := $(CURDIR)/debian/bochs

DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_ARCH_CPU	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_ARCH_OS	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  conf_gnu_type += --build $(DEB_HOST_GNU_TYPE)
else
  conf_gnu_type += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

WFLAGS = -Wall
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS = $(WFLAGS) $(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS = $(WFLAGS) $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)

cdrom := cdrom

ifeq ($(DEB_HOST_ARCH_OS),linux)
  kernel := linux
  conf_arch_args += --enable-pcidev
  eth := eth0
  com := ttyS0
endif
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
  kernel := fbsd
  eth := xl0
  com := cuua0
  cdrom := acd0
endif
ifeq ($(DEB_HOST_ARCH_OS),hurd)
  eth := eth0
  com := com0
endif

clean:
	dh_testdir
	dh_testroot
	
	[ ! -f bios/Makefile ] || $(MAKE) -C bios bios-clean
	rm -f bios/VGABIOS-*
	rm -f misc/sb16/sb16ctrl
	[ ! -f Makefile ] || $(MAKE) dist-clean
	rm -f bxversion.rc
	rm -f ltdl.* ltdlconf.*
	rm -f ltmain.sh
	rm -f aclocal.m4
	rm -f config.sub config.guess
	rm -f configure
	
	dh_clean

configure: configure.in
	dh_testdir
	
	libtoolize -c
	# XXX: Make extra sure we link against the system shared library.
	rm -rf libltdl
	aclocal
	autoconf

config.status: configure
	dh_testdir
	
	-test -r /usr/share/misc/config.sub && \
	  cp -fu /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
	  cp -fu /usr/share/misc/config.guess config.guess
	
	# Note: We disable docbook support here as a cheap way to avoid
	# building it in build-arch, and only in build-indep. This works
	# because configure only disables entering the directory.
	CPPFLAGS="$(CPPFLAGS)" \
	CFLAGS="$(CFLAGS)" \
	CXXFLAGS="$(CXXFLAGS)" \
	LDFLAGS="$(LDFLAGS)" \
	./configure \
	  $(conf_gnu_type) \
	  --prefix=/usr \
	  --mandir=\$${prefix}/share/man \
	  --with-x11 \
	  --with-rfb \
	  --with-term \
	  --with-sdl \
	  --with-wx \
	  --disable-docbook \
	  --enable-cdrom \
	  --enable-pci \
	  --enable-usb \
	  --enable-usb-ohci \
	  --enable-a20-pin \
	  --enable-cpu-level=6 \
	  --enable-x86-64 \
	  --enable-avx \
	  --enable-vmx=2 \
	  --enable-fpu \
	  --enable-debugger \
	  --enable-debugger-gui \
	  --enable-disasm \
	  --enable-idle-hack \
	  --enable-all-optimizations \
	  --enable-repeat-speedups \
	  --enable-plugins \
	  --enable-compressed-hd \
	  --enable-clgd54xx \
	  --enable-sb16 \
	  --enable-es1370 \
	  --enable-ne2000 \
	  --enable-pnic \
	  $(conf_arch_args)

build: build-arch

build-arch: config.status
	dh_testdir
	
	$(MAKE)
	
ifeq ($(DEB_HOST_ARCH_CPU),i386)
	$(CC) misc/sb16/sb16ctrl.c -o misc/sb16/sb16ctrl
endif

build-indep: config.status
	dh_testdir
	
ifeq (,$(findstring $(DEB_HOST_ARCH_CPU),i386 amd64))
	$(error "build-indep will only succeed on any-i386 or any-amd64")
endif
	
	# bochsbios
	$(MAKE) -C bios
	
	# bochs-doc
	$(MAKE) -C doc/docbook USE_JADE=1

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -s
	
	# Hack to keep install target happy
	touch bios/VGABIOS-fake
	
	$(MAKE) install DESTDIR=$(tmpdir)
	
	# misc cleanup
	rm -f \
	  $(tmpdir)/usr/share/bochs/install-x11-fonts \
	  $(tmpdir)/usr/share/bochs/test-x11-fonts \
	  $(tmpdir)/usr/share/man/man1/bochs-dlx.1.gz \
	  $(tmpdir)/usr/share/doc/bochs/COPYING.gz \
	  $(tmpdir)/usr/bin/bochs-docs
	
	# bochs
	cat $(tmpdir)/usr/share/doc/bochs/bochsrc-sample.txt \
	| sed \
	  -e "s/#kernel#/$(kernel)/g" \
	  -e "s/#eth#/$(eth)/g" \
	  -e "s/#com#/$(com)/g" \
	  -e "s/#cdrom#/$(cdrom)/g" \
	| gzip -c9n \
	> $(pkg_bochs)/usr/share/doc/bochs/examples/bochsrc.gz
	rm -f $(tmpdir)/usr/share/doc/bochs/bochsrc-sample.txt
	
	mv $(tmpdir)/usr/bin/bochs \
	   $(tmpdir)/usr/bin/bochs-bin
	install -m755 debian/launcher \
		      $(tmpdir)/usr/bin/bochs
	
	cp -a debian/etc debian/tmp/
	chmod 755 $(tmpdir)/etc/bochs-init/init.sh
	
ifeq ($(DEB_HOST_ARCH_CPU),i386)
	cp misc/sb16/sb16ctrl \
	   $(tmpdir)/usr/bin/
endif

install-indep: build-indep
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -i
	
	# bochsbios
	mkdir -p \
	   $(tmpdir)/usr/share/bochs/
	cp bios/BIOS* \
	   $(tmpdir)/usr/share/bochs/
	
	# bochs-doc
	$(MAKE) -C doc/docbook install DESTDIR=$(tmpdir)
	
	cp /usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif \
	   $(tmpdir)/usr/share/doc/bochs/images/

binary-indep: install-indep
	dh_testdir -i
	dh_testroot -i
	dh_install -i --sourcedir=$(tmpdir)
	
	dh_installdocs -i
	dh_installexamples -i
	dh_installchangelogs -i CHANGES
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: install
	dh_testdir -s
	dh_testroot -s
	dh_install -s --sourcedir=$(tmpdir)
	dh_installdocs -s
	dh_installexamples -s
	dh_installmenu -s
	dh_installman -s
	dh_installchangelogs -s CHANGES
	dh_link -s
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
	dh_installdeb -s
	dh_shlibdeps -s
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s

binary: binary-indep binary-arch

.PHONY: build build-arch build-indep clean install install-indep
.PHONY: binary-indep binary-arch binary