Makefile: Pass LDFLAGS, CFLAGS, and CPPFLAGS through ghc and on to ld, cc, and cpp.

As a result of the Makefile changes, the Debian package is built
with various hardening options. Although their benefit to a largely
haskell program is unknown.
This commit is contained in:
Joey Hess 2015-08-19 13:53:57 -04:00
parent fec1568054
commit 485465107a
3 changed files with 18 additions and 1 deletions

12
Build/collect-ghc-options.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
# Generate --ghc-options to pass LDFLAGS, CFLAGS, and CPPFLAGS through ghc
# and on to ld, cc, and cpp.
for w in $LDFLAGS; do
printf -- "-optl%s\n" "$w"
done
for w in $CFLAGS; do
printf -- "-optc%s\n" "$w"
done
for w in $CPPFLAGS; do
printf -- "-optc-Wp,%s\n" "$w"
done