1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00:00

Add support for out-of-tree builds

Involves prefixing with $(srcdir) to some of the build rule variables. For
the builddir we create Makefiles which simply include the srcdir Makefile.
Add list make rule to get list of Makefiles to generate (find will get it
wrong for builddirs nested in srcdir).

There are still a few minor issues like the file paths echoed during make
install ...
This commit is contained in:
Jonas Fonseca 2005-10-20 03:49:40 +02:00 committed by Jonas Fonseca
parent b72ab2268e
commit db99a74777
6 changed files with 23 additions and 9 deletions

View File

@ -56,7 +56,7 @@ ifdef OBJS
-include $(DEP_FILES) -include $(DEP_FILES)
endif endif
%.o: %.c %.o: $(srcdir)%.c
$(call mcmd,compile) $(call mcmd,compile)
@-cp .deps/$(*F).pp .deps/$(*F).P; \ @-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \ tr ' ' '\012' < .deps/$(*F).pp \
@ -84,6 +84,9 @@ CLEAN += $(PROG)
all-default: $(LIB_O) $(PROGS) $(MAN1) $(MAN5) all-default: $(LIB_O) $(PROGS) $(MAN1) $(MAN5)
list-default:
@echo '$(RELPATH)Makefile'
clean-default: clean-default:
-test -z "$(CLEAN)" || $(RM) $(CLEAN) -test -z "$(CLEAN)" || $(RM) $(CLEAN)
@ -106,8 +109,8 @@ endif
# Recursion: # Recursion:
.PHONY: all-recursive install-recursive clean-recursive .PHONY: all-recursive install-recursive clean-recursive list-recursive
all-recursive install-recursive clean-recursive: all-recursive install-recursive clean-recursive list-recursive:
ifdef SUBDIRS ifdef SUBDIRS
@target=`echo $@ | sed s/-recursive//`; \ @target=`echo $@ | sed s/-recursive//`; \
for subdir in $(sort $(SUBDIRS)); do \ for subdir in $(sort $(SUBDIRS)); do \
@ -118,6 +121,7 @@ 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
list: list-recursive list-default
all-local: all-local:
install-local: install-local:

View File

@ -1245,6 +1245,19 @@ AC_OUTPUT([ \
src/intl/gettext/ref-del.sed src/intl/gettext/ref-del.sed
]) ])
srcdir2="$(cd "$srcdir" && pwd)"
if test "$srcdir2" != "$builddir"; then
for i in $(make -C "$srcdir" list | grep Makefile); do
$MKINSTALLDIRS "$builddir/$(dirname $i)"
grep path_to_top= "$srcdir/$i" > "$builddir/$i"
case "$srcdir" in
/*) echo "include $srcdir/$i" >> "$builddir/$i" ;;
*) echo "include \$(path_to_top)/$srcdir/$i" >> "$builddir/$i" ;;
esac
echo "creating $builddir/$i"
done
fi
dnl =================================================================== dnl ===================================================================
dnl Configuration summary dnl Configuration summary

View File

@ -1,7 +1,7 @@
path_to_top=../../.. path_to_top=../../..
include $(path_to_top)/Makefile.config include $(path_to_top)/Makefile.config
elinks.1: elinks.1.in $(top_srcdir)/configure.in elinks.1: $(srcdir)/elinks.1.in $(top_srcdir)/configure.in
cd $(top_srcdir) && \ cd $(top_srcdir) && \
CONFIG_FILES="$(RELPATH)$@" CONFIG_HEADERS= $(SHELL) ./config.status CONFIG_FILES="$(RELPATH)$@" CONFIG_HEADERS= $(SHELL) ./config.status

View File

@ -1,6 +1,6 @@
path_to_top=../../.. path_to_top=../../..
include $(path_to_top)/Makefile.config include $(path_to_top)/Makefile.config
MAN5 = elinks.conf.5 elinkskeys.5 MAN5 = $(srcdir)/elinks.conf.5 $(srcdir)/elinkskeys.5
include $(top_srcdir)/Makefile.lib include $(top_srcdir)/Makefile.lib

View File

@ -15,7 +15,7 @@ POTFILES_ABS_LIST = potfiles.list
SUFFIXES = .po .gmo .mo SUFFIXES = .po .gmo .mo
.SUFFIXES: .gmo .mo .po .SUFFIXES: .gmo .mo .po
%.gmo: %.po %.gmo: $(srcdir)/%.po
@file=`echo $* | sed 's,.*/,,'`.gmo \ @file=`echo $* | sed 's,.*/,,'`.gmo \
&& rm -f $$file && echo -n $*": " \ && rm -f $$file && echo -n $*": " \
&& $(GMSGFMT) --statistics -o $$file $< && $(GMSGFMT) --statistics -o $$file $<

View File

@ -4,9 +4,6 @@ include $(path_to_top)/Makefile.config
localedir = $(datadir)/locale localedir = $(datadir)/locale
builddir = $(top_builddir)/src/intl/gettext builddir = $(top_builddir)/src/intl/gettext
# FIXME: Makefile.config gets this wrong
srcdir = $(top_srcdir)/src/intl/gettext
OBJS = \ OBJS = \
bindtextdom.o \ bindtextdom.o \
dcgettext.o \ dcgettext.o \