[project @ 2002-12-05 23:49:43 by mthomas]
[ghc-hetmet.git] / mk / target.mk
index 3a54c97..2843334 100644 (file)
@@ -44,6 +44,11 @@ PRE_SRCS := $(ALL_SRCS)
 
 include $(TOP)/mk/package.mk
 
+###################################################################
+# Suffix rules for Haskell, C and literate 
+
+include $(TOP)/mk/suffix.mk
+
 ##################################################################
 #              FPtools standard targets
 #
@@ -238,9 +243,6 @@ else
 $(HS_PROG) :: $(HS_OBJS)
        $(CC) -o $@ $(HC_BOOT_CC_OPTS) $(HC_BOOT_LD_OPTS) $(HS_OBJS) $(HC_BOOT_LIBS)
 endif
-
-# for building a Haskell program, we add FptoolsHcOpts
-SRC_HC_OPTS += $(FptoolsHcOpts)
 endif
 
 #----------------------------------------
@@ -302,9 +304,8 @@ SRC_HC_OPTS += -split-objs
 ifeq "$(ArSupportsInput)" ""
 define BUILD_LIB
 $(RM) $@ $@.tmp
-(echo $(STUBOBJS) $(EXTRA_OBJS); $(FIND) $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) -name '*.$(way_)o') | xargs ar q $@.tmp
-$(RANLIB) $@.tmp
-$(MV) $@.tmp $@
+(echo $(STUBOBJS) $(EXTRA_OBJS); $(FIND) $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) -name '*.$(way_)o') | xargs ar q $@
+$(RANLIB) $@
 endef
 else
 define BUILD_LIB
@@ -312,10 +313,9 @@ $(RM) $@ $@.tmp
 echo $(STUBOBJS)    > $@.list
 echo $(EXTRA_OBJS) >> $@.list
 $(FIND) $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) -name '*.$(way_)o' >> $@.list
-$(AR) $(AR_OPTS) $@.tmp $(ArSupportsInput) $@.list
+$(AR) $(AR_OPTS) $@ $(ArSupportsInput) $@.list
 $(RM) $@.list
-$(RANLIB) $@.tmp
-$(MV) $@.tmp $@
+$(RANLIB) $@
 endef
 endif