mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -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)
|
OBJS += $(OBJS-yes)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring cleanall,$(MAKECMDGOALS)),)
|
||||||
|
|
||||||
|
ifdef SUBDIRS-no
|
||||||
|
SUBDIRS += $(SUBDIRS-no)
|
||||||
|
endif
|
||||||
|
ifdef OBJS-no
|
||||||
|
OBJS += $(OBJS-no)
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifdef OBJS
|
ifdef OBJS
|
||||||
lib.o: $(sort $(OBJS)) $(foreach subdir,$(sort $(filter-out src,$(SUBDIRS))), $(wildcard $(subdir)/lib.o))
|
lib.o: $(sort $(OBJS)) $(foreach subdir,$(sort $(filter-out src,$(SUBDIRS))), $(wildcard $(subdir)/lib.o))
|
||||||
$(call cmd,ld_objs)
|
$(call cmd,ld_objs)
|
||||||
@ -90,6 +102,8 @@ list-default:
|
|||||||
clean-default:
|
clean-default:
|
||||||
-test -z "$(CLEAN)" || $(RM) $(CLEAN)
|
-test -z "$(CLEAN)" || $(RM) $(CLEAN)
|
||||||
|
|
||||||
|
cleanall-default: clean-default
|
||||||
|
|
||||||
install-default: all-default
|
install-default: all-default
|
||||||
ifdef PROGS
|
ifdef PROGS
|
||||||
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
|
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
|
||||||
@ -109,9 +123,9 @@ endif
|
|||||||
|
|
||||||
# Recursion:
|
# 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
|
ifdef SUBDIRS
|
||||||
@$(foreach subdir,$(sort $(SUBDIRS)), \
|
@$(foreach subdir,$(sort $(SUBDIRS)), \
|
||||||
$(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;)
|
$(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;)
|
||||||
@ -120,6 +134,8 @@ endif
|
|||||||
all: all-recursive all-default all-local
|
all: all-recursive all-default all-local
|
||||||
install: install-recursive install-default install-local
|
install: install-recursive install-default install-local
|
||||||
clean: clean-recursive clean-default clean-local
|
clean: clean-recursive clean-default clean-local
|
||||||
|
|
||||||
|
cleanall: cleanall-recursive cleanall-default
|
||||||
list: list-recursive list-default
|
list: list-recursive list-default
|
||||||
|
|
||||||
all-local:
|
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
|
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`"
|
builddir="`pwd`"
|
||||||
|
|
||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
@ -1254,7 +1267,9 @@ AC_OUTPUT([ \
|
|||||||
|
|
||||||
srcdir2="$(cd "$srcdir" && pwd)"
|
srcdir2="$(cd "$srcdir" && pwd)"
|
||||||
if test "$srcdir2" != "$builddir"; then
|
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)"
|
$MKINSTALLDIRS "$builddir/$(dirname $i)"
|
||||||
grep top_builddir= "$srcdir/$i" > "$builddir/$i"
|
grep top_builddir= "$srcdir/$i" > "$builddir/$i"
|
||||||
case "$srcdir" in
|
case "$srcdir" in
|
||||||
@ -1264,7 +1279,7 @@ if test "$srcdir2" != "$builddir"; then
|
|||||||
echo "creating $builddir/$i"
|
echo "creating $builddir/$i"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
dnl Configuration summary
|
dnl Configuration summary
|
||||||
|
Loading…
Reference in New Issue
Block a user