Bug 664362 - Generate depfiles for host objects/programs/libraries. r=gps

This commit is contained in:
Mike Hommey 2013-10-22 13:40:27 +09:00
parent 6973036831
commit deafa81d69
9 changed files with 48 additions and 48 deletions

View File

@ -56,4 +56,3 @@ GARBAGE += dummy
endif
test.$(OBJ_SUFFIX): CFLAGS := -O0
host_elf.$(OBJ_SUFFIX) host_elfhack.$(OBJ_SUFFIX): elfxx.h

View File

@ -319,12 +319,12 @@ OBJS = $(strip $(_OBJS))
endif
HOST_COBJS = $(addprefix host_,$(HOST_CSRCS:.c=.$(OBJ_SUFFIX)))
HOST_CCOBJS = $(addprefix host_,$(patsubst %.cc,%.$(OBJ_SUFFIX),$(filter %.cc,$(HOST_CPPSRCS))))
HOST_CPPOBJS = $(addprefix host_,$(patsubst %.cpp,%.$(OBJ_SUFFIX),$(filter %.cpp,$(HOST_CPPSRCS))))
# HOST_CPPOBJS can have different extensions (eg: .cpp, .cc)
HOST_CPPOBJS = $(addprefix host_,$(addsuffix .$(OBJ_SUFFIX),$(basename $(HOST_CPPSRCS))))
HOST_CMOBJS = $(addprefix host_,$(HOST_CMSRCS:.m=.$(OBJ_SUFFIX)))
HOST_CMMOBJS = $(addprefix host_,$(HOST_CMMSRCS:.mm=.$(OBJ_SUFFIX)))
ifndef HOST_OBJS
_HOST_OBJS = $(HOST_COBJS) $(HOST_CCOBJS) $(HOST_CPPOBJS) $(HOST_CMOBJS) $(HOST_CMMOBJS)
_HOST_OBJS = $(HOST_COBJS) $(HOST_CPPOBJS) $(HOST_CMOBJS) $(HOST_CMMOBJS)
HOST_OBJS = $(strip $(_HOST_OBJS))
endif
@ -816,7 +816,7 @@ endif
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f "$(srcdir)/$@.manifest"; then \
@ -833,9 +833,9 @@ ifdef MSMANIFEST_TOOL
endif # MSVC with manifest tool
else
ifeq ($(HOST_CPP_PROG_LINK),1)
$(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif # HOST_CPP_PROG_LINK
endif
@ -872,12 +872,12 @@ endif
$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif
endif
@ -930,7 +930,7 @@ endif # OS/2
$(HOST_LIBRARY): $(HOST_OBJS) Makefile
$(REPORT_BUILD)
$(RM) $@
$(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS)
$(EXPAND_LIBS_EXEC) --extract -- $(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS)
$(HOST_RANLIB) $@
ifdef HAVE_DTRACE
@ -1016,27 +1016,24 @@ define src_objdep
$(basename $(notdir $1)).$(OBJ_SUFFIX): $1 $(call mkdir_deps,$(MDDEPDIR))
endef
$(foreach f,$(CSRCS) $(SSRCS) $(CPPSRCS) $(CMSRCS) $(CMMSRCS) $(ASFILES),$(eval $(call src_objdep,$(f))))
$(foreach f,$(HOST_CSRCS) $(HOST_CPPSRCS) $(HOST_CMSRCS) $(HOST_CMMSRCS),$(eval host_$(call src_objdep,$(f))))
$(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS)
# Rules for building native targets must come first because of the host_ prefix
$(HOST_COBJS): host_%.$(OBJ_SUFFIX): %.c
$(HOST_COBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CPPOBJS): host_%.$(OBJ_SUFFIX): %.cpp
$(HOST_CPPOBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CCOBJS): host_%.$(OBJ_SUFFIX): %.cc
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CMOBJS): host_%.$(OBJ_SUFFIX): %.m
$(HOST_CMOBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(HOST_CMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CMMOBJS): host_%.$(OBJ_SUFFIX): %.mm
$(HOST_CMMOBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)

View File

@ -8486,6 +8486,14 @@ COMPILE_CXXFLAGS=`echo \
$_DEPEND_CFLAGS \
$COMPILE_CXXFLAGS`
HOST_CFLAGS=`echo \
$HOST_CFLAGS \
$_DEPEND_CFLAGS`
HOST_CXXFLAGS=`echo \
$HOST_CXXFLAGS \
$_DEPEND_CFLAGS`
AC_SUBST(SYSTEM_LIBXUL)
AC_SUBST(MOZ_NATIVE_JPEG)
AC_SUBST(MOZ_NATIVE_PNG)

View File

@ -603,16 +603,11 @@ ifneq (,$(IMPORT_LIBRARY))
endif
$(MAKE) -C shell install
# Extra dependencies and rules for auto-generated headers
host_jskwgen.$(OBJ_SUFFIX): jsversion.h vm/Keywords.h
# Use CURDIR to avoid finding a jsautokw.h in the source tree (from a
# previous build?) via VPATH when we're building in a separate tree.
$(CURDIR)/jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX)
./host_jskwgen$(HOST_BIN_SUFFIX) $@
host_jsoplengen.$(OBJ_SUFFIX): jsopcode.tbl
# Use CURDIR to avoid finding a jsautooplen.h in the source tree (from
# a previous build?) via VPATH when we're building in a separate tree.
$(CURDIR)/jsautooplen.h: host_jsoplengen$(HOST_BIN_SUFFIX)

View File

@ -319,12 +319,12 @@ OBJS = $(strip $(_OBJS))
endif
HOST_COBJS = $(addprefix host_,$(HOST_CSRCS:.c=.$(OBJ_SUFFIX)))
HOST_CCOBJS = $(addprefix host_,$(patsubst %.cc,%.$(OBJ_SUFFIX),$(filter %.cc,$(HOST_CPPSRCS))))
HOST_CPPOBJS = $(addprefix host_,$(patsubst %.cpp,%.$(OBJ_SUFFIX),$(filter %.cpp,$(HOST_CPPSRCS))))
# HOST_CPPOBJS can have different extensions (eg: .cpp, .cc)
HOST_CPPOBJS = $(addprefix host_,$(addsuffix .$(OBJ_SUFFIX),$(basename $(HOST_CPPSRCS))))
HOST_CMOBJS = $(addprefix host_,$(HOST_CMSRCS:.m=.$(OBJ_SUFFIX)))
HOST_CMMOBJS = $(addprefix host_,$(HOST_CMMSRCS:.mm=.$(OBJ_SUFFIX)))
ifndef HOST_OBJS
_HOST_OBJS = $(HOST_COBJS) $(HOST_CCOBJS) $(HOST_CPPOBJS) $(HOST_CMOBJS) $(HOST_CMMOBJS)
_HOST_OBJS = $(HOST_COBJS) $(HOST_CPPOBJS) $(HOST_CMOBJS) $(HOST_CMMOBJS)
HOST_OBJS = $(strip $(_HOST_OBJS))
endif
@ -816,7 +816,7 @@ endif
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f "$(srcdir)/$@.manifest"; then \
@ -833,9 +833,9 @@ ifdef MSMANIFEST_TOOL
endif # MSVC with manifest tool
else
ifeq ($(HOST_CPP_PROG_LINK),1)
$(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif # HOST_CPP_PROG_LINK
endif
@ -872,12 +872,12 @@ endif
$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(EXPAND_LIBS_EXEC) --uselist -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif
endif
@ -930,7 +930,7 @@ endif # OS/2
$(HOST_LIBRARY): $(HOST_OBJS) Makefile
$(REPORT_BUILD)
$(RM) $@
$(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS)
$(EXPAND_LIBS_EXEC) --extract -- $(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS)
$(HOST_RANLIB) $@
ifdef HAVE_DTRACE
@ -1016,27 +1016,24 @@ define src_objdep
$(basename $(notdir $1)).$(OBJ_SUFFIX): $1 $(call mkdir_deps,$(MDDEPDIR))
endef
$(foreach f,$(CSRCS) $(SSRCS) $(CPPSRCS) $(CMSRCS) $(CMMSRCS) $(ASFILES),$(eval $(call src_objdep,$(f))))
$(foreach f,$(HOST_CSRCS) $(HOST_CPPSRCS) $(HOST_CMSRCS) $(HOST_CMMSRCS),$(eval host_$(call src_objdep,$(f))))
$(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS)
# Rules for building native targets must come first because of the host_ prefix
$(HOST_COBJS): host_%.$(OBJ_SUFFIX): %.c
$(HOST_COBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CPPOBJS): host_%.$(OBJ_SUFFIX): %.cpp
$(HOST_CPPOBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CCOBJS): host_%.$(OBJ_SUFFIX): %.cc
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CMOBJS): host_%.$(OBJ_SUFFIX): %.m
$(HOST_CMOBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CFLAGS) $(HOST_CMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)
$(HOST_CMMOBJS): host_%.$(OBJ_SUFFIX): %.mm
$(HOST_CMMOBJS):
$(REPORT_BUILD)
$(ELOG) $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(INCLUDES) $(NSPR_CFLAGS) $(_VPATH_SRCS)

View File

@ -3946,6 +3946,14 @@ COMPILE_CXXFLAGS=`echo \
$_DEPEND_CFLAGS \
$COMPILE_CXXFLAGS`
HOST_CFLAGS=`echo \
$HOST_CFLAGS \
$_DEPEND_CFLAGS`
HOST_CXXFLAGS=`echo \
$HOST_CXXFLAGS \
$_DEPEND_CFLAGS`
AC_SUBST(NSPR_CFLAGS)
AC_SUBST(NSPR_LIBS)
AC_SUBST(MOZ_NATIVE_NSPR)

View File

@ -237,10 +237,6 @@ include $(topsrcdir)/config/rules.mk
DEFINES += -DMOZILLA_INTERNAL_API
# FIXME: We don't seem to do auto-generated dependencies here.
host_ListCSSProperties.$(OBJ_SUFFIX): $(srcdir)/../nsCSSPropList.h
TestCSSPropertyLookup.$(OBJ_SUFFIX): $(srcdir)/../nsCSSProps.h $(srcdir)/../nsCSSKeywords.h
css_properties.js: host_ListCSSProperties$(HOST_BIN_SUFFIX) css_properties_like_longhand.js Makefile
$(RM) $@
./host_ListCSSProperties$(HOST_BIN_SUFFIX) > $@

View File

@ -40,4 +40,4 @@ LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/mozapps/update/updater
include $(topsrcdir)/config/rules.mk
HOST_CXXFLAGS += $(MOZ_BZ2_CFLAGS)</textarea>
HOST_CXXFLAGS += $(MOZ_BZ2_CFLAGS)

View File

@ -10,7 +10,7 @@ endif
# This code is only compiled for build-time tools,
# so enabling RTTI should be fine.
HOST_CXXFLAGS := -funsigned-char $(filter-out -fno-rtti,$(HOST_CXXFLAGS))
HOST_CXXFLAGS += -funsigned-char -frtti
# need static lib
FORCE_STATIC_LIB = 1