remove empty dir
[ghc-hetmet.git] / ghc / compiler / Makefile
index 4920e16..c1819f2 100644 (file)
@@ -216,6 +216,8 @@ $(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile
        @echo "cRAWCPP_FLAGS         = \"$(RAWCPP_FLAGS)\"" >> $(CONFIG_HS)
        @echo "cGCC                  = \"$(WhatGccIsCalled)\"" >> $(CONFIG_HS)
        @echo "cMKDLL                = \"$(BLD_DLL)\"" >> $(CONFIG_HS)
+       @echo "cLdIsGNULd            = \"$(LdIsGNULd)\"" >> $(CONFIG_HS)
+       @echo "cLD_X                 = \"$(LD_X)\"" >> $(CONFIG_HS)
        @echo "cPROJECT_DIR          = \"$(PROJECT_DIR)\"" >> $(CONFIG_HS)
        @echo "cGHC_DRIVER_DIR_REL   = \"$(GHC_DRIVER_DIR_REL)\"" >> $(CONFIG_HS)
        @echo "cGHC_TOUCHY_PGM       = \"$(GHC_TOUCHY_PGM)\"" >> $(CONFIG_HS)
@@ -259,9 +261,9 @@ stage1/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
        @echo "#ifndef __PLATFORM_H__"  >$@
        @echo "#define __PLATFORM_H__" >>$@
        @echo >> $@
-       @echo "#define BuildPlatform_TYPE  $(BuildPlatform_CPP)" >> $@
-       @echo "#define HostPlatform_TYPE   $(HostPlatform_CPP)" >> $@
-       @echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@
+       @echo "#define BuildPlatform_NAME  \"$(BUILDPLATFORM)\"" >> $@
+       @echo "#define HostPlatform_NAME   \"$(HOSTPLATFORM)\"" >> $@
+       @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
        @echo >> $@
        @echo "#define $(BuildPlatform_CPP)_BUILD       1" >> $@
        @echo "#define $(HostPlatform_CPP)_HOST         1" >> $@
@@ -305,9 +307,9 @@ stage2/$(PLATFORM_H) : stage_dirs $(FPTOOLS_TOP)/mk/config.mk Makefile
        @echo "#ifndef __PLATFORM_H__"  >$@
        @echo "#define __PLATFORM_H__" >>$@
        @echo >> $@
-       @echo "#define BuildPlatform_TYPE  $(HostPlatform_CPP)" >> $@
-       @echo "#define HostPlatform_TYPE   $(TargetPlatform_CPP)" >> $@
-       @echo "#define TargetPlatform_TYPE $(TargetPlatform_CPP)" >> $@
+       @echo "#define BuildPlatform_NAME  \"$(HOSTPLATFORM)\"" >> $@
+       @echo "#define HostPlatform_NAME   \"$(TARGETPLATFORM)\"" >> $@
+       @echo "#define TargetPlatform_NAME \"$(TARGETPLATFORM)\"" >> $@
        @echo >> $@
        @echo "#define $(HostPlatform_CPP)_BUILD        1" >> $@
        @echo "#define $(TargetPlatform_CPP)_HOST               1" >> $@
@@ -557,11 +559,14 @@ ifeq "$(bootstrapped)" "YES"
 utils/Binary_HC_OPTS           = -funbox-strict-fields
 endif
 
-# BinIface and Binary take ages to both compile and run if you don's use -O
+# We always optimise some low-level modules, otherwise performance of
+# a non-optimised compiler is severely affected.
 main/BinIface_HC_OPTS          += -O
 utils/Binary_HC_OPTS           += -O
 utils/FastMutInt_HC_OPTS       += -O
-
+utils/Encoding_HC_OPTS         += -O
+utils/StringBuffer_HC_OPTS     += -O
+utils/FastString_HC_OPTS       += -O
 
 # ---- Profiling ----
 #simplCore/Simplify_HC_OPTS = -auto-all
@@ -677,7 +682,11 @@ $(odir)/ghc-inplace : $(HS_PROG)
 ghc-inplace : stage1/ghc-inplace
        $(LN_S) -f $< $@
 
-CLEAN_FILES += $(odir)/ghc-inplace ghc-inplace
+ifeq "$(stage)" "1"
+CLEAN_FILES += ghc-inplace
+endif
+
+CLEAN_FILES += $(odir)/ghc-inplace
 
 #-----------------------------------------------------------------------------
 #              install
@@ -752,6 +761,9 @@ VERSION = $(ProjectVersion)
 PKG_DEPENDS += base haskell98
 PACKAGE_CPP_OPTS += -DPKG_DEPENDS='$(PKG_DEPENDS)'
 
+# Omit Main from the library, the client will want to plug their own Main in
+LIBOBJS = $(filter-out $(odir)/main/Main.o $(odir)/parser/hschooks.o, $(OBJS))
+
 # disable splitting: it won't really help with GHC, and the specialised
 # build system for ghc/compiler isn't set up to handle it.
 SplitObjs = NO