Make sure to initialize the fpm in the ocaml tutorial.
[oota-llvm.git] / Makefile.rules
index f697b2d641913451f5ce0afd613c379a809396e5..7999c7a3ca92c5cfc35bc5783cddecfe4708b06c 100644 (file)
 #--------------------------------------------------------------------
 # Define the various target sets
 #--------------------------------------------------------------------
-RecursiveTargets := all clean clean-all install uninstall install-bytecode
+RecursiveTargets := all clean clean-all install uninstall install-bytecode \
+                    unitcheck
 LocalTargets     := all-local clean-local clean-all-local check-local \
                     install-local printvars uninstall-local \
-                   install-bytecode-local unittests
+                   install-bytecode-local
 TopLevelTargets  := check dist dist-check dist-clean dist-gzip dist-bzip2 \
                     dist-zip unittests
 UserTargets      := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
@@ -343,9 +344,10 @@ ifdef REQUIRES_FRAME_POINTER
   LD.Flags  := $(filter-out -fomit-frame-pointer,$(LD.Flags))
 endif
 
-# IF REQUIRES_RTTI=1 is specified then don't disable run-time type id
-ifndef REQUIRES_RTTI
-#  CXX.Flags += -fno-rtti
+# If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
+ifeq ($(REQUIRES_RTTI), 1)
+  CXX.Flags := $(filter-out -fno-rtti,$(CXX.Flags))
+  CXXFLAGS := $(filter-out -fno-rtti,$(CXXFLAGS))
 endif
 
 ifdef ENABLE_COVERAGE
@@ -514,7 +516,10 @@ ifeq ($(HOST_OS),Darwin)
   DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
 
   SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \
-                    -dynamiclib -mmacosx-version-min=$(DARWIN_VERSION)
+                    -dynamiclib
+  ifneq ($(ARCH),ARM)
+    SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
+  endif
 else
   ifeq ($(HOST_OS),Cygwin)
     SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
@@ -525,7 +530,9 @@ else
 endif
 
 ifeq ($(TARGET_OS),Darwin)
-  TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
+  ifneq ($(ARCH),ARM)
+    TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
+  endif
 endif
 
 # Adjust LD.Flags depending on the kind of library that is to be built. Note
@@ -794,6 +801,7 @@ clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
 install  :: $(addsuffix /.makeinstall  ,$(PARALLEL_DIRS))
 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
 install-bytecode  :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
+unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
 
 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
 
@@ -1368,14 +1376,13 @@ $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
 
 # make the C and C++ compilers strip debug info out of bytecode libraries.
 ifdef DEBUG_RUNTIME
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
-       $(Verb) $(LLVMAS) $< -o - | $(LOPT) -std-compile-opts -o $@
+       $(Verb) $(LOPT) $< -std-compile-opts -o $@
 else
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
-       $(Verb) $(LLVMAS) $< -o - | \
-          $(LOPT) -std-compile-opts -strip-debug -o $@
+       $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
 endif
 
 
@@ -1594,6 +1601,18 @@ check::
          $(EchoCmd) No test directory ; \
        fi
 
+check-lit::
+       $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
+         if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
+           $(EchoCmd) Running test suite ; \
+           $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-lit ; \
+         else \
+           $(EchoCmd) No Makefile in test directory ; \
+         fi ; \
+       else \
+         $(EchoCmd) No test directory ; \
+       fi
+
 ###############################################################################
 # UNITTESTS: Running the unittests test suite
 ###############################################################################
@@ -1602,7 +1621,7 @@ unittests::
        $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
          if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
            $(EchoCmd) Running unittests test suite ; \
-           $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests ; \
+           $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
          else \
            $(EchoCmd) No Makefile in unittests directory ; \
          fi ; \