From ec2e177faf6ed8ff934f0bd97cf77fcb0f2210bd Mon Sep 17 00:00:00 2001 From: sof Date: Sat, 8 Sep 2001 21:42:07 +0000 Subject: [PATCH] [project @ 2001-09-08 21:42:07 by sof] Remove ugly special casing - if you want to turn off the default rule for GHCI_LIBRARY, set DONT_WANT_STD_GHCI_LIB_RULE to YES in your Makefile prior to including $(TOP)/mk/target.mk ghc/lib/std and hslibs/win32 both do this now on mingw32. --- ghc/lib/std/Makefile | 12 ++++++------ mk/target.mk | 19 ++++++------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/ghc/lib/std/Makefile b/ghc/lib/std/Makefile index 24c9afe..0fdeebc 100644 --- a/ghc/lib/std/Makefile +++ b/ghc/lib/std/Makefile @@ -111,21 +111,21 @@ GHCI_LIBOBJS = $(filter-out PrelMain.$(way_)o,$(HS_OBJS)) ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" -# Standard rule -HSstd.o :: $(GHCI_LIBOBJS) - ld -r -x -o $@ $(GHCI_LIBOBJS) - +LIBOBJS=$(GHCI_LIBOBJS) else # Rule for Win32 platform # Keep HSstd.o as a pseudo-target (I think) + +# Turn off standard rule which creates HSstd.o from LIBOBJS. +DONT_WANT_STD_GHCI_LIB_RULE=YES + HSstd.o :: $(GHCI_LIBOBJS) ld -r -x -o HSstd1.o $(filter Prel%, $(GHCI_LIBOBJS)) ld -r -x -o HSstd2.o $(filter-out Prel%, $(GHCI_LIBOBJS)) + @touch HSstd.o endif # TARGETPLATFORM = i386-unknown-mingw32 - - #----------------------------------------------------------------------------- # Installation; need to install .hi files as well as libraries # diff --git a/mk/target.mk b/mk/target.mk index 448b077..dd2ddcb 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -515,22 +515,15 @@ CLEAN_FILES += $(GHCI_LIBRARY) all :: $(GHCI_LIBRARY) -# How come GNU make doesn't support ands and ors? Duh. -ifneq "$(GHCI_LIBRARY)" "HSstd.o" -ifneq "$(GHCI_LIBRARY)" "HSwin32.o" -# An annoying gotcha is that the Prelude is a bit special, -# for reasons described in ghc/lib/std/Makefile. -# So we only put in this standard rule for packages other than std -# The rule for the Prelude is in ghc/lib/std/Makefile -# We check for GHCI_LIBRARY being HSstd.o rather than -# PACKAGE being std, because we want to still use the boilerplate rule -# for cbits. -# JRS 04 Sept 01: The exact same deal applies to hslibs/HSwin32.o. +ifneq "$(DONT_WANT_STD_GHCI_LIB_RULE)" "YES" +# If you don't want to build GHCI_LIBRARY the 'standard' way, +# set DONT_WANT_STD_GHCI_LIB_RULE to YES. The Prelude and +# hslibs/Win32 uses this 'feature'. +# $(GHCI_LIBRARY) :: $(LIBOBJS) ld -r -x -o $@ $(LIBOBJS) $(STUBOBJS) -endif # GHCI_LIBRARY != "HSwin32.o" -endif # GHCI_LIBRARY != "HSstd.o" +endif # DONT_WANT_STD_GHCI_LIB_RULE endif # GhcWithInterpreter endif # way endif # GHCI_LIBRARY != "" -- 1.7.10.4