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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
ifneq (,$(filter amd64 arm64 ppc64el,$(DEB_HOST_ARCH_CPU)))
# PIE disabled on 64 bit architecture because it's mostly written in
# assembly and already handles PIC when needed. The codes aren't
# compiled with gcc so enable -fPIE is meaningless.
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
CFLAGS_NO_PIE := $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS_NO_PIE := $(shell dpkg-buildflags --get LDFLAGS)
endif
LDFLAGS += -Wl,-z,noexecstack
ifeq (arm,$(DEB_HOST_ARCH_CPU))
CFLAGS += -marm
endif
override_dh_auto_build:
ifeq (amd64,$(DEB_HOST_ARCH_CPU))
mv src64/tags src64/tags.orig
make -C src OS=Linux tools gate
make -C src64 OS=Linux CFLAGS="$(CFLAGS_NO_PIE)" LDFLAGS="$(LDFLAGS_NO_PIE)" x86-64.linux picolisp
else ifeq (arm64,$(DEB_HOST_ARCH_CPU))
mv src64/tags src64/tags.orig
make -C src OS=Linux tools gate
make -C src64 CFLAGS="$(CFLAGS_NO_PIE)" LDFLAGS="$(LDFLAGS_NO_PIE)" arm64.linux picolisp
else ifeq (ppc64el,$(DEB_HOST_ARCH_CPU))
mv src64/tags src64/tags.orig
make -C src OS=Linux tools gate
make -C src64 CFLAGS="$(CFLAGS_NO_PIE)" LDFLAGS="$(LDFLAGS_NO_PIE)" ppc64.linux picolisp
else
make -C src OS=Linux CPU=$(DEB_HOST_ARCH_CPU) picolisp tools gate
endif
mkdir -p build/bash_completion.d
cp lib/bash_completion build/bash_completion.d/pil
# Remove build time utilities
-rm src64/sysdeps
override_dh_auto_test:
HOME=$(CURDIR)/build $(CURDIR)/pil test/lib.l -bye + < /dev/null
override_dh_auto_install:
dh_install build/bash_completion.d/pil usr/share/bash-completion/completions
dh_install -X.o src usr/share/picolisp
dh_install -X.o src64 usr/share/picolisp
override_dh_installdocs:
dh_installdocs -Xdoc/db -Xdoc/utf8
override_dh_installchangelogs:
dh_installchangelogs -k -XChangeLog CHANGES
override_dh_auto_clean:
make -C src clean
make -C src64 clean
-rm bin/ssl bin/httpGate bin/lat1 bin/utf2 bin/balance
-mv src64/tags.orig src64/tags
-rm -rf build
override_dh_compress:
dh_compress -X.l
override_dh_strip:
dh_strip --no-automatic-dbgsym
%:
dh $@
|