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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10211
91177308-0d34-0410-b5e6-
96231b3b80d8
ifdef DIRS
all install clean test bytecode ::
$(VERB) for dir in ${DIRS}; do \
ifdef DIRS
all install clean test bytecode ::
$(VERB) for dir in ${DIRS}; do \
if [ ! -f $$dir/Makefile ]; \
then \
if [ ! -f $$dir/Makefile ]; \
then \
cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
fi; \
($(MAKE) -C $$dir $@) || exit 1; \
cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
fi; \
($(MAKE) -C $$dir $@) || exit 1; \
bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))
%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
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
endif
# Handle directories that may or may not exist
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $(SourceDir)/$$dir ]; \
then\
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $(SourceDir)/$$dir ]; \
then\
if [ ! -f $$dir/Makefile ]; \
then \
if [ ! -f $$dir/Makefile ]; \
then \
cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
fi; \
($(MAKE) -C$$dir $@) || exit 1; \
cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
fi; \
($(MAKE) -C$$dir $@) || exit 1; \
# build tree.
Makefile :: $(BUILD_SRC_DIR)/Makefile
@${ECHO} "===== Updating Makefile from source dir: `dirname $<` ====="
# build tree.
Makefile :: $(BUILD_SRC_DIR)/Makefile
@${ECHO} "===== Updating Makefile from source dir: `dirname $<` ====="