[project @ 2001-10-03 15:30:57 by rrt]
[ghc-hetmet.git] / mk / target.mk
index dd2ddcb..fd0502b 100644 (file)
 
 ifneq "$(SUBDIRS)" ""
 
-# we override the boot & all targets in the top level Makefile
-ifneq "$(NO_ALL_TARGETS)" "YES"
+# we override the 'boot', 'all' and 'install' targets in the top
+# level Makefile. Some of the sub-projects also set 'boot' to empty.
+
+ifeq "$(NO_ALL_TARGET)" "YES"
+ALL_TARGET     =
+else
 ALL_TARGET     = all
+endif
+
+ifeq "$(NO_BOOT_TARGET)" "YES"
+BOOT_TARGET    =
+else
 BOOT_TARGET    = boot
+endif
+
+ifeq "$(NO_INSTALL_TARGET)" "YES"
+INSTALL_TARGET =
+else
 INSTALL_TARGET = install
 endif
 
@@ -165,8 +179,12 @@ endif
 #  The boot target, at a minimum generates dependency information
 
 .PHONY: boot
-boot :: depend
 
+ifeq "$(NO_BOOT_TARGET)" "YES"
+boot ::
+else
+boot :: depend
+endif
 
 ##################################################################
 #              GNU Standard targets
@@ -297,7 +315,7 @@ ifneq "$(BootingFromHc)" "YES"
 $(HS_PROG) :: $(HS_OBJS)
        $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(HS_OBJS)
 else
-# see bootstrp.mk
+# see bootstrap.mk
 $(HS_PROG) :: $(HS_OBJS)
        $(CC) -o $@ $(HC_BOOT_CC_OPTS) $(HC_BOOT_LD_OPTS) $(HS_OBJS) $(HC_BOOT_LIBS)
 endif
@@ -444,7 +462,7 @@ HC_SPLIT_PRE = \
     $(RM) $@; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \
     $(FIND) $(basename $@) -name '*.$(way_)o' | xargs $(RM) __rm_food; fi
 ifeq "$(GhcWithInterpreter)" "YES"
-HC_SPLIT_POST = ld -r -x -o $@ $(basename $@)/*.$(way_)o
+HC_SPLIT_POST = $(LD) -r -x -o $@ $(basename $@)/*.$(way_)o
 else
 HC_SPLIT_POST = touch $@
 endif # GhcWithInterpreter == YES
@@ -474,12 +492,12 @@ ifeq "$(StripLibraries)" "YES"
 ifeq "$(SplitObjs)" "YES"
 SRC_HC_POST_OPTS += \
   for i in $(basename $@)/*; do \
-       ld -r -x -o $$i.tmp $$i; \
+       $(LD) -r -x -o $$i.tmp $$i; \
        $(MV) $$i.tmp $$i; \
   done
 else
 SRC_HC_POST_OPTS += \
-  ld -r -x -o $@.tmp $@; $(MV) $@.tmp $@
+  $(LD) -r -x -o $@.tmp $@; $(MV) $@.tmp $@
 endif # SplitObjs
 endif # StripLibraries
 
@@ -521,7 +539,7 @@ ifneq "$(DONT_WANT_STD_GHCI_LIB_RULE)" "YES"
 # hslibs/Win32 uses this 'feature'.
 #
 $(GHCI_LIBRARY) :: $(LIBOBJS)
-       ld -r -x -o $@ $(LIBOBJS) $(STUBOBJS)
+       $(LD) -r -x -o $@ $(LIBOBJS) $(STUBOBJS)
 
 endif # DONT_WANT_STD_GHCI_LIB_RULE
 endif # GhcWithInterpreter