summaryrefslogtreecommitdiff
path: root/utils/unlit/ghc.mk
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-04-08 10:02:34 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2017-04-08 10:58:41 +0100
commitff84d052850b637b03bbb98cf05202e44886257d (patch)
tree0d7dea696d0c5200763ae30f7edb313f5c170cc4 /utils/unlit/ghc.mk
parent54895c90440cb81f18657537b91f2aa35bd54173 (diff)
downloadhaskell-ff84d052850b637b03bbb98cf05202e44886257d.tar.gz
cross-build 'unlit' and 'hp2ps' for stage2 install
In navive build case it does not matter much if we build 'unlit' and 'hp2ps' tools with ghc-stage0 or ghc-stage1: both GHCs are native compilers and both tools are written in C (have no haskell code). But in cross-case the difference is substantial: In Stag1Only=YES case we need to install native tools built by ghc-stage0/${host}-cc. In Stag1Only=NO case we need to install cross-built tools built by ghc-stage1/${target}-cc. Before this change GHC did not have a rule to build cross-built 'unlit' and 'hp2ps'. The change adds cross-built 'unlit' and 'hp2ps' as 'dist-install' targets. 'inplace/lib/bin/unlit.bin' target is unchanged and still contains native binary. As a result this change allows cross-building and packaging whole GHC for target platform! Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'utils/unlit/ghc.mk')
-rw-r--r--utils/unlit/ghc.mk18
1 files changed, 16 insertions, 2 deletions
diff --git a/utils/unlit/ghc.mk b/utils/unlit/ghc.mk
index e947989b5e..8911f4e856 100644
--- a/utils/unlit/ghc.mk
+++ b/utils/unlit/ghc.mk
@@ -10,11 +10,25 @@
#
# -----------------------------------------------------------------------------
+# built by ghc-stage0
utils/unlit_dist_C_SRCS = unlit.c
utils/unlit_dist_PROGNAME = unlit
utils/unlit_dist_TOPDIR = YES
-utils/unlit_dist_INSTALL = YES
utils/unlit_dist_INSTALL_INPLACE = YES
-$(eval $(call build-prog,utils/unlit,dist,0))
+# built by ghc-stage1
+utils/unlit_dist-install_C_SRCS = $(utils/unlit_dist_C_SRCS)
+utils/unlit_dist-install_PROGNAME = $(utils/unlit_dist_PROGNAME)
+utils/unlit_dist-install_TOPDIR = $(utils/unlit_dist_TOPDIR)
+utils/unlit_dist-install_INSTALL_INPLACE = NO
+
+ifeq "$(Stage1Only)" "YES"
+utils/unlit_dist_INSTALL = YES
+utils/unlit_dist-install_INSTALL = NO
+else
+utils/unlit_dist_INSTALL = NO
+utils/unlit_dist-install_INSTALL = YES
+endif
+$(eval $(call build-prog,utils/unlit,dist,0))
+$(eval $(call build-prog,utils/unlit,dist-install,1))