[llvm-commits] CVS: llvm/Makefile.rules

John Criswell criswell at cs.uiuc.edu
Tue Nov 25 13:33:02 PST 2003


Changes in directory llvm:

Makefile.rules updated: 1.160 -> 1.161

---
Log message:

All directory targets now install the Makefile only if it is missing.
Directory targets no longer check for existance of the directory in the
object tree; if the Makefile doesn't exist, we will re-create the directory.
This seems to be a pretty good assumption and saves us from checking
directory existance each time.



---
Diffs of the changes:  (+9 -3)

Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.160 llvm/Makefile.rules:1.161
--- llvm/Makefile.rules:1.160	Tue Nov 25 11:49:21 2003
+++ llvm/Makefile.rules	Tue Nov 25 13:32:22 2003
@@ -395,9 +395,9 @@
 ifdef DIRS
 all install clean test bytecode ::
 	$(VERB) for dir in ${DIRS}; do \
-		$(MKDIR) $$dir; \
 		if [ ! -f $$dir/Makefile ]; \
 		then \
+			$(MKDIR) $$dir; \
 			cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
 		fi; \
 		($(MAKE) -C $$dir $@) || exit 1; \
@@ -413,7 +413,12 @@
 bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))
 
 %/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
-	$(VERB) $(MKDIR) $(@D); cp $(SourceDir)/$(@D)/Makefile $(@D); $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
+	$(VERB) if [ ! -f $(@D)/Makefile ]; \
+	then \
+		$(MKDIR) $(@D); \
+		cp $(SourceDir)/$(@D)/Makefile $(@D)/Makefile; \
+	fi; \
+	$(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
 endif
 
 # Handle directories that may or may not exist
@@ -422,9 +427,9 @@
 	$(VERB) for dir in ${OPTIONAL_DIRS}; do \
 		if [ -d $(SourceDir)/$$dir ]; \
 		then\
-			$(MKDIR) $$dir; \
 			if [ ! -f $$dir/Makefile ]; \
 			then \
+				$(MKDIR) $$dir; \
 				cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
 			fi; \
 			($(MAKE) -C$$dir $@) || exit 1; \
@@ -830,6 +835,7 @@
 # build tree.
 Makefile :: $(BUILD_SRC_DIR)/Makefile
 	@${ECHO} "===== Updating Makefile from source dir: `dirname $<` ====="
+	$(MKDIR) $(@D)
 	cp -f $< $@
 
 #





More information about the llvm-commits mailing list