summaryrefslogtreecommitdiff
path: root/uts/debian/rules
blob: 92265a54c402de95953ed81f2419cf4344aa651f (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
#!/usr/bin/make -f

illtar = /usr/src/illumos-gate/illumos-gate.tar.xz

DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

CODEMGR_WS = $(CURDIR)/illumos-gate


unpack: unpack-stamp
unpack-stamp: $(illtar)
	dh_testdir
	tar xf $(illtar) \
		--exclude=usr/src/cmd \
		--exclude=usr/src/lib \
		--exclude=usr/src/head
	touch $@

illumos-gate/illumos.sh: unpack-stamp
	cd illumos-gate && \
		sed -r '/export\s+CODEMGR_WS=/ s,CODEMGR_WS=.*,CODEMGR_WS="$(CODEMGR_WS)",' \
		usr/src/tools/env/illumos.sh > illumos.sh
	
patch: unpack
	dh_testdir
	[ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt push -a

unpatch:
	dh_testdir
	[ ! -f debian/patches/series ] || QUILT_PATCHES=debian/patches quilt pop -a

build build-arch build-indep: build-stamp
build-stamp: patch illumos-gate/illumos.sh
	cd illumos-gate && \
	ksh93 usr/src/tools/scripts/bldenv.sh -d illumos.sh -c "cd usr/src/uts && /usr/bin/sunmake install_h"
	touch $@

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_install
	touch $@

clean: unpatch
	dh_testdir
	dh_testroot
	dh_clean
	rm -rf illumos-gate
	rm -f *-stamp