[project @ 2001-01-18 10:26:42 by simonmar]
authorsimonmar <unknown>
Thu, 18 Jan 2001 10:26:42 +0000 (10:26 +0000)
committersimonmar <unknown>
Thu, 18 Jan 2001 10:26:42 +0000 (10:26 +0000)
fix multiple instances of objects on the link line

ghc/lib/std/Makefile

index 9f11efc..91cc785 100644 (file)
@@ -37,7 +37,9 @@ HSLIB = std
 # we don't want PrelMain in the GHCi library.
 GHCI_LIBOBJS = $(filter-out PrelMain.$(way_)o,$(HS_OBJS))
 
-HS_SRCS += $(patsubst %.hsc,%.hs,$(wildcard *.hsc))
+HSC_SRCS = $(wildcard *.hsc)
+HSC_HS   = $(patsubst %.hsc,%.hs, $(HSC_SRCS))
+HS_SRCS := $(HSC_HS) $(filter-out $(HSC_HS),$(HS_SRCS))
 
 #-----------------------------------------------------------------------------
 #      Setting the GHC compile options
@@ -91,6 +93,11 @@ endif
 
 CLEAN_FILES += PrelPrimopWrappers.hs PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
 
+CLEAN_FILES +=  \
+       $(patsubst %.hsc, %.hs, $(HSC_SRCS)) \
+       $(patsubst %.hsc, %.hs.c, $(HSC_SRCS)) \
+       $(patsubst %.hsc, %.hs.h, $(HSC_SRCS))
+
 #
 # If we're building the unregisterised way, it may well be for Hugs.
 # In that case, remember to bind the cbits objects into a single file