check in new .deps based dependancy system

This commit is contained in:
alecf%netscape.com 1999-02-19 03:06:32 +00:00
Родитель b69653a62b
Коммит 1c53ab90ae
3 изменённых файлов: 50 добавлений и 24 удалений

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

@ -153,6 +153,8 @@ TK_LIBS = @TK_LIBS@
MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@ MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@
COMPILER_DEPEND = @COMPILER_DEPEND@
# XXX - these need to be cleaned up and have real checks added -cls # XXX - these need to be cleaned up and have real checks added -cls
NGLAYOUT_PLUGINS=1 NGLAYOUT_PLUGINS=1
CM_BLDTYPE=dbg CM_BLDTYPE=dbg

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

@ -97,42 +97,44 @@ endif
ifndef LIBRARY ifndef LIBRARY
ifdef LIBRARY_NAME ifdef LIBRARY_NAME
LIBRARY := lib$(LIBRARY_NAME).$(LIB_SUFFIX) LIBRARY := lib$(LIBRARY_NAME).$(LIB_SUFFIX)
endif endif # LIBRARY_NAME
endif endif # LIBRARY
ifdef LIBRARY ifdef LIBRARY
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
ifndef DEF_FILE ifndef DEF_FILE
DEF_FILE := $(LIBRARY:.lib=.def) DEF_FILE := $(LIBRARY:.lib=.def)
endif endif # DEF_FILE
endif endif # LIBRARY
LIBRARY := $(addprefix $(OBJDIR)/, $(LIBRARY)) LIBRARY := $(addprefix $(OBJDIR)/, $(LIBRARY))
ifndef NO_SHARED_LIB ifndef NO_SHARED_LIB
ifdef MKSHLIB ifdef MKSHLIB
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
SHARED_LIBRARY := $(LIBRARY:.lib=.dll) SHARED_LIBRARY := $(LIBRARY:.lib=.dll)
MAPS := $(LIBRARY:.lib=.map) MAPS := $(LIBRARY:.lib=.map)
else else # OS2
ifeq ($(OS_ARCH),WINNT) ifeq ($(OS_ARCH),WINNT)
SHARED_LIBRARY := $(LIBRARY:.lib=.dll) SHARED_LIBRARY := $(LIBRARY:.lib=.dll)
else else # WINNT
ifeq ($(OS_ARCH),HP-UX) ifeq ($(OS_ARCH),HP-UX)
SHARED_LIBRARY := $(LIBRARY:.a=.sl) SHARED_LIBRARY := $(LIBRARY:.a=.sl)
else else # HPUX
ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1) ifeq ($(OS_ARCH)$(OS_RELEASE),SunOS4.1)
SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0) SHARED_LIBRARY := $(LIBRARY:.a=.so.1.0)
else else # SunOS4
ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1) ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
SHARED_LIBRARY := $(LIBRARY:.a=)_shr.a SHARED_LIBRARY := $(LIBRARY:.a=)_shr.a
else else # AIX
SHARED_LIBRARY := $(LIBRARY:.a=.$(DLL_SUFFIX)) SHARED_LIBRARY := $(LIBRARY:.a=.$(DLL_SUFFIX))
endif endif # AIX
endif endif # SunOS4
endif endif # HPUX
endif endif # WINNT
endif endif # OS2
endif endif # MKSHLIB
endif endif # !NO_SHARED_LIB
endif endif
ifdef NO_STATIC_LIB ifdef NO_STATIC_LIB
@ -158,14 +160,19 @@ ifdef DLL
DLL := $(addprefix $(OBJDIR)/, $(DLL)) DLL := $(addprefix $(OBJDIR)/, $(DLL))
ifeq ($(OS_ARCH),WINNT) ifeq ($(OS_ARCH),WINNT)
LIB := $(addprefix $(OBJDIR)/, $(LIB)) LIB := $(addprefix $(OBJDIR)/, $(LIB))
endif endif # WINNT
endif endif # DLL
MAKE_OBJDIR = mkdir $(OBJDIR) MAKE_OBJDIR = mkdir $(OBJDIR)
else MAKE_DEPDIR = mkdir $(OBJDIR)/.deps
else # OS2, WINNT
define MAKE_OBJDIR define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); else true; fi if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); else true; fi
endef endef
endif ifdef COMPILER_DEPEND
define MAKE_DEPDIR
if test ! -d $(@D)/.deps; then rm -rf $(@D)/.deps; mkdir $(@D)/.deps; else true; fi
endef
endif # OS2, WINNT
ifndef OS2_IMPLIB ifndef OS2_IMPLIB
LIBOBJS := $(addprefix \", $(OBJS)) LIBOBJS := $(addprefix \", $(OBJS))
@ -389,6 +396,7 @@ endif
# #
$(PROGRAM): $(PROGOBJS) $(PROGRAM): $(PROGOBJS)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
$(LINK) -FREE -OUT:$@ $(LDFLAGS) $(OS_LFLAGS) $(PROGOBJS) $(EXTRA_LIBS) -MAP:$(@:.exe=.map) $(OS_LIBS) $(DEF_FILE) $(LINK) -FREE -OUT:$@ $(LDFLAGS) $(OS_LFLAGS) $(PROGOBJS) $(EXTRA_LIBS) -MAP:$(@:.exe=.map) $(OS_LIBS) $(DEF_FILE)
else else
@ -414,6 +422,7 @@ endif
# #
$(SIMPLE_PROGRAMS):$(OBJDIR)/%: $(OBJDIR)/%.o $(SIMPLE_PROGRAMS):$(OBJDIR)/%: $(OBJDIR)/%.o
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
ifeq ($(CPP_PROG_LINK),1) ifeq ($(CPP_PROG_LINK),1)
$(CCC) $(CFLAGS) $(WRAP_MALLOC_CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(CCC) $(CFLAGS) $(WRAP_MALLOC_CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB)
else else
@ -436,6 +445,7 @@ endif
ifneq ($(OS_ARCH),OS2) ifneq ($(OS_ARCH),OS2)
$(LIBRARY): $(OBJS) $(LOBJS) $(LIBRARY): $(OBJS) $(LOBJS)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
rm -f $@ rm -f $@
$(AR) $(OBJS) $(LOBJS) $(AR) $(OBJS) $(LOBJS)
$(RANLIB) $@ $(RANLIB) $@
@ -443,12 +453,14 @@ else
ifdef OS2_IMPLIB ifdef OS2_IMPLIB
$(LIBRARY): $(OBJS) $(DEF_FILE) $(LIBRARY): $(OBJS) $(DEF_FILE)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
rm -f $@ rm -f $@
$(IMPLIB) $@ $(DEF_FILE) $(IMPLIB) $@ $(DEF_FILE)
$(RANLIB) $@ $(RANLIB) $@
else else
$(LIBRARY): $(OBJS) $(LIBRARY): $(OBJS)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
rm -f $@ rm -f $@
$(AR) $(LIBOBJS),, $(AR) $(LIBOBJS),,
$(RANLIB) $@ $(RANLIB) $@
@ -458,12 +470,14 @@ endif
ifneq ($(OS_ARCH),OS2) ifneq ($(OS_ARCH),OS2)
$(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(SHARED_LIBRARY): $(OBJS) $(LOBJS)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
rm -f $@ rm -f $@
$(MKSHLIB) -o $@ $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) $(MKSHLIB) -o $@ $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS)
chmod +x $@ chmod +x $@
else else
$(SHARED_LIBRARY): $(OBJS) $(DEF_FILE) $(SHARED_LIBRARY): $(OBJS) $(DEF_FILE)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
rm -f $@ rm -f $@
$(LINK_DLL) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(LINK_DLL) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
chmod +x $@ chmod +x $@
@ -472,6 +486,7 @@ endif
ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
$(DLL): $(OBJS) $(EXTRA_LIBS) $(DLL): $(OBJS) $(EXTRA_LIBS)
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
rm -f $@ rm -f $@
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
$(LINK_DLL) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(LINK_DLL) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
@ -482,6 +497,7 @@ endif
$(OBJDIR)/%: %.c $(OBJDIR)/%: %.c
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
$(CC) -Fo$@ -c $(CFLAGS) $< $(CC) -Fo$@ -c $(CFLAGS) $<
else else
@ -490,6 +506,7 @@ endif
$(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: %.c
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
$(CC) -Fo$@ -c $(CFLAGS) $< $(CC) -Fo$@ -c $(CFLAGS) $<
else else
@ -498,14 +515,17 @@ endif
$(OBJDIR)/%.o: %.s $(OBJDIR)/%.o: %.s
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
$(AS) -o $@ $(ASFLAGS) -c $< $(AS) -o $@ $(ASFLAGS) -c $<
$(OBJDIR)/%.o: %.S $(OBJDIR)/%.o: %.S
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
$(AS) -o $@ $(ASFLAGS) -c $< $(AS) -o $@ $(ASFLAGS) -c $<
$(OBJDIR)/%: %.cpp $(OBJDIR)/%: %.cpp
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
$(CCC) -o $@ $(CFLAGS) $< $(LDFLAGS) $(CCC) -o $@ $(CFLAGS) $< $(LDFLAGS)
# #
@ -517,6 +537,7 @@ $(OBJDIR)/%.o: %.cc
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/%.o: %.cpp
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
ifdef STRICT_CPLUSPLUS_SUFFIX ifdef STRICT_CPLUSPLUS_SUFFIX
echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > $(OBJDIR)/t_$*.cc echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > $(OBJDIR)/t_$*.cc
$(CCC) -o $@ -c $(CFLAGS) $(OBJDIR)/t_$*.cc $(CCC) -o $@ -c $(CFLAGS) $(OBJDIR)/t_$*.cc
@ -788,6 +809,7 @@ $(JMC_GEN_DIR)/M%.c: $(JMCSRCDIR)/%.class
$(OBJDIR)/M%.o: $(JMC_GEN_DIR)/M%.h $(JMC_GEN_DIR)/M%.c $(OBJDIR)/M%.o: $(JMC_GEN_DIR)/M%.h $(JMC_GEN_DIR)/M%.c
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
@$(MAKE_DEPDIR)
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
$(CC) -Fo$@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c $(CC) -Fo$@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c
else else
@ -872,8 +894,6 @@ endif
# X dependency system # X dependency system
############################################################################# #############################################################################
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
$(MKDEPENDENCIES):: $(MKDEPENDENCIES)::
@$(MAKE_OBJDIR) @$(MAKE_OBJDIR)
touch $(MKDEPENDENCIES) touch $(MKDEPENDENCIES)
@ -925,7 +945,8 @@ endif
############################################################################# #############################################################################
# Yet another depend system: -MD # Yet another depend system: -MD
MDDEPENDENCIES := $(OBJS:.o=.d)
MDDEPENDENCIES := $(addprefix $(OBJDIR)/.deps/,$(OBJS:.o=.pp))
ifdef MDDEPENDENCIES ifdef MDDEPENDENCIES
-include $(MDDEPENDENCIES) -include $(MDDEPENDENCIES)

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

@ -651,7 +651,9 @@ MOZ_ARG_WITH_STRING(wrap-malloc,
MOZ_ARG_ENABLE_BOOL(md, MOZ_ARG_ENABLE_BOOL(md,
[ --enable-md use compiler-based dependencies ], [ --enable-md use compiler-based dependencies ],
DEPEND_CFLAGS="-MMD") [ COMPILER_DEPEND=1
DEPEND_CFLAGS='-Wp,-MMD,.deps/$(*F).pp' ]
)
AC_SUBST(MOZ_TOOLKIT) AC_SUBST(MOZ_TOOLKIT)
AC_SUBST(MOZ_UPDATE_XTERM) AC_SUBST(MOZ_UPDATE_XTERM)
@ -683,6 +685,7 @@ AC_SUBST(MOZ_MAIL_COMPOSE)
AC_SUBST(FULL_STATIC_BUILD) AC_SUBST(FULL_STATIC_BUILD)
AC_SUBST(NO_UNIX_LDAP) AC_SUBST(NO_UNIX_LDAP)
AC_SUBST(MOZ_IDL_TOOL) AC_SUBST(MOZ_IDL_TOOL)
AC_SUBST(COMPILER_DEPEND)
dnl Checks for X libraries. dnl Checks for X libraries.