[vmkit-commits] [vmkit] r180401 - use my own environment for sub directories

Peter Senna Tschudin peter.senna at gmail.com
Thu Apr 25 10:14:49 PDT 2013


Author: peter.senna
Date: Thu Apr 25 12:06:10 2013
New Revision: 180401

URL: http://llvm.org/viewvc/llvm-project?rev=180401&view=rev
Log:
use my own environment for sub directories
(cherry picked from commit 0449b3684404ef8ecd13470ebbbd633aed8cccb4)

Modified:
    vmkit/trunk/Makefile.common.llvm
    vmkit/trunk/Makefile.rules
    vmkit/trunk/lib/Makefile
    vmkit/trunk/tools/Makefile

Modified: vmkit/trunk/Makefile.common.llvm
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.common.llvm?rev=180401&r1=180400&r2=180401&view=diff
==============================================================================
--- vmkit/trunk/Makefile.common.llvm (original)
+++ vmkit/trunk/Makefile.common.llvm Thu Apr 25 12:06:10 2013
@@ -1217,121 +1217,6 @@ $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PRO
 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
 
 #---------------------------------------------------------
-# Handle the DIRS options for sequential construction
-#---------------------------------------------------------
-
-SubDirs :=
-ifdef DIRS
-SubDirs += $(DIRS)
-
-ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
-$(RecursiveTargets)::
-	$(Verb) for dir in $(DIRS); do \
-	  if ([ ! -f $$dir/Makefile ] || \
-	      command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
-	    $(MKDIR) $$dir; \
-	    $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
-	  fi; \
-	  ($(MAKE) -C $$dir $@ ) || exit 1; \
-	done
-else
-$(RecursiveTargets)::
-	$(Verb) for dir in $(DIRS); do \
-	  ($(MAKE) -C $$dir $@ ) || exit 1; \
-	done
-endif
-
-endif
-
-#---------------------------------------------------------
-# Handle the EXPERIMENTAL_DIRS options ensuring success
-# after each directory is built.
-#---------------------------------------------------------
-ifdef EXPERIMENTAL_DIRS
-$(RecursiveTargets)::
-	$(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
-	  if ([ ! -f $$dir/Makefile ] || \
-	      command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
-	    $(MKDIR) $$dir; \
-	    $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
-	  fi; \
-	  ($(MAKE) -C $$dir $@ ) || exit 0; \
-	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) -o -f $(T)/Makefile && echo "$(T)"))
-endif
-
-#-----------------------------------------------------------
-# Handle the PARALLEL_DIRS options for parallel construction
-#-----------------------------------------------------------
-ifdef PARALLEL_DIRS
-
-SubDirs += $(PARALLEL_DIRS)
-
-# Unfortunately, this list must be maintained if new recursive targets are added
-all      :: $(addsuffix /.makeall      ,$(PARALLEL_DIRS))
-clean    :: $(addsuffix /.makeclean    ,$(PARALLEL_DIRS))
-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))
-
-$(ParallelTargets) :
-	$(Verb) \
-	  SD=$(PROJ_SRC_DIR)/$(@D); \
-	  DD=$(@D); \
-	  if [ ! -f $$SD/Makefile ]; then \
-	    SD=$(@D); \
-	    DD=$(notdir $(@D)); \
-	  fi; \
-	  if ([ ! -f $$DD/Makefile ] || \
-	            command test $$DD/Makefile -ot \
-                      $$SD/Makefile ); then \
-	  $(MKDIR) $$DD; \
-	  $(CP) $$SD/Makefile $$DD/Makefile; \
-	fi; \
-	$(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
-endif
-
-#---------------------------------------------------------
-# Handle the OPTIONAL_DIRS options for directores that may
-# or may not exist.
-#---------------------------------------------------------
-ifdef OPTIONAL_DIRS
-
-SubDirs += $(OPTIONAL_DIRS)
-
-ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
-$(RecursiveTargets)::
-	$(Verb) for dir in $(OPTIONAL_DIRS); do \
-	  if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
-	    if ([ ! -f $$dir/Makefile ] || \
-	        command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
-	      $(MKDIR) $$dir; \
-	      $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
-	    fi; \
-	    ($(MAKE) -C$$dir $@ ) || exit 1; \
-	  fi \
-	done
-else
-$(RecursiveTargets)::
-	$(Verb) for dir in $(OPTIONAL_DIRS); do \
-	  if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
-	    ($(MAKE) -C$$dir $@ ) || exit 1; \
-	  fi \
-	done
-endif
-endif
-
-#---------------------------------------------------------
 # Handle the CONFIG_FILES options
 #---------------------------------------------------------
 ifdef CONFIG_FILES

Modified: vmkit/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=180401&r1=180400&r2=180401&view=diff
==============================================================================
--- vmkit/trunk/Makefile.rules (original)
+++ vmkit/trunk/Makefile.rules Thu Apr 25 12:06:10 2013
@@ -1,4 +1,4 @@
-.PHONY: all all-subs build-module bootstrap tidy clean distclean local-clean
+.PHONY: all tidy clean confclean
 .SECONDARY:
 .SUFFIXES:
 
@@ -46,6 +46,29 @@ endif
 #   Build system managament
 ###############################################################################
 #SELF=$(PROJ_SRC_ROOT)/Makefile.rules Makefile $(PROJ_SRC_ROOT)/Makefile.common
+RECURSIVE_TARGETS=all clean
+
+$(RECURSIVE_TARGETS)::
+	$(Verb) for f in $(DIRS); do \
+		$(MAKE) --no-print-directory -C $$f $@ PROF=$(PROF)/$$f || exit 1; \
+	done; exit 0;
+
+tidy:
+	$(Echo) Cleaning temporary files
+	$(Verb) find $(PROJ_OBJ_ROOT) -iname "*~" -exec rm -f {} \;
+
+clean::
+	$(Echo) "Cleaning compilation files"
+	$(Verb) rm -Rf $(BUILD_NAME)
+
+confclean: distclean
+	$(Echo) Cleaning configuration
+	$(Verb) rm -Rf $(PROJ_OBJ_ROOT)/Makefile.common
+	$(Verb) rm -Rf $(PROJ_OBJ_ROOT)/config.status $(PROJ_OBJ_ROOT)/config.log
+	$(Verb) rm -Rf $(PROJ_OBJ_ROOT)/autoconf/autom4te.cache $(PROJ_OBJ_ROOT)/autoconf/configure.bak
+
+%/.dir:
+	$(Verb) $(MKDIR) $(dir $@) && $(TOUCH) $@
 
 ###############################################################################
 #   Build directories
@@ -76,17 +99,6 @@ TOUCH=touch
 PREPARE_CODE=$(LIB_DIR)/prepare-code$(SHLIBEXT)
 VMJC=$(BIN_DIR)/vmjc$(EXEEXT)
 
-%/.dir:
-	$(Verb) $(MKDIR) $(dir $@) && $(TOUCH) $@
-
-clean::
-	$(Echo) "Cleaning compilation files"
-	$(Verb) $(RM) -Rf $(BUILD_DIR)
-
-distclean::
-	$(Echo) "Cleaning build files"
-	$(Verb) $(RM) -Rf $(BIN_DIR) $(LIB_DIR) $(INCDIR)
-
 ifeq ($(DEBUG),1)
   COMMON_CFLAGS+=-g
 endif
@@ -138,17 +150,14 @@ ifdef BUILD_FRAMETABLE
 BUILT_INC+=$(patsubst %,$(BUILD_DIR)/%,FrametablesExterns.inc FrametablesSymbols.inc)
 DEP_FRAMETABLES=$(patsubst %,$(LIB_DIR)/lib%.a,$(USE))
 
-$(BUILD_DIR)/FrametablesExterns.inc: $(DEP_FRAMETABLES) $(SELF) $(BUILD_DIR)/%
-	$(Echo) "Generate $(notdir $@)"
+$(BUILD_DIR)/FrametablesExterns.inc: $(DEP_FRAMETABLES) $(SELF) $(BUILD_DIR)/.dir
+	$(Echo) "Generating $(notdir $@)"
 	$(Verb) $(NM) $(DEP_FRAMETABLES) | grep __frametable | sed 's/\([a-f0-9]*\) \([a-zA-Z]*\) _*\([a-zA-Z0-9_]*\)/extern "C" CompiledFrames \3;/' > $@
 
-$(BUILD_DIR)/FrametablesSymbols.inc: $(DEP_FRAMETABLES) $(SELF) $(BUILD_DIR)/%
-	$(Echo) "Generate $(notdir $@)"
+$(BUILD_DIR)/FrametablesSymbols.inc: $(DEP_FRAMETABLES) $(SELF) $(BUILD_DIR)/.dir
+	$(Echo) "Generating $(notdir $@)"
 	$(Verb) $(NM) $(DEP_FRAMETABLES) | grep __frametable | sed 's/\([a-f0-9]*\) \([a-zA-Z]*\) _*\([a-zA-Z0-9_]*\)/\&\3,/' > $@
 
-clean-local::
-	-$(Verb) $(RM) -f FrametablesExterns.inc FrametablesSymbols.inc
-
 endif
 
 $(MODULE_A): $(OBJ_FILES) $(SELF) $(LIB_DIR)/.dir
@@ -185,7 +194,7 @@ all:: $(BUILD_DIR)/$(VMKIT_RUNTIME_OUT)
 BUILT_INC+=$(BUILD_DIR)/$(VMKIT_RUNTIME_OUT)
 
 $(BUILD_DIR)/$(VMKIT_RUNTIME_OUT): $(VMKIT_RUNTIME_IN) $(SELF) $(BUILD_DIR)/.dir
-	$(Echo) "Generating vmkit meta file '$@'"
+	$(Echo) "Generating '$@'"
 	$(Verb) cat $(VMKIT_RUNTIME_IN) | $(LLVMAS) -o - | $(LLC) -march=cpp -cppgen=contents -o $@
 
 endif
@@ -200,26 +209,6 @@ endif
 LLVMBuildTool   := $(LLVM_SRC_ROOT)/utils/llvm-build/llvm-build
 
 ###############################################################################
-# VMKIT_RUNTIME: Provide rules to build a .cpp file with LLVM instructions
-#                generating code matching the .ll files.
-###############################################################################
-
-ifdef VMKIT_RUNTIME
-
-.PRECIOUS: LLVMRuntime.inc
-
-LLVMRuntime.inc : $(LLVMAS) $(LLC) $(VMKIT_RUNTIME)
-	$(Echo) "**[7] Building LLVM runtime $(LLC_CPP_FLAGS)"
-	$(Verb) cat $(VMKIT_RUNTIME) | $(LLVMAS) -o - | $(LLC) -march=cpp -cppgen=contents -o $@
-
-all-local:: LLVMRuntime.inc
-
-clean-local::
-	$(Verb) $(RM) -f LLVMRuntime.inc
-
-endif
-
-###############################################################################
 # RUN_ANT: Provide rules to build MMTk into a .o file and inlining facilities.
 ###############################################################################
 
@@ -334,8 +323,6 @@ $(eval $(call define_compile_rule,.c,$(C
 
 ifneq ($(MAKECMDGOALS),tidy)
 ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),distclean)
 -include $(patsubst %.o, %.d, $(OBJ_FILES))
 endif
 endif
-endif

Modified: vmkit/trunk/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Makefile?rev=180401&r1=180400&r2=180401&view=diff
==============================================================================
--- vmkit/trunk/lib/Makefile (original)
+++ vmkit/trunk/lib/Makefile Thu Apr 25 12:06:10 2013
@@ -8,7 +8,7 @@
 ##===----------------------------------------------------------------------===##
 LEVEL = ..
 
-PARALLEL_DIRS = vmkit j3
+DIRS=vmkit j3
 
 include $(LEVEL)/Makefile.config
 

Modified: vmkit/trunk/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/Makefile?rev=180401&r1=180400&r2=180401&view=diff
==============================================================================
--- vmkit/trunk/tools/Makefile (original)
+++ vmkit/trunk/tools/Makefile Thu Apr 25 12:06:10 2013
@@ -10,7 +10,7 @@ LEVEL = ..
 
 include $(LEVEL)/Makefile.config
 
-PARALLEL_DIRS = j3 vmjc llcj
+DIRS=j3 vmjc llcj
 
 include $(LEVEL)/Makefile.common
 





More information about the vmkit-commits mailing list