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
|
#!/usr/bin/make -f
SHELL := /bin/bash
DEB_BUILD_MAINT_OPTIONS += hardening=+all
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
# Code is currently not compatible with C23, which GCC 15 made the
# default, because it intends for function prototypes like "void
# (*foo)()" to mean "any args" rather than "void (*foo)(void)".
# https://gcc.sourceware.org/gcc-15/porting_to.html#c23
export CC := gcc --std=gnu17
export ARCH_OPTS := $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
%:
dh $@
override_dh_testdir:
dh_testdir stalin.sc
# Symlink the prebuilt file for the current architecture. It may be
# that if the ./stalin-architecture output matches for two
# architectures, then the .c files will be the same, but all of the
# following matches were determined by creating the relevant
# stalin-arch-ARCH.c file (via "make stalin-arch-ARCH.c" after adding
# the entry to include/stalin.architectures) and then diffing it
# against existing prebuilt files.
stalin-arch-amd64.c:
ln -sf debian/prebuilt-src/stalin-arch-amd64.c $@
stalin-arch-arm64.c:
ln -sf debian/prebuilt-src/stalin-arch-amd64.c $@
stalin-arch-ia64.c:
ln -sf debian/prebuilt-src/stalin-arch-amd64.c $@
stalin-arch-i386.c:
ln -sf debian/prebuilt-src/stalin-arch-i386.c $@
stalin-arch-sparc.c:
cp -a debian/prebuilt-src/stalin-arch-sparc.c $@.tmp
patch $@.tmp debian/prebuilt-src/stalin-arch-sparc-from-i386.diff
mv $@.tmp $@
override_dh_auto_build: stalin-arch-$(DEB_HOST_ARCH).c
./build
./build-gl-fpi
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
rm -rf debian/tmp-test
mkdir debian/tmp-test
echo '(display "hello") (newline)' > debian/tmp-test/hello.scm
cd debian/tmp-test && $(CURDIR)/stalin -On hello.scm
test -x debian/tmp-test/hello
test $$(debian/tmp-test/hello) = "hello"
cd benchmarks && ./make-clean ./compile-and-run-stalin-old-benchmarks
endif
override_dh_clean:
dh_clean
rm -rf debian/tmp-test stalin-arch-$(DEB_HOST_ARCH).c
|