Changed option name from inline-threshold to basic-inline-threshold because
[oota-llvm.git] / Makefile.rules
index 8122b8f6521c63203f4a7e3750b1cb46d5b83c64..06ffe005da717e9393f9fb08cfdf5bf3562ba15a 100644 (file)
@@ -278,8 +278,19 @@ ifdef ENABLE_EXPENSIVE_CHECKS
 endif
 
 ifeq ($(ENABLE_PIC),1)
-  CXX.Flags += -fPIC
-  C.Flags   += -fPIC
+  ifeq ($(LLVM_ON_WIN32),1)
+    # Nothing. Win32 defaults to PIC and warns when given -fPIC
+  else
+    ifeq ($(OS),Darwin)
+      # common is forbidden in dylib files
+      CXX.Flags += -fno-common
+      C.Flags   += -fno-common
+    else
+      # Linux and others; pass -fPIC
+      CXX.Flags += -fPIC
+      C.Flags   += -fPIC
+    endif
+  endif
 endif
 
 CXX.Flags     += $(CXXFLAGS) -Woverloaded-virtual
@@ -560,7 +571,7 @@ ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
 # in the file so they get built before dependencies
 #---------------------------------------------------------
 
-$(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir):
+$(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir)::
        $(Verb) $(MKDIR) $@
 
 # To create other directories, as needed, and timestamp their creation
@@ -868,7 +879,7 @@ DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
 
 install-local:: $(DestSharedLib)
 
-$(DestSharedLib): $(LibName.LA) $(PROJ_libdir)
+$(DestSharedLib): $(LibName.LA) $(PROJ_libdir)
        $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
        $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
        $(Verb) $(LIBTOOL) --finish $(PROJ_libdir)
@@ -935,7 +946,7 @@ uninstall-local::
 else
 install-local:: $(DestBytecodeLib)
 
-$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
+$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
        $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
        $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
 
@@ -982,7 +993,7 @@ DestRelinkedLib = $(PROJ_libdir)/$(LIBRARYNAME).o
 
 install-local:: $(DestRelinkedLib)
 
-$(DestRelinkedLib): $(LibName.O) $(PROJ_libdir)
+$(DestRelinkedLib): $(LibName.O) $(PROJ_libdir)
        $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
        $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
 
@@ -1022,7 +1033,7 @@ DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a
 
 install-local:: $(DestArchiveLib)
 
-$(DestArchiveLib): $(LibName.A) $(PROJ_libdir)
+$(DestArchiveLib): $(LibName.A) $(PROJ_libdir)
        $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
        $(Verb) $(MKDIR) $(PROJ_libdir)
        $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
@@ -1084,7 +1095,7 @@ DestTool = $(PROJ_bindir)/$(TOOLNAME)
 
 install-local:: $(DestTool)
 
-$(DestTool): $(ToolBuildPath) $(PROJ_bindir)
+$(DestTool): $(ToolBuildPath) $(PROJ_bindir)
        $(Echo) Installing $(BuildMode) $(DestTool)
        $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
 
@@ -1754,3 +1765,11 @@ printvars::
        $(Echo) "SubDirs      : " '$(SubDirs)'
        $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
        $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
+
+###
+# Debugging
+
+# General debugging rule, use 'make print-XXX' to print the
+# definition, value and origin of XXX.
+print-%: 
+       $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))