[project @ 2005-01-11 14:14:48 by simonmar]
[ghc-hetmet.git] / mk / target.mk
index 62d3355..8aac7d3 100644 (file)
@@ -288,12 +288,14 @@ endif
 # whether HS_SRCS is empty or not.
 #
 
+# can't split objs in way 'u', so we disable it here
+ifeq "$(way)" "u"
+SplitObjs = NO
+endif
+
 ifneq "$(HS_SRCS)" ""
 ifeq "$(SplitObjs)" "YES"
 
-# can't split objs in way 'u', so we disable it here
-ifneq "$(way)" "u"
-
 SRC_HC_OPTS += -split-objs
 
 # We generate the archive into a temporary file libfoo.a.tmp, then
@@ -316,7 +318,6 @@ $(AR) $(AR_OPTS) $@ $(ArSupportsInput) $@.list
 $(RM) $@.list
 $(RANLIB) $@
 endef
-endif
 
 # Extra stuff for compiling Haskell files with $(SplitObjs):
 
@@ -369,7 +370,7 @@ endif # $(HS_SRCS)
 ifeq "$(StripLibraries)" "YES"
 ifeq "$(SplitObjs)" "YES"
 SRC_HC_POST_OPTS += \
-  for i in $(basename $@)_split/*; do \
+  for i in $(basename $@)_split/*.$(way_)o; do \
        $(LD) -r $(LD_X) -o $$i.tmp $$i; \
        $(MV) $$i.tmp $$i; \
   done