* configure.ac (AUTODEPEND_PARENTS): New var.
mkdir the dependency directories here, to simplify ‘make’.
Remove dependency files just before outputting Makefiles, so that
they are preserved if ‘configure’ exits early due to some other problem.
* lib/Makefile.in, lwlib/Makefile.in, oldXMenu/Makefile.in:
* src/Makefile.in: Adjust deps strategies to be similar, as follows:
(MKDEPDIR): Remove. All uses removed. This cuts down on the
number of processes spun off by ‘make’.
(clean mostlyclean): Remove $(DEPDIR) contents, not $(DEPDIR) itself.
(distclean): Remove $(DEPDIR) itself.
* lwlib/Makefile.in (all): Move to front, so that depdir includes
do not alter default action.
dnl check for Make feature
AUTO_DEPEND=no
+AUTODEPEND_PARENTS='lib src'
dnl check if we have GCC and autodepend is on.
if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
AC_MSG_CHECKING([whether gcc understands -MMD -MF])
AC_MSG_RESULT([$ac_enable_autodepend])
if test $ac_enable_autodepend = yes; then
AUTO_DEPEND=yes
- for depdir in */deps; do
- test ! -d "$depdir" || rm -fr "$depdir"/../*.o "$depdir" || exit
- done
fi
fi
AC_SUBST(AUTO_DEPEND)
LIBXMENU=
elif test "$USE_X_TOOLKIT" = none; then
LIBXMENU='$(oldXMenudir)/libXMenu11.a'
+ AUTODEPEND_PARENTS="$AUTODEPEND_PARENTS oldXMenu"
else
LIBXMENU='$(lwlibdir)/liblw.a'
+ AUTODEPEND_PARENTS="$AUTODEPEND_PARENTS lwlib"
fi
AC_SUBST(LIBXMENU)
AC_MSG_ERROR(['etc/refcards/emacsver.tex' could not be made.])
])
+if test $AUTO_DEPEND = yes; then
+ for dir in $AUTODEPEND_PARENTS; do
+ rm -f $dir/*.o $dir/deps/*
+ AS_MKDIR_P([$dir/deps])
+ done
+fi
+
AC_OUTPUT
if test ! "$with_mailutils"; then
libgnu_a_SOURCES += openat-die.c save-cwd.c
endif
-# Dependencies. When !AUTO_DEPEND, don't bother with a dependencies file,
-# as the default dependencies are often adequate.
DEPDIR = deps
ifeq ($(AUTO_DEPEND),yes)
DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP
- MKDEPDIR = $(MKDIR_P) $(DEPDIR)
-include $(ALLOBJS:%.o=$(DEPDIR)/%.d)
else
DEPFLAGS =
- MKDEPDIR = :
endif
.PRECIOUS: ../config.status Makefile
$(libegnu_a_OBJECTS) $(libgnu_a_OBJECTS): $(BUILT_SOURCES)
.c.o:
- @$(MKDEPDIR)
$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
e-%.o: %.c
- @$(MKDEPDIR)
$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -Demacs -o $@ $<
all: libgnu.a $(if $(HYBRID_MALLOC),libegnu.a)
.PHONY: $(ETAGS) tags
clean mostlyclean:
- rm -f *.[ao] \#*
- -rm -rf $(DEPDIR)
+ rm -f *.[ao] \#* $(DEPDIR)/*
distclean: clean
rm -f Makefile $(BUILT_SOURCES)
+ rm -fr $(DEPDIR)
bootstrap-clean: distclean
rm -f TAGS
maintainer-clean: bootstrap-clean
# This was taken from the output of Imake using Lucid's Imakefile.
# and set up to be configured by ../configure.
+all: liblw.a
+.PHONY: all
+
srcdir=@srcdir@
# MinGW CPPFLAGS may use this.
abs_top_srcdir=@abs_top_srcdir@
am__v_at_0 = @
am__v_at_1 =
-DEPDIR = deps
AUTO_DEPEND = @AUTO_DEPEND@
-
+DEPDIR = deps
ifeq ($(AUTO_DEPEND),yes)
-DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP
-MKDEPDIR = ${MKDIR_P} ${DEPDIR}
+ DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP
+ -include $(ALLOBJS:%.o=$(DEPDIR)/%.d)
else
-DEPFLAGS =
-MKDEPDIR = :
+ DEPFLAGS =
+ include $(srcdir)/deps.mk
endif
## ../src is where the generated file (config.h, globals.h) are.
-Demacs -I../src \
-I$(srcdir) -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib
-all: liblw.a
-.PHONY: all
-
.c.o:
- @$(MKDEPDIR)
$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
liblw.a: $(OBJS)
$(globals_h):
$(MAKE) -C ../src globals.h
-ifeq ($(AUTO_DEPEND),yes)
--include $(ALLOBJS:%.o=${DEPDIR}/%.d)
-else
-include $(srcdir)/deps.mk
-endif
-
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
clean mostlyclean:
- rm -f *.o liblw.a \#*
- -rm -rf ${DEPDIR}
+ rm -f *.o liblw.a \#* $(DEPDIR)/*
distclean: clean
rm -f Makefile
+ rm -fr $(DEPDIR)
bootstrap-clean maintainer-clean: distclean
rm -f TAGS
am__v_at_0 = @
am__v_at_1 =
-DEPDIR = deps
AUTO_DEPEND = @AUTO_DEPEND@
-
+DEPDIR = deps
ifeq ($(AUTO_DEPEND),yes)
-DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP
-MKDEPDIR = ${MKDIR_P} ${DEPDIR}
+ DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP
+ -include $(ALLOBJS:%.o=$(DEPDIR)/%.d)
else
-DEPFLAGS =
-MKDEPDIR = :
+ DEPFLAGS =
+ include $(srcdir)/deps.mk
endif
ALL_CFLAGS=$(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
-I../src -I../lib -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
.c.o:
- @$(MKDEPDIR)
$(AM_V_CC)$(CC) -c ${ALL_CFLAGS} $<
libXMenu11.a: $(OBJS) $(EXTRA)
$(AM_V_at)$(AR) $(ARFLAGS) $@ $(OBJS) $(EXTRA)
$(AM_V_at)$(RANLIB) $@
-ifeq ($(AUTO_DEPEND),yes)
--include $(ALLOBJS:%.o=${DEPDIR}/%.d)
-else
-include $(srcdir)/deps.mk
-endif
-
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
clean mostlyclean:
- rm -f libXMenu11.a *.o
- -rm -rf ${DEPDIR}
+ rm -f libXMenu11.a *.o $(DEPDIR)/*
bootstrap-clean maintainer-clean distclean: clean
rm -f Makefile
+ rm -fr $(DEPDIR)
ETAGS = ../lib-src/etags${EXEEXT}
am__v_at_0 = @
am__v_at_1 =
-DEPDIR=deps
AUTO_DEPEND = @AUTO_DEPEND@
-
+DEPDIR = deps
ifeq ($(AUTO_DEPEND),yes)
-DEPFLAGS = -MMD -MF ${DEPDIR}/$*.d -MP
-MKDEPDIR = ${MKDIR_P} ${DEPDIR}
+ DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP
+ -include $(ALLOBJS:%.o=$(DEPDIR)/%.d)
else
-DEPFLAGS =
-MKDEPDIR = :
+ DEPFLAGS =
+ include $(srcdir)/deps.mk
endif
# Flags that might be in WARN_CFLAGS but are not valid for Objective C.
.SUFFIXES: .m
.c.o:
- @$(MKDEPDIR)
$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PROFILING_CFLAGS) $<
.m.o:
- @$(MKDEPDIR)
$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $(PROFILING_CFLAGS) $<
## lastfile must follow all files whose initialized data areas should
rm -f globals.h gl-stamp
rm -f *.res *.tmp
clean: mostlyclean
- rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
- -rm -rf $(DEPDIR)
+ rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) $(DEPDIR)/*
## bootstrap-clean is used to clean up just before a bootstrap.
## It should remove all files generated during a compilation/bootstrap,
distclean: bootstrap-clean
rm -f Makefile lisp.mk
+ rm -fr $(DEPDIR)
maintainer-clean: distclean
rm -f TAGS
endif
@: Compile some files earlier to speed up further compilation.
$(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)"
-
-ifeq ($(AUTO_DEPEND),yes)
--include $(ALLOBJS:%.o=${DEPDIR}/%.d)
-else
-include $(srcdir)/deps.mk
-endif
-
-### Makefile.in ends here