# Default rule for test. It ensures everything has a test rule
test::
+# Default rule for building only bytecode.
+bytecode::
+
# Print out the directories used for building
prdirs::
echo "Home Offset : " $(HOME_OBJ_ROOT);
echo "LLVM Source Root: " $(LLVM_SRC_ROOT);
echo "LLVM Object Root: " $(LLVM_OBJ_ROOT);
+#
+# Mark all of these targets as phony. This will hopefully speed up builds
+# slightly since GNU Make will not try to find implicit rules for targets
+# which are marked as Phony.
+#
+.PHONY: all dynamic clean distclean install test bytecode prdirs
+
###########################################################################
# Miscellaneous paths and commands:
# This section defines various configuration macros, such as where
# Libtool is found in the current directory.
#
ifdef VERBOSE
-LIBTOOL=$(LLVM_SRC_ROOT)/libtool
+LIBTOOL=$(LLVM_SRC_ROOT)/mklib
else
-LIBTOOL=$(LLVM_SRC_ROOT)/libtool --silent
+LIBTOOL=$(LLVM_SRC_ROOT)/mklib --silent
endif
#
#---------------------------------------------------------
ifdef DIRS
-all install clean test ::
+all install clean test bytecode ::
$(VERB) for dir in ${DIRS}; do \
(cd $$dir; $(MAKE) $@) || exit 1; \
done
# Handle PARALLEL_DIRS
ifdef PARALLEL_DIRS
-all :: $(addsuffix /.makeall , $(PARALLEL_DIRS))
-install :: $(addsuffix /.makeinstall, $(PARALLEL_DIRS))
-clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
-test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
+all :: $(addsuffix /.makeall , $(PARALLEL_DIRS))
+install :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS))
+clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
+test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
+bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))
-%/.makeall %/.makeinstall %/.makeclean %/.maketest:
+%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
$(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
endif
# Handle directories that may or may not exist
ifdef OPTIONAL_DIRS
-all install clean test ::
+all install clean test bytecode ::
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $$dir ]; \
then\
# USED_LIB_PATHS - Compute the path of the libraries used so that tools are
# rebuilt if libraries change. This has to make sure to handle .a/.so and .o
-# files seperately.
+# files separately.
#
STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
USED_LIB_PATHS_G := $(addprefix $(DESTLIBDEBUG)/, $(STATICUSEDLIBS))