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_bindir)/.dir
-$(PROJ_libdir): $(PROJ_libdir)/.dir
-$(PROJ_includedir): $(PROJ_includedir)/.dir
-$(PROJ_etcdir): $(PROJ_etcdir)/.dir
+$(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir)::
+ $(Verb) $(MKDIR) $@
# To create other directories, as needed, and timestamp their creation
%/.dir:
done
endif
+#-----------------------------------------------------------
+# Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
+#-----------------------------------------------------------
+ifdef OPTIONAL_PARALLEL_DIRS
+ PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)"))
+endif
+
#-----------------------------------------------------------
# Handle the PARALLEL_DIRS options for parallel construction
#-----------------------------------------------------------
install-local:: $(DestSharedLib)
-$(DestSharedLib): $(PROJ_libdir) $(LibName.LA)
+$(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): $(BytecodeDestDir) $(LibName.BCA)
+$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
$(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
$(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
install-local:: $(DestRelinkedLib)
-$(DestRelinkedLib): $(PROJ_libdir) $(LibName.O)
+$(DestRelinkedLib): $(LibName.O) $(PROJ_libdir)
$(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
$(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
install-local:: $(DestArchiveLib)
-$(DestArchiveLib): $(PROJ_libdir) $(LibName.A)
+$(DestArchiveLib): $(LibName.A) $(PROJ_libdir)
$(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
$(Verb) $(MKDIR) $(PROJ_libdir)
$(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
install-local:: $(DestTool)
-$(DestTool): $(PROJ_bindir) $(ToolBuildPath)
+$(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 $*)))