2005-10-19 22:00:35 -04:00
|
|
|
top_builddir=.
|
|
|
|
-include $(top_builddir)/Makefile.config
|
2005-09-15 15:03:56 -04:00
|
|
|
|
2005-10-30 02:01:25 -05:00
|
|
|
SUBDIRS = doc src
|
|
|
|
SUBDIRS-$(CONFIG_NLS) += po
|
2005-09-27 12:27:17 -04:00
|
|
|
CLEAN = features.log
|
2007-12-06 16:46:19 -05:00
|
|
|
calltest = $1-$1
|
2005-09-15 15:03:56 -04:00
|
|
|
|
2005-10-02 19:29:52 -04:00
|
|
|
all-recursive: config.h
|
|
|
|
|
|
|
|
# Automagically rerun autotools
|
2005-10-22 06:54:39 -04:00
|
|
|
$(top_builddir)/config.status: $(top_srcdir)/configure
|
|
|
|
cd $(top_builddir) && $(SHELL) ./config.status --recheck
|
2005-10-02 19:29:52 -04:00
|
|
|
|
|
|
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
2017-10-22 21:23:02 -04:00
|
|
|
$(ACLOCAL_M4): $(top_srcdir)/configure.ac
|
2005-10-02 19:29:52 -04:00
|
|
|
cd $(top_srcdir) && $(ACLOCAL)
|
|
|
|
|
2017-10-22 21:23:02 -04:00
|
|
|
$(top_srcdir)/configure: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
2005-10-02 19:29:52 -04:00
|
|
|
cd $(top_srcdir) && $(AUTOCONF)
|
|
|
|
|
2005-12-06 08:59:06 -05:00
|
|
|
# Makefile.config doesn't need a separate timestamp file because
|
|
|
|
# touching it doesn't directly cause other files to be rebuilt.
|
|
|
|
$(top_builddir)/Makefile.config: $(top_srcdir)/Makefile.config.in $(top_builddir)/config.status
|
|
|
|
cd $(top_builddir) \
|
|
|
|
&& CONFIG_FILES=Makefile.config CONFIG_HEADERS= \
|
|
|
|
$(SHELL) ./config.status
|
|
|
|
|
2005-10-22 06:54:39 -04:00
|
|
|
$(top_builddir)/config.h: $(top_builddir)/stamp-h
|
|
|
|
@cd $(top_builddir) && \
|
|
|
|
if test ! -f $@; then \
|
2005-10-02 19:29:52 -04:00
|
|
|
rm -f stamp-h; \
|
|
|
|
$(MAKE) stamp-h; \
|
|
|
|
else :; fi
|
|
|
|
|
2005-10-22 06:54:39 -04:00
|
|
|
$(top_builddir)/stamp-h: $(top_srcdir)/config.h.in $(top_builddir)/config.status
|
2005-10-02 19:29:52 -04:00
|
|
|
cd $(top_builddir) \
|
|
|
|
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
|
|
|
$(SHELL) ./config.status
|
|
|
|
@echo timestamp > stamp-h 2> /dev/null
|
|
|
|
|
|
|
|
$(top_srcdir)/config.h.in: $(top_srcdir)/stamp-h.in
|
|
|
|
@if test ! -f $@; then \
|
|
|
|
rm -f $(top_srcdir)/stamp-h.in; \
|
|
|
|
$(MAKE) $(top_srcdir)/stamp-h.in; \
|
|
|
|
else :; fi
|
|
|
|
|
2017-10-22 21:23:02 -04:00
|
|
|
$(top_srcdir)/stamp-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
2005-10-02 19:29:52 -04:00
|
|
|
cd $(top_srcdir) && $(AUTOHEADER)
|
|
|
|
@echo timestamp > $(top_srcdir)/stamp-h.in 2> /dev/null
|
|
|
|
|
|
|
|
|
2007-12-06 16:46:19 -05:00
|
|
|
# Makefile.lib heavily uses $(call ...), which was added in GNU Make 3.78.
|
|
|
|
# An elinks-users post on 2007-12-04 reported trouble with GNU Make 3.68.
|
|
|
|
# Detect this situation and give an error message. $(MAKECMDGOALS) is
|
|
|
|
# only defined by 3.76 and later, so specify the "all" target as well.
|
|
|
|
# This check has been tested with GNU Make 3.68, 3.77, 3.78.1, and 3.81.
|
|
|
|
ifneq ($(call calltest,ok),ok-ok)
|
|
|
|
$(MAKECMDGOALS) default all:
|
|
|
|
@echo >&2 "You need GNU Make 3.78 or later"
|
|
|
|
@false
|
|
|
|
else
|
2005-10-01 12:18:58 -04:00
|
|
|
ifeq ($(wildcard Makefile.config),)
|
|
|
|
# Catch all
|
|
|
|
$(MAKECMDGOALS) default:
|
|
|
|
@echo "You need to first run ./configure"
|
|
|
|
else
|
2005-10-19 19:11:47 -04:00
|
|
|
include $(top_srcdir)/Makefile.lib
|
2005-10-01 12:18:58 -04:00
|
|
|
endif
|
2007-12-06 16:46:19 -05:00
|
|
|
endif
|