128 lines
3.7 KiB
Makefile
Executable File
128 lines
3.7 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
include /usr/share/dpkg/architecture.mk
|
|
export DH_VERBOSE = 1
|
|
VERSION := $(shell dpkg-parsechangelog | perl -ne '/Version:\s+(.+)-[^-]+/ && print $$1')
|
|
|
|
%:
|
|
dh $@
|
|
|
|
BUILD = build-tree
|
|
ROOT = $(BUILD)/root
|
|
|
|
ILLUMOS_GATE = illumos-gate
|
|
|
|
$(ILLUMOS_GATE):
|
|
dh_illumos_gate --checkout --destdir=$(ILLUMOS_GATE)
|
|
|
|
.PHONY: create-orig test-orig
|
|
create-orig: $(ILLUMOS_GATE)
|
|
dh_illumos_gate --create-orig --build \
|
|
-X /doc/ \
|
|
$(ILLUMOS_GATE)/usr/src/uts \
|
|
$(ILLUMOS_GATE)/usr/src/common \
|
|
$(ILLUMOS_GATE)/usr/src/lib/gss_mechs/mech_krb5/include/k5-int-pkinit.h \
|
|
$(ILLUMOS_GATE)/usr/src/lib/gss_mechs/mech_krb5/include/preauth_plugin.h \
|
|
$(ILLUMOS_GATE)/usr/src/lib/gss_mechs/mech_krb5/include/autoconf.h \
|
|
$(ILLUMOS_GATE)/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/int-proto.h
|
|
|
|
test-orig: create-orig
|
|
./debian/rules clean
|
|
rm -rf usr .pc
|
|
tar xf ../uts_$(VERSION).orig.tar.xz --strip=1
|
|
quilt push -a
|
|
./debian/rules build
|
|
fakeroot ./debian/rules binary
|
|
|
|
ifeq (illumos-amd64,$(DEB_HOST_ARCH))
|
|
libarch := amd64
|
|
kernelarch := amd64
|
|
else ifeq (illumos-i386,$(DEB_HOST_ARCH))
|
|
libarch := i386
|
|
kernelarch := ia32
|
|
else
|
|
$(error $(DEB_HOST_ARCH) is not supported)
|
|
endif
|
|
|
|
# building with GNU make is broken
|
|
make := -m 'sunmake'
|
|
|
|
override_dh_auto_configure:
|
|
dh_illumos_gate --configure --destdir=$(BUILD) --root=$(ROOT)
|
|
|
|
find $(BUILD)/usr/src/uts/common/sys/lvm -name \*.x \
|
|
-exec ./debian/fix.x.pl {} \;
|
|
|
|
# this shell script generates assembler source files
|
|
# and passes that source to as.
|
|
# Default output format is expected to be 32-bit:
|
|
echo "export ELFWRAP='$(CURDIR)/debian/elfwrap -32'" >> $(BUILD)/usr/env.sh
|
|
|
|
# We need a wrapper for GNU CPP to undefine some macros.
|
|
# The wrapper is debian/cpp
|
|
echo "export RPCGEN='rpcgen -Y $(CURDIR)/debian'" >> $(BUILD)/usr/env.sh
|
|
|
|
# We need these versions for mdb:
|
|
echo 'export YACC=/usr/bin/sgs-yacc' >> $(BUILD)/usr/env.sh
|
|
echo 'export LEX=/usr/bin/sgs-lex' >> $(BUILD)/usr/env.sh
|
|
|
|
# GCC does not support -msave-args for a while:
|
|
echo 'export SAVEARGS=' >> $(BUILD)/usr/env.sh
|
|
|
|
# Use GNU ld for helper programs (due to changes in crt1.o)
|
|
# and sun ld for kernel modules
|
|
sed -i /LD_ALTEXEC/d $(BUILD)/usr/env.sh
|
|
echo 'export LD=sunld' >> $(BUILD)/usr/env.sh
|
|
|
|
echo 'export DEF_BUILDS$(DEB_HOST_ARCH_BITS)=obj$(DEB_HOST_ARCH_BITS)' >> $(BUILD)/usr/env.sh
|
|
echo 'export ALL_BUILDS$(DEB_HOST_ARCH_BITS)=obj$(DEB_HOST_ARCH_BITS)' >> $(BUILD)/usr/env.sh
|
|
|
|
# Disable 32-bit builds on 64-bit host, and vice versa
|
|
ifeq (64,$(DEB_HOST_ARCH_BITS))
|
|
echo "export DEF_BUILDS32=''" >> $(BUILD)/usr/env.sh
|
|
echo "export ALL_BUILDS32=''" >> $(BUILD)/usr/env.sh
|
|
else ifeq (32,$(DEB_HOST_ARCH_BITS))
|
|
echo "export DEF_BUILDS64=''" >> $(BUILD)/usr/env.sh
|
|
echo "export ALL_BUILDS64=''" >> $(BUILD)/usr/env.sh
|
|
else
|
|
$(error DEB_HOST_ARCH_BITS is not defined or holds something wrong)
|
|
endif
|
|
|
|
override_dh_strip:
|
|
: # we don't strip the kernel
|
|
override_dh_makeshlibs:
|
|
: # there are no shared libs
|
|
override_dh_shlibdeps:
|
|
: # there are no shared libs
|
|
|
|
override_dh_auto_build:
|
|
mkdir -p \
|
|
$(ROOT)/etc \
|
|
$(ROOT)/etc/security \
|
|
$(ROOT)/boot \
|
|
$(ROOT)/boot/solaris
|
|
dh_illumos_make $(BUILD)/usr/src/uts -t install_h $(make)
|
|
dh_illumos_make --ctf $(BUILD)/usr/src/uts $(make)
|
|
# sanity check:
|
|
objdump -p $(ROOT)/kernel/fs/amd64/dev | grep 'NEEDED *fs/devfs'
|
|
|
|
override_dh_auto_install:
|
|
rm -rf debian/tmp
|
|
cp -a $(ROOT) debian/tmp
|
|
set -x; for p in `grep -E -v '^(#|$$)' debian/notpacked`; do \
|
|
rm -rf debian/tmp/$$p || exit 1; \
|
|
done
|
|
|
|
override_dh_install:
|
|
dh_install --fail-missing
|
|
debian/abi-check debian/ref debian/uts-dev
|
|
|
|
override_dh_installdeb:
|
|
(cd debian/illumos-kernel && find kernel platform usr/kernel \
|
|
-type f -name \*.conf) > debian/illumos-kernel.conffiles
|
|
dh_installdeb
|
|
|
|
override_dh_auto_clean:
|
|
rm -rf $(BUILD)
|
|
|