[project @ 2005-04-22 21:57:42 by simonmar]
[ghc-hetmet.git] / mk / target.mk
index ab425a6..6a0b5aa 100644 (file)
@@ -337,7 +337,6 @@ HC_SPLIT_POST = \
     echo "INPUT(" *.$(way_)o ")" >>ld.script; \
     $(LD) -r $(LD_X) -o ../$(notdir $@) ld.script; \
   )
-CLEAN_FILES += *_split/ld.script
 else
 HC_SPLIT_POST = \
   ( cd $(basename $@)_split; \
@@ -358,7 +357,7 @@ SRC_HC_POST_OPTS += $(HC_SPLIT_POST);
 #
 
 extraclean ::
-       $(FIND) $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) -name '*.$(way_)o' -print | xargs $(RM) __rm_food
+       $(FIND) $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) -name '*.$(way_)o' -print -o -name ld.script -print | xargs $(RM) __rm_food
        -rmdir $(patsubst %.$(way_)o,%_split,$(HS_OBJS)) > /dev/null 2>&1
 
 endif # $(SplitObjs)
@@ -794,6 +793,9 @@ install:: $(INSTALL_LIBEXECS)
        @$(INSTALL_DIR) $(libexecdir)
        -for i in $(INSTALL_LIBEXECS); do \
                $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i $(libexecdir); \
+                if test "$(darwin_TARGET_OS)" = "1"; then \
+                        sh $(FPTOOLS_TOP)/mk/fix_install_names.sh $(libdir) $(libexecdir)/`basename $$i` ; \
+                fi ; \
        done
 endif
 
@@ -1032,6 +1034,11 @@ maintainer-clean:: extraclean
 # Expects:     $(WAYS)                 the possible "way" strings to one of 
 #                                      which $(way) will be set
 
+ifneq "$(way)" ""
+ifeq "$(findstring $(way), $(WAYS))" ""
+$(error Unknown way $(way))
+endif
+endif
 
 # So how does $(way) ever get set to anything?  Answer, we recursively
 # invoke make, setting $(way) on the command line.
@@ -1161,7 +1168,7 @@ 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
@@ -1208,7 +1215,7 @@ $(ALL_TARGET) docs runtests $(BOOT_TARGET) TAGS clean distclean mostlyclean main
        @echo "------------------------------------------------------------------------"
 
 endif
-#endif
+endif
 
 #
 # Selectively building subdirectories.