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
# 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
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)
else
install-local:: $(DestBytecodeLib)
-$(DestBytecodeLib): $(LibName.BCA) | $(BytecodeDestDir)
+$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
$(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
$(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
install-local:: $(DestRelinkedLib)
-$(DestRelinkedLib): $(LibName.O) | $(PROJ_libdir)
+$(DestRelinkedLib): $(LibName.O) $(PROJ_libdir)
$(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
$(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
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)
install-local:: $(DestTool)
-$(DestTool): $(ToolBuildPath) | $(PROJ_bindir)
+$(DestTool): $(ToolBuildPath) $(PROJ_bindir)
$(Echo) Installing $(BuildMode) $(DestTool)
$(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
$(Echo) "Building $(<F) calling convention information with tblgen"
$(Verb) $(TableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
+$(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
+$(ObjDir)/%GenIntrinsics.inc.tmp : Intrinsics%.td $(ObjDir)/.dir
+ $(Echo) "Building $(<F) calling convention information with tblgen"
+ $(Verb) $(TableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
+
clean-local::
-$(Verb) $(RM) -f $(INCFiles)
$(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 $*)))