[project @ 2001-05-09 09:55:41 by simonmar]
[ghc-hetmet.git] / mk / target.mk
index 926560d..295ec4c 100644 (file)
@@ -293,13 +293,19 @@ boot :: depend
 ifneq "$(HS_PROG)" ""
 all :: $(HS_PROG)
 
+ifneq "$(BootingFromHc)" "YES"
 $(HS_PROG) :: $(HS_OBJS)
-       $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(HS_OBJS) $(LIBS)
+       $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(HS_OBJS)
+else
+# see bootstrp.mk
+$(HS_PROG) :: $(HS_OBJS)
+       $(CC) -o $@ $(HC_BOOT_CC_OPTS) $(HC_BOOT_LD_OPTS) $(HS_OBJS) $(HC_BOOT_LIBS)
+endif
 endif
 
 # Object and interface files have suffixes tagged with their ways
 ifneq "$(way)" ""
-SRC_HC_OPTS += -hisuf $(way_)hi
+SRC_HC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(way_)o
 endif
 
 #----------------------------------------
@@ -314,29 +320,39 @@ endif
 
 
 #----------------------------------------
-#      Libraries/archives
+#      Building HsLibs libraries.
+
+ifneq "$(HSLIB)" ""
 
 ifeq "$(IS_CBITS_LIB)" "YES"
 _cbits := _cbits
 endif
 
-ifneq "$(HSLIB)" ""
 LIBRARY      = libHS$(HSLIB)$(_cbits)$(_way).a
 GHCI_LIBRARY = HS$(HSLIB)$(_cbits)$(_way).o
+
+ifneq "$(IS_CBITS_LIB)" "YES"
+WAYS=$(GhcLibWays)
+endif
+
 ifeq "$(LIBOBJS)" ""
-  ifneq "$(IS_CBITS_LIB)" "YES"
-  LIBOBJS = $(HS_OBJS)
-  else
+  ifeq "$(IS_CBITS_LIB)" "YES"
   LIBOBJS = $(C_OBJS)
+  else
+  LIBOBJS = $(HS_OBJS)
   endif
 endif
-ifneq "$(IS_CBITS_LIB)" ""
-CC = $(HC)
+
+ifeq "$(IS_CBITS_LIB)" "YES"
 override datadir:=$(libdir)/includes
 INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(HSLIB)"').h
 SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR)
 endif
-endif
+
+endif # HSLIB
+
+#----------------------------------------
+#      Libraries/archives
 
 ifneq "$(LIBRARY)" ""
 all :: $(LIBRARY)
@@ -685,6 +701,7 @@ $(LINK) : $(LINK_TARGET)
 # install links to script drivers.
 #
 install ::
+       @$(INSTALL_DIR) $(bindir)
        @if ( $(PERL) -e '$$fn="$(bindir)/$(LINK)"; exit ((! -f $$fn || -l $$fn) ? 0 : 1);' ); then \
           echo "Creating a symbol link from $(LINK_TARGET) to $(LINK) in $(bindir)"; \
           $(RM) $(bindir)/$(LINK); \
@@ -959,7 +976,7 @@ SGML_HTML = $(addsuffix .html,$(SGML_DOC))
 # HTML output goes in a subdirectory on its own.
 SGML_TEXT = $(addsuffix .txt,$(SGML_DOC))
 
-$(SGML_DVI) $(SGML_PS) $(SGML_HTML) $(SGML_TEXT) :: $(SGML_SRCS)
+$(SGML_DVI) $(SGML_PS) $(SGML_HTML) $(SGML_TEXT) $(SGML_PDF) :: $(SGML_SRCS)
 
 dvi  :: $(SGML_DVI)
 ps   :: $(SGML_PS)