summaryrefslogtreecommitdiff
path: root/debian/rules
blob: b612fc4fe69843c832c429c0691841815efb142d (plain)
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
#!/usr/bin/make -f
#
# Based on the work by Marcus Brinkmann <brinkmd@debian.org>
# Rewritten by Guillem Jover <guillem@debian.org>
#

pkg := gnumach
pkg_dbg := gnumach-dbg
pkg_dev := gnumach-dev

DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

CFLAGS = -Wall -g -pipe

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

# disabled:
#   ncr5380, ncr53c400, ncr53c406a
#   hpj2577, hpj2573, hp27248b, hp2585, atp

drivers := --enable-floppy \
	--enable-ide \
	\
	--enable-advansys \
	--enable-buslogic \
	--enable-u1434f \
	--enable-ultrastor \
	--enable-aha152x --enable-aha2825 \
	--enable-aha1542 \
	--enable-aha1740 \
	--enable-aic7xxx \
	--enable-futuredomain \
	--enable-in2000 \
	--enable-pas16 \
	--enable-seagate \
	--enable-t128 --enable-t128f --enable-t228 \
	--enable-ncr53c7xx \
	--enable-eatapio \
	--enable-wd7000 \
	--enable-eata \
	--enable-am53c974 --enable-am79c974 \
	--enable-dtc3280 --enable-dtc3180 \
	--enable-ncr53c8xx --enable-dc390w --enable-dc390u --enable-dc390f \
	--enable-dc390t --enable-dc390 \
	--enable-ppa \
	--enable-qlogicfas \
	--enable-qlogicisp \
	--enable-gdth \
	\
	--enable-de4x5 --enable-de425 --enable-de434 \
	--enable-de435 --enable-de450 --enable-de500 \
	--enable-eexpresspro100 \
	--enable-epic100 \
	--enable-hp100 \
	--enable-ne2kpci \
	--enable-pcnet32 \
	--enable-rtl8139 --enable-rtl8129 \
	--enable-viarhine \
	--enable-elcp --enable-tulip \
	--enable-yellowfin \
	\
	--enable-sundance \
	--enable-winbond-840 \
	--enable-hamachi \
	--enable-myson803 \
	--enable-ns820 \
	\
	--enable-ac3200 \
	--enable-ul32 \
	\
	--enable-at1700 \
	--enable-ul \
	--enable-epic \
	--enable-wd80x3 \
	--enable-3c503 --enable-el2 \
	--enable-hplan --enable-hplanplus \
	--enable-seeq8005 \
	--enable-e2100 \
	--enable-ne2000 --enable-ne1000 \
	--enable-at1500 --enable-ne2100 \
	--enable-fmv18x \
	--enable-eth16i --enable-eth32 \
	--enable-el3 --enable-3c509 --enable-3c579 \
	--enable-vortex --enable-3c59x --enable-3c90x \
	--enable-3c515 \
	--enable-znet --enable-znote \
	--enable-eexpress --enable-eexpresspro  \
	--enable-depca --enable-de100 --enable-de101 --enable-de200 \
	--enable-de201 --enable-de202 --enable-de210 --enable-de422 \
	--enable-ewrk3 --enable-de203 --enable-de204 --enable-de205 \
	--enable-apricot \
	--enable-el1 --enable-3c501 \
	--enable-wavelan \
	--enable-el16 --enable-3c507 \
	--enable-elplus --enable-3c505 \
	--enable-de600 --enable-de620 \
	--enable-skg16 \
	--enable-ni52 --enable-ni65 \
	--enable-lance \
	--enable-tlan

patch::
	# XXX: Should be removed once the autoconf patch is in upstream
	test -f i386/linux/configure.ac || \
	  cp i386/linux/Drivers.in i386/linux/configure.ac

include debian/patch.mk

configure: patch stamp-configure
stamp-configure:
	dh_testdir
	-mkdir build
	cd build && ../configure $(drivers) \
		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
	touch stamp-configure

configure-dbg: patch stamp-configure-dbg
stamp-configure-dbg:
	dh_testdir
	-mkdir build-dbg
	cd build-dbg && ../configure --enable-kdb $(drivers) \
		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
	touch stamp-configure-dbg

all build: stamp-build stamp-build-dbg
stamp-build: configure
	dh_testdir
	$(MAKE) -C build
	$(MAKE) -C build/doc
	touch stamp-build

stamp-build-dbg: configure-dbg
	dh_testdir
	$(MAKE) -C build-dbg
	touch stamp-build-dbg

clean::
	dh_testdir
	-rm -f machine stamp-build stamp-configure
	-rm -rf build build-dbg
	-rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
                -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print`
	# XXX: Should be removed once the autoconf patch is in upstream
	rm -f i386/linux/configure.ac
	
	dh_clean

binary: binary-indep binary-arch

binary-indep:
binary-arch: binary-gnumach binary-gnumach-dev binary-gnumach-dbg

binary-gnumach-dev: stamp-build
	dh_testdir
	dh_testroot
	dh_clean -p$(pkg_dev) -k
	dh_installdirs -p$(pkg_dev)
	
	$(MAKE) -C build install-headers \
		prefix=$(CURDIR)/debian/$(pkg_dev)/usr \
		exec_prefix=$(CURDIR)/debian/$(pkg_dev) \
		includedir=\$${prefix}/include
	
	dh_installdocs -p$(pkg_dev)
	dh_installchangelogs -p$(pkg_dev) -k ChangeLog
	
	dh_link -p$(pkg_dev)
	dh_strip -p$(pkg_dev)
	dh_compress -p$(pkg_dev)
	dh_fixperms -p$(pkg_dev)
	dh_installdeb -p$(pkg_dev)
	dh_gencontrol -p$(pkg_dev)
	dh_md5sums -p$(pkg_dev)
	dh_builddeb -p$(pkg_dev)

binary-gnumach: stamp-build
	dh_testdir
	dh_testroot
	dh_clean -p$(pkg) -k
	dh_installdirs -p$(pkg)
	
	$(MAKE) -C build install-kernel \
		prefix=$(CURDIR)/debian/$(pkg)/usr \
		exec_prefix=$(CURDIR)/debian/$(pkg)
	
	dh_installdocs -p$(pkg)
	dh_installchangelogs -p$(pkg) -k ChangeLog
	dh_installinfo -p$(pkg)
	
	dh_link -p$(pkg)
	dh_strip -p$(pkg)
	dh_compress -p$(pkg) boot/gnumach
	dh_fixperms -p$(pkg)
	dh_installdeb -p$(pkg)
	dh_gencontrol -p$(pkg)
	dh_md5sums -p$(pkg)
	dh_builddeb -p$(pkg)

binary-gnumach-dbg: stamp-build-dbg
	dh_testdir
	dh_testroot
	dh_clean -p$(pkg_dbg) -k
	dh_installdirs -p$(pkg_dbg)
	
	$(MAKE) -C build-dbg install-kernel \
		prefix=$(CURDIR)/debian/$(pkg_dbg)/usr \
		exec_prefix=$(CURDIR)/debian/$(pkg_dbg)
	mv debian/$(pkg_dbg)/boot/gnumach debian/$(pkg_dbg)/boot/gnumach-dbg
	
	dh_installdocs -p$(pkg_dbg)
	dh_installchangelogs -p$(pkg_dbg) -k ChangeLog
	
	dh_link -p$(pkg_dbg)
	dh_compress -p$(pkg_dbg) boot/gnumach-dbg
	dh_fixperms -p$(pkg_dbg)
	dh_installdeb -p$(pkg_dbg)
	dh_gencontrol -p$(pkg_dbg)
	dh_md5sums -p$(pkg_dbg)
	dh_builddeb -p$(pkg_dbg)

.PHONY: build clean configure binary binary-indep binary-arch
.PHONY: binary-gnumach binary-gnumach-dev binary-gnumach-dbg