mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Introduce 'make cleanall' and run it in the build dir when configuring
... but only if Makefile.config exists. cleanall will cause make to enter even SUBDIR-no dirs and clean OBJS-no files. This should fix the linking problem report by zas when running: ./configure --enable-fastmem ; make ; \ ./configure --enable-debug ; make
This commit is contained in:
parent
01f9c9f1f6
commit
9e97a100e2
20
Makefile.lib
20
Makefile.lib
@ -72,6 +72,18 @@ ifdef OBJS-yes
|
||||
OBJS += $(OBJS-yes)
|
||||
endif
|
||||
|
||||
ifneq ($(findstring cleanall,$(MAKECMDGOALS)),)
|
||||
|
||||
ifdef SUBDIRS-no
|
||||
SUBDIRS += $(SUBDIRS-no)
|
||||
endif
|
||||
ifdef OBJS-no
|
||||
OBJS += $(OBJS-no)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
ifdef OBJS
|
||||
lib.o: $(sort $(OBJS)) $(foreach subdir,$(sort $(filter-out src,$(SUBDIRS))), $(wildcard $(subdir)/lib.o))
|
||||
$(call cmd,ld_objs)
|
||||
@ -90,6 +102,8 @@ list-default:
|
||||
clean-default:
|
||||
-test -z "$(CLEAN)" || $(RM) $(CLEAN)
|
||||
|
||||
cleanall-default: clean-default
|
||||
|
||||
install-default: all-default
|
||||
ifdef PROGS
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
|
||||
@ -109,9 +123,9 @@ endif
|
||||
|
||||
# Recursion:
|
||||
|
||||
.PHONY: all-recursive install-recursive clean-recursive list-recursive
|
||||
.PHONY: all-recursive install-recursive clean-recursive cleanall-recursive list-recursive
|
||||
|
||||
all-recursive install-recursive clean-recursive list-recursive:
|
||||
all-recursive install-recursive clean-recursive cleanall-recursive list-recursive:
|
||||
ifdef SUBDIRS
|
||||
@$(foreach subdir,$(sort $(SUBDIRS)), \
|
||||
$(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;)
|
||||
@ -120,6 +134,8 @@ endif
|
||||
all: all-recursive all-default all-local
|
||||
install: install-recursive install-default install-local
|
||||
clean: clean-recursive clean-default clean-local
|
||||
|
||||
cleanall: cleanall-recursive cleanall-default
|
||||
list: list-recursive list-default
|
||||
|
||||
all-local:
|
||||
|
19
configure.in
19
configure.in
@ -18,6 +18,19 @@ AC_CHECK_PROG(AUTOHEADER,[autoheader],[autoheader],[config/missing autoheader])
|
||||
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
MAKE=
|
||||
|
||||
for make in gnumake gmake make false; do
|
||||
if test "x$MAKE" = x; then
|
||||
AC_PATH_PROGS(MAKE, "$make")
|
||||
fi
|
||||
done
|
||||
|
||||
# Cleanup if we are configuring with a previous build in the tree
|
||||
if test -e Makefile.config; then
|
||||
"$MAKE" -C "$builddir" cleanall >/dev/null 2>/dev/null
|
||||
fi
|
||||
|
||||
builddir="`pwd`"
|
||||
|
||||
dnl ===================================================================
|
||||
@ -1254,7 +1267,9 @@ AC_OUTPUT([ \
|
||||
|
||||
srcdir2="$(cd "$srcdir" && pwd)"
|
||||
if test "$srcdir2" != "$builddir"; then
|
||||
for i in $(make -C "$srcdir" list | grep Makefile); do
|
||||
MAKEFILES=$("$MAKE" -C "$srcdir" list | grep Makefile)
|
||||
|
||||
for i in $MAKEFILES; do
|
||||
$MKINSTALLDIRS "$builddir/$(dirname $i)"
|
||||
grep top_builddir= "$srcdir/$i" > "$builddir/$i"
|
||||
case "$srcdir" in
|
||||
@ -1264,7 +1279,7 @@ if test "$srcdir2" != "$builddir"; then
|
||||
echo "creating $builddir/$i"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
dnl ===================================================================
|
||||
dnl Configuration summary
|
||||
|
Loading…
Reference in New Issue
Block a user