[project @ 2001-01-25 10:44:34 by qrczak]
[ghc-hetmet.git] / mk / target.mk
index d11fbff..6384a55 100644 (file)
 
 ifneq "$(SUBDIRS)" ""
 
-all docs runtests boot TAGS clean distclean mostlyclean maintainer-clean install html ps dvi txt::
+# we override the boot & all targets in the top level Makefile
+ifneq "$(NO_ALL_TARGETS)" "YES"
+ALL     = all
+BOOT    = boot
+INSTALL = install
+endif
+
+$(ALL) docs runtests $(BOOT) TAGS clean distclean mostlyclean maintainer-clean $(INSTALL) html ps dvi txt::
        @echo "------------------------------------------------------------------------"
        @echo "===fptools== Recursively making \`$@' in $(SUBDIRS) ..."
        @echo "PWD = $(shell pwd)"
@@ -414,13 +421,15 @@ ifeq "$(GHCI_LIBOBJS)" ""
 GHCI_LIBOBJS = $(LIBOBJS)
 endif
 
-ifeq "$(SplitObjs)" "YES"
-$(GHCI_LIBRARY) :: $(GHCI_LIBOBJS)
-       ( echo $(STUBOBJS) ; $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o' -print ) | xargs ld -r -x -o $@
-else
 $(GHCI_LIBRARY) :: $(GHCI_LIBOBJS)
-       ld -r -x -o $@ $(GHCI_LIBOBJS)
+ifneq "$(HS_SRCS)" ""
+ifeq "$(SplitObjs)" "YES"
+       $(foreach obj,$(GHCI_LIBOBJS), \
+           ld -r -x -o $(obj)         \
+           $(patsubst %.$(way_)o,%,$(obj))/*.$(way_)o &&) true
 endif
+endif
+       ld -r -x -o $@ $(GHCI_LIBOBJS) $(STUBOBJS)
 
 CLEAN_FILES += $(GHCI_LIBRARY)
 endif
@@ -619,7 +628,9 @@ endif
 ifneq "$(SCRIPT_PREFIX_FILES)" ""
        @cat $(SCRIPT_PREFIX_FILES) >> $@
 endif
+ifneq "$(SCRIPT_SUBST)" ""
        @eval $(SCRIPT_SUBST) 
+endif
        @cat $(SCRIPT_OBJS) >> $@
        @chmod a+x $@
        @echo Done.