Add --disable-auto-deps option which causes the build system to not automatically generate dependencies on the fly. Also, fixes VPATH problem with non gcc-MD separate build phase |make depend|.

Bug #66529 r=pavlov
This commit is contained in:
cls%seawood.org 2001-05-22 07:52:30 +00:00
Родитель 6a43f38dea
Коммит 34b7986e37
8 изменённых файлов: 82 добавлений и 28 удалений

Просмотреть файл

@ -312,6 +312,7 @@ MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@
# Used for LD_LIBRARY_PATH
LIBS_PATH = @LIBS_PATH@
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@
COMPILER_DEPEND = @COMPILER_DEPEND@
MDDEPDIR := @MDDEPDIR@

Просмотреть файл

@ -434,8 +434,6 @@ endif
endif
endif
MKDEPENDENCIES = depend.mk
endif
#

Просмотреть файл

@ -194,6 +194,12 @@ LIBOBJS := $(addprefix \", $(OBJS))
LIBOBJS := $(addsuffix \", $(LIBOBJS))
endif
ifndef MOZ_AUTO_DEPS
ifneq (,$(OBJS))
MDDEPFILES = $(addprefix $(MDDEPDIR)/,$(OBJS:.$(OBJ_SUFFIX)=.pp))
endif
endif
ifndef PACKAGE
PACKAGE = .
endif
@ -416,7 +422,7 @@ endif
all:: export install
# Do depend as well
alldep:: export install
alldep:: export depend install
# Do everything from scratch
everything:: clean alldep
@ -799,29 +805,31 @@ $(DLL): $(OBJS) $(EXTRA_LIBS)
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
endif
ifdef MOZ_AUTO_DEPS
ifndef COMPILER_DEPEND
#
# Generate dependencies on the fly
#
MDDEPFILE = $(MDDEPDIR)/$(<F).pp
_MDDEPFILE = $(MDDEPDIR)/$(<F).pp
define MAKE_DEPS
define MAKE_DEPS_AUTO
if test -d $(@D); then \
set -e ; \
touch $(MDDEPFILE) && \
$(MKDEPEND) -o'.o' -f$(MDDEPFILE) $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
mv $(MDDEPFILE) $(MDDEPFILE).old && \
cat $(MDDEPFILE).old | sed -e "s|^$(<D)/||g" > $(MDDEPFILE) && rm -f $(MDDEPFILE).old ; \
echo "Rebuilding deps for $<"; \
touch $(_MDDEPFILE) && \
$(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f$(_MDDEPFILE) $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
mv $(_MDDEPFILE) $(_MDDEPFILE).old && \
cat $(_MDDEPFILE).old | sed -e "s|^$(<D)/||g" > $(_MDDEPFILE) && rm -f $(_MDDEPFILE).old ; \
echo "Building deps for $<"; \
fi
# | sed -e 's%\($*\)\.o[ :]*%\1.o $(MDDEPFILE) : %g'
endef
endif # !COMPILER_DEPEND
endif # MOZ_AUTO_DEPS
%: %.c Makefile.in
$(REPORT_BUILD)
@$(MAKE_DEPS)
@$(MAKE_DEPS_AUTO)
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(ELOG) $(CC) -Fo$@ -c $(CFLAGS) $<
else
@ -830,7 +838,7 @@ endif
%.o: %.c Makefile.in
$(REPORT_BUILD)
@$(MAKE_DEPS)
@$(MAKE_DEPS_AUTO)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(ELOG) $(CC) -Fo$@ -c $(COMPILE_CFLAGS) $<
else
@ -853,7 +861,7 @@ moc_%.cpp: %.h Makefile.in
$(AS) -o $@ $(ASFLAGS) -c $<
%: %.cpp Makefile.in
@$(MAKE_DEPS)
@$(MAKE_DEPS_AUTO)
$(CCC) -o $@ $(CXXFLAGS) $< $(LDFLAGS)
#
@ -861,12 +869,12 @@ moc_%.cpp: %.h Makefile.in
#
%.o: %.cc Makefile.in
$(REPORT_BUILD)
@$(MAKE_DEPS)
@$(MAKE_DEPS_AUTO)
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $<
%.o: %.cpp Makefile.in
$(REPORT_BUILD)
@$(MAKE_DEPS)
@$(MAKE_DEPS_AUTO)
ifdef STRICT_CPLUSPLUS_SUFFIX
echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc
@ -1262,7 +1270,7 @@ endif
endif
#############################################################################
# X dependency system
# Dependency system
#############################################################################
ifdef COMPILER_DEPEND
depend::
@ -1271,7 +1279,7 @@ depend::
ifeq ($(GNU_CC)$(GNU_CXX),)
# Non-GNU compilers
@echo "`echo '$(MAKE):'|sed 's/./ /g'`"\
'(Compiler-based depend was turned on by "--enable-depend".)' 1>&2
'(Compiler-based depend was turned on by "--enable-md".)' 1>&2
else
# GNU compilers
@space="`echo '$(MAKE): '|sed 's/./ /g'`";\
@ -1279,7 +1287,8 @@ else
it is on by default.' 1>&2; \
echo "$$space"'To turn it off, pass --disable-md to configure.' 1>&2
endif
else
else # ! COMPILER_DEPEND
ifndef MOZ_NATIVE_MAKEDEPEND
$(MKDEPEND_BUILTIN):
@ -1287,7 +1296,36 @@ $(MKDEPEND_BUILTIN):
$(MAKE) -C $(MKDEPEND_DIR) mkdepend
endif
endif # ! COMPILER_DEPEND
ifndef MOZ_AUTO_DEPS
define MAKE_DEPS_NOAUTO
set -e ; \
touch $@ && \
$(MKDEPEND) -o'.$(OBJ_SUFFIX)' -f$@ $(DEFINES) $(ACDEFINES) $(INCLUDES) $< >/dev/null 2>&1 && \
mv $@ $@.old && cat $@.old | sed "s|^$(<D)/||g" > $@ && rm -f $@.old
endef
$(MDDEPDIR)/%.pp: %.c
$(MAKE_DEPS_NOAUTO)
$(MDDEPDIR)/%.pp: %.cpp
$(MAKE_DEPS_NOAUTO)
ifneq (,$(OBJS))
depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MKDEPEND_BUILTIN) $(MDDEPFILES)
else
depend:: $(SUBMAKEFILES)
endif
+$(LOOP_OVER_DIRS)
dependclean:: $(SUBMAKEFILES)
rm -f $(MDDEPFILES)
+$(LOOP_OVER_DIRS)
endif # MOZ_AUTO_DEPS
endif # COMPILER_DEPEND
#############################################################################
# MDDEPDIR is the subdirectory where all the dependency files are placed.

Просмотреть файл

@ -3495,7 +3495,14 @@ if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
fi
dnl ========================================================
dnl Determine how to handle dependencies
dnl ========================================================
MOZ_AUTO_DEPS=1
MOZ_ARG_DISABLE_BOOL(auto-deps,
[ --disable-auto-deps Do not automatically generate dependency info],
MOZ_AUTO_DEPS=)
if test -n "$MOZ_AUTO_DEPS"; then
_cpp_md_flag=
MOZ_ARG_DISABLE_BOOL(md,
[ --disable-md Do not use compiler-based dependencies ],
@ -3509,10 +3516,13 @@ if test "$_cpp_md_flag"; then
COMPILER_DEPEND=1
_DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(*F).pp)'
fi
fi # MOZ_AUTO_DEPS
MDDEPDIR='.deps'
AC_SUBST(MOZ_AUTO_DEPS)
AC_SUBST(COMPILER_DEPEND)
AC_SUBST(MDDEPDIR)
MOZ_ARG_DISABLE_BOOL(pedantic,
[ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
_PEDANTIC= )

Просмотреть файл

@ -35,7 +35,7 @@ IS_COMPONENT = 1
CPPSRCS = XSLTProcessorModule.cpp
OBJS =../source/base/ArrayList.o \
LOBJS =../source/base/ArrayList.o \
../source/base/DefaultStringComparator.o \
../source/base/Double.o \
../source/base/Integer.o \
@ -123,7 +123,7 @@ OBJS =../source/base/ArrayList.o \
../source/xslt/functions/SystemPropertyFunctionCall.o \
../source/xslt/util/NodeSorter.o \
../source/xslt/util/NodeStack.o \
XSLTProcessorModule.o
$(NULL)
EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \

Просмотреть файл

@ -55,7 +55,9 @@ include $(topsrcdir)/config/rules.mk
DEFINES += -DSTANDALONE
# Make sure that these custom rules stay in sync with rules.mk
S_%.$(OBJ_SUFFIX): $(srcdir)/../%.cpp
S_%.$(OBJ_SUFFIX): %.cpp
$(REPORT_BUILD)
@$(MAKE_DEPS_AUTO)
ifdef STRICT_CPLUSPLUS_SUFFIX
echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc
@ -68,4 +70,5 @@ else
endif
endif #STRICT_CPLUSPLUS_SUFFIX
$(MDDEPDIR)/S_%.pp: %.cpp
$(MAKE_DEPS_NOAUTO)

Просмотреть файл

@ -47,13 +47,14 @@ include $(topsrcdir)/config/rules.mk
DEFINES += -DSTANDALONE_REGISTRY
# Make sure that these custom rules stay in sync with rules.mk
S_%.$(OBJ_SUFFIX): $(srcdir)/../src/%.c
S_%.$(OBJ_SUFFIX): %.c
$(REPORT_BUILD)
@$(MAKE_DEPS)
@$(MAKE_DEPS_AUTO)
ifeq ($(MOZ_OS2_TOOLS), VACPP)
$(ELOG) $(CC) -Fo$@ -c $(COMPILE_CFLAGS) $<
else
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $<
endif
$(MDDEPDIR)/S_%.pp: %.c
$(MAKE_DEPS_NOAUTO)

Просмотреть файл

@ -50,11 +50,14 @@ GARBAGE_DIRS += .deps
include $(topsrcdir)/config/rules.mk
# Make sure that these custom rules stay in sync with rules.mk
S_%.$(OBJ_SUFFIX): $(srcdir)/../src/%.c
S_%.$(OBJ_SUFFIX): %.c
$(REPORT_BUILD)
@$(MAKE_DEPS)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(ELOG) $(CC) -Fo$@ -c $(COMPILE_CFLAGS) $<
else
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $<
endif
$(MDDEPDIR)/S_%.pp: %.c
$(MAKE_DEPS_NOAUTO)