diff --git a/Makefile b/Makefile index 00b081791..52da867af 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,5 @@ -include Makefile.config -# This should be _really_ ., but only after we have src/Makefile. -# Otherwise, it wouldn't be set right in the submakefiles. -path_to_top = .. +path_to_top = . +include $(path_to_top)/Makefile.config # TODO: Automagically rerun autoconf. @@ -11,4 +9,4 @@ SUBDIRS = doc po src clean-l: rm -rf features.log -include Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/Makefile.config.in b/Makefile.config.in index de17972bf..225032001 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -6,6 +6,7 @@ SHELL = @SHELL@ top_srcdir = $(path_to_top)/@top_srcdir@ +srcdir = $(top_srcdir)/$(shell pwd | sed 's!.*/\($(shell echo $(path_to_top) | sed 's!\.\.![^/]*!')\)$$!\1!') top_builddir = $(path_to_top) prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/Makefile.lib b/Makefile.lib index aec1def47..281959cfe 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -32,7 +32,7 @@ quiet_cmd_archive = '[AR] $@' # Recursive make quiet_cmd_recmake = "[MAKE $$target] $$subdir" - cmd_recmake = $(MAKE) -C $$subdir $$target path_to_top="$(path_to_top)/.." + cmd_recmake = $(MAKE) -C $$subdir $$target diff --git a/configure.in b/configure.in index b90c7847c..5b03a1f3f 100644 --- a/configure.in +++ b/configure.in @@ -1267,7 +1267,6 @@ AC_OUTPUT([ \ contrib/lua/hooks.lua \ contrib/conv/w3m2links.awk \ doc/Makefile \ - po/Makefile \ src/Makefile \ src/bfu/Makefile \ src/bookmarks/Makefile \ diff --git a/doc/man/Makefile b/doc/man/Makefile index eb43df3a3..4244e78a2 100644 --- a/doc/man/Makefile +++ b/doc/man/Makefile @@ -1,5 +1,6 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config SUBDIRS = man1 man5 -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/doc/man/man1/Makefile b/doc/man/man1/Makefile index 50a80c6a0..24108a104 100644 --- a/doc/man/man1/Makefile +++ b/doc/man/man1/Makefile @@ -1,6 +1,7 @@ -include ../../../Makefile.config +path_to_top=../../.. +include $(path_to_top)/Makefile.config install-l: $(INSTALL_DATA) elinks.1 $(DESTDIR)$(mandir)/man1 -include ../../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/doc/man/man5/Makefile b/doc/man/man5/Makefile index 04acf0ffd..7a68cfe43 100644 --- a/doc/man/man5/Makefile +++ b/doc/man/man5/Makefile @@ -1,7 +1,8 @@ -include ../../../Makefile.config +path_to_top=../../.. +include $(path_to_top)/Makefile.config install-l: $(INSTALL_DATA) elinks.conf.5 $(DESTDIR)$(mandir)/man5 $(INSTALL_DATA) elinkskeys.5 $(DESTDIR)$(mandir)/man5 -include ../../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/po/Makefile b/po/Makefile index 6ad1b7927..285bb90d5 100644 --- a/po/Makefile +++ b/po/Makefile @@ -1,4 +1,5 @@ -include ../Makefile.config +path_to_top=.. +include $(path_to_top)/Makefile.config # Where to install the catalog files. localedir = $(datadir)/locale @@ -11,6 +12,7 @@ POTFILES_ABS = $(shell cd $(top_srcdir); find src/ -name '*.[ch]' -o -name optio SUFFIXES = .po .gmo .mo +.SUFFIXES: .gmo .mo .po .po.mo: $(MSGFMT) -o $@ $< @@ -129,4 +131,4 @@ dist: update-po distdir clean: rm -f $(PACKAGE).po *.new.po -include ../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/cache/Makefile b/src/cache/Makefile index 3f5c40dc0..b0ebcf525 100644 --- a/src/cache/Makefile +++ b/src/cache/Makefile @@ -1,8 +1,9 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config OBJS = cache.o dialogs.o all-l: libcache.a libcache.a: $(OBJS) -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/config/Makefile b/src/config/Makefile index 3eac8ae8b..3d4d6734d 100644 --- a/src/config/Makefile +++ b/src/config/Makefile @@ -1,8 +1,9 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config OBJS = cmdline.o conf.o dialogs.o home.o kbdbind.o options.o opttypes.o timer.o urlhist.o all-l: libconfig.a libconfig.a: $(OBJS) -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/ecmascript/Makefile b/src/ecmascript/Makefile index edf019d5c..1831a10c8 100644 --- a/src/ecmascript/Makefile +++ b/src/ecmascript/Makefile @@ -1,4 +1,5 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config INCLUDES += $(SPIDERMONKEY_CFLAGS) SUBDIRS = spidermonkey @@ -9,4 +10,4 @@ OBJS = ecmascript.o spidermonkey.o $(foreach obj,$(SM_OBJS),spidermonkey/$(obj)) all-l: libecmascript.a libecmascript.a: $(OBJS) -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/ecmascript/spidermonkey/Makefile b/src/ecmascript/spidermonkey/Makefile index 9fd3a7047..c052e052c 100644 --- a/src/ecmascript/spidermonkey/Makefile +++ b/src/ecmascript/spidermonkey/Makefile @@ -1,4 +1,5 @@ -include ../../../Makefile.config +path_to_top=../../.. +include $(path_to_top)/Makefile.config INCLUDES += $(SPIDERMONKEY_CFLAGS) # Do not forget to also add the .o to ../Makefile. Yes, it sucks. @@ -6,4 +7,4 @@ OBJS = document.o form.o location.o navigator.o unibar.o window.o all-l: $(OBJS) -include ../../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/formhist/Makefile b/src/formhist/Makefile index fd9907180..641bdeafb 100644 --- a/src/formhist/Makefile +++ b/src/formhist/Makefile @@ -1,8 +1,9 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config OBJS = formhist.o dialogs.o all-l: libformhist.a libformhist.a: $(OBJS) -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/globhist/Makefile b/src/globhist/Makefile index 1c2214922..1327c69ec 100644 --- a/src/globhist/Makefile +++ b/src/globhist/Makefile @@ -1,8 +1,9 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config OBJS = globhist.o dialogs.o all-l: libglobhist.a libglobhist.a: $(OBJS) -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib diff --git a/src/session/Makefile b/src/session/Makefile index ca21b32e1..1495d6231 100644 --- a/src/session/Makefile +++ b/src/session/Makefile @@ -1,8 +1,9 @@ -include ../../Makefile.config +path_to_top=../.. +include $(path_to_top)/Makefile.config OBJS = download.o history.o location.o session.o task.o all-l: libsession.a libsession.a: $(OBJS) -include ../../Makefile.lib +include $(path_to_top)/Makefile.lib