include $(TOP)/mk/package.mk
+###################################################################
+# Suffix rules for Haskell, C and literate
+
+include $(TOP)/mk/suffix.mk
+
##################################################################
# FPtools standard targets
#
# Compiler produced files that are targets of the source's imports.
MKDEPENDHS_OBJ_SUFFICES=o
-depend :: $(MKDEPENDHS_SRCS) $(MKDEPENDC_SRCS)
+ifneq "$(STAMP_PKG_CONF)" ""
+PKGCONF_DEP = $(STAMP_PKG_CONF)
+else
+PKGCONF_DEP =
+endif
+
+depend :: $(MKDEPENDHS_SRCS) $(MKDEPENDC_SRCS) $(STAMP_PKG_CONF)
@$(RM) .depend
@touch .depend
ifneq "$(DOC_SRCS)" ""
$(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
#----------------------------------------
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) $(C_OBJS); $(FIND) $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) -name '*.$(way_)o') | xargs $(AR) $@
+$(RANLIB) $@
endef
else
define BUILD_LIB
$(RM) $@ $@.tmp
-echo $(STUBOBJS) > $@.list
-echo $(EXTRA_OBJS) >> $@.list
+echo $(STUBOBJS) > $@.list
+echo $(C_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
# the --no-print-directory flag which is passed to recursive
# invocations of make.
#
-ifeq "$(way)" ""
+#ifeq "$(way)" ""
ifneq "$(SUBDIRS)" ""
# we override the 'boot', 'all' and 'install' targets in the top
@echo "------------------------------------------------------------------------"
endif
-endif
+#endif
#
# Selectively building subdirectories.