From 6057760793503f1c1e9387402f287a9f849fc57d Mon Sep 17 00:00:00 2001 From: John Criswell Date: Tue, 25 Nov 2003 17:49:22 +0000 Subject: Added a pseudo-hack: The Makefile now copies Makefiles from source tree to object tree if it is missing. This means that new Makefiles should get picked up automagically, requiring less bothersome re-configuring after updates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10209 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.rules | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Makefile.rules') diff --git a/Makefile.rules b/Makefile.rules index a3b57e1110..380910818a 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -395,6 +395,11 @@ RObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RObjs)) ifdef DIRS all install clean test bytecode :: $(VERB) for dir in ${DIRS}; do \ + $(MKDIR) $$dir; \ + if [ ! -f $$dir/Makefile ]; \ + then \ + cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \ + fi; \ ($(MAKE) -C $$dir $@) || exit 1; \ done endif @@ -408,15 +413,20 @@ test :: $(addsuffix /.maketest , $(PARALLEL_DIRS)) bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS)) %/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode: - $(VERB) $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) + $(VERB) $(MKDIR) $(@D); cp $(SourceDir)/$(@D)/Makefile $(@D); $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) endif # Handle directories that may or may not exist ifdef OPTIONAL_DIRS all install clean test bytecode :: $(VERB) for dir in ${OPTIONAL_DIRS}; do \ - if [ -d $$dir ]; \ + if [ -d $(SourceDir)/$$dir ]; \ then\ + $(MKDIR) $$dir; \ + if [ ! -f $$dir/Makefile ]; \ + then \ + cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \ + fi; \ ($(MAKE) -C$$dir $@) || exit 1; \ fi \ done -- cgit v1.2.3