From ac76aae56d2699fc541336874547a02c530af498 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 9 Nov 2008 16:46:28 +0100 Subject: [PATCH] Allow the build system live anywhere --- build/Makebottom | 50 ++++++++++++++-------------- build/Makefile | 4 +-- free/libs/Makefile | 8 +++-- free/libs/examples/internal/Makefile | 6 ++-- ucw/Makefile | 4 +-- 5 files changed, 38 insertions(+), 34 deletions(-) diff --git a/build/Makebottom b/build/Makebottom index e252bbae..ef951f63 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -31,7 +31,7 @@ tags: -include $(o)/depend $(o)/depend: force - $(Q)if [ -s $(o)/depend.new ] ; then $(s)/build/mergedeps $(o)/depend $(o)/depend.new ; >$(o)/depend.new ; fi + $(Q)if [ -s $(o)/depend.new ] ; then $(BUILDSYS_PATH)/mergedeps $(o)/depend $(o)/depend.new ; >$(o)/depend.new ; fi force: @@ -42,13 +42,13 @@ force: # Rules for configuration files -run/$(CONFIG_DIR)/%: $(s)/cf/% $(o)/config.mk $(s)/build/genconf +run/$(CONFIG_DIR)/%: $(s)/cf/% $(o)/config.mk $(BUILDSYS_PATH)/genconf $(M)CF $< - $(Q)$(s)/build/genconf $< $@ $(o)/config.mk + $(Q)$(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk -$(o)/%.cf: $(s)/%.cf $(o)/config.mk $(s)/build/genconf +$(o)/%.cf: $(s)/%.cf $(o)/config.mk $(BUILDSYS_PATH)/genconf $(M)CF $< - $(Q)$(s)/build/genconf $< $@ $(o)/config.mk + $(Q)$(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk $(Q)cp $@ run/$(CONFIG_DIR)/$(basename $(@F)) # Rules for libraries @@ -68,7 +68,7 @@ endif $(o)/%.pc: $(s)/%.pc $(o)/%.$(LS) $(M)PC $< - $(Q)DEPS="$(shell $(s)/build/lib-deps $^)" LIBDIR=$(@D) $(s)/build/genconf $< $@ $(o)/config.mk + $(Q)DEPS="$(shell $(BUILDSYS_PATH)/lib-deps $^)" LIBDIR=$(@D) $(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk $(Q)mkdir -p $(o)/pkgconfig $(Q)$(call symlink,$@,$(o)/pkgconfig) @@ -89,7 +89,7 @@ INSTALL_RUNDIRS+=include lib/pkgconfig api: $(API_INCLUDES) $(addprefix run/lib/pkgconfig/,$(addsuffix .pc,$(API_LIBS))) $(o)/%/.include-stamp: - $(Q)$(s)/build/install-includes $(> $(o)/depend.new - $(Q)$(s)/build/doc-defs $(DOC_HEAD) $@ $(DOC_LIST) + $(Q)$(BUILDSYS_PATH)/doc-defs $(DOC_HEAD) $@ $(DOC_LIST) -$(patsubst %.html,%.txt,$(DOCS)): $(o)/%.txt: $(s)/%.txt $(s)/build/doc-extract +$(patsubst %.html,%.txt,$(DOCS)): $(o)/%.txt: $(s)/%.txt $(BUILDSYS_PATH)/doc-extract $(M)"DOC-EXT $<" - $(Q)$(s)/build/doc-extract $< $@ $(o)/depend.new $(s) $(patsubst %.txt,%.deflist,$@) + $(Q)$(BUILDSYS_PATH)/doc-extract $< $@ $(o)/depend.new $(s) $(patsubst %.txt,%.deflist,$@) # Don't delete intermediate targets. There shouldn't be any, but due to bugs # in GNU Make rules with targets in not-yet-existing directories are ignored diff --git a/build/Makefile b/build/Makefile index a5ac83a0..2e2ceffb 100644 --- a/build/Makefile +++ b/build/Makefile @@ -14,6 +14,6 @@ $(o)/build/genhash: LIBS= INSTALL_TARGETS+=install-build install-build: install -d -m 755 $(DESTDIR)$(INSTALL_SHARE_DIR)/ucw/build - install -m 755 $(addprefix $(s)/build/,install-includes doc-defs doc-extract genconf mergedeps tester lib-deps lib-flags) $(DESTDIR)$(INSTALL_SHARE_DIR)/ucw/build - install -m 644 $(addprefix $(s)/build/,asciidoc.conf asciidoc-xhtml.conf Makebottom Maketop) $(DESTDIR)$(INSTALL_SHARE_DIR)/ucw/build + install -m 755 $(addprefix $(BUILDSYS_PATH)/,install-includes doc-defs doc-extract genconf mergedeps tester lib-deps lib-flags) $(DESTDIR)$(INSTALL_SHARE_DIR)/ucw/build + install -m 644 $(addprefix $(BUILDSYS_PATH)/,asciidoc.conf asciidoc-xhtml.conf Makebottom Maketop) $(DESTDIR)$(INSTALL_SHARE_DIR)/ucw/build .PHONY: install-build diff --git a/free/libs/Makefile b/free/libs/Makefile index 58544565..7080e0f3 100644 --- a/free/libs/Makefile +++ b/free/libs/Makefile @@ -10,11 +10,13 @@ s=. obj/config.mk: @echo "You need to run configure first." && false +BUILDSYS_PATH=$(s)/build + # We will use the libucw build system -include $(s)/build/Maketop +include $(BUILDSYS_PATH)/Maketop # Install the build system -include $(s)/build/Makefile +include $(BUILDSYS_PATH)/Makefile # The UCW library include $(s)/ucw/Makefile @@ -60,7 +62,7 @@ endif libs: $(LIBUCW) $(LIBSH) $(LIBIMAGES) $(LIBCHARSET) $(LIBLANG) # And finally the default rules of the build system -include $(s)/build/Makebottom +include $(BUILDSYS_PATH)/Makebottom ifndef CONFIG_LOCAL install: all $(INSTALL_TARGETS) diff --git a/free/libs/examples/internal/Makefile b/free/libs/examples/internal/Makefile index 13286e53..1b970e50 100644 --- a/free/libs/examples/internal/Makefile +++ b/free/libs/examples/internal/Makefile @@ -10,8 +10,10 @@ s=. obj/config.mk: @echo "You need to run configure first." && false +BUILDSYS_PATH=$(s)/build + # We will use the libucw build system -include $(s)/build/Maketop +include $(BUILDSYS_PATH)/Maketop # Set up names of common libraries (to avoid forward references in rules) LIBLANG=$(o)/lang/liblang.pc @@ -32,4 +34,4 @@ $(o)/test: $(o)/test.o $(LIBUCW) $(LIBLANG) $(LIBCHARSET) $(LIBIMAGES) TESTING_DEPS=$(LIBUCW) # And finally the default rules of the build system -include $(s)/build/Makebottom +include $(BUILDSYS_PATH)/Makebottom diff --git a/ucw/Makefile b/ucw/Makefile index 1fa3bfcf..69133c19 100644 --- a/ucw/Makefile +++ b/ucw/Makefile @@ -134,8 +134,8 @@ endif API_LIBS+=libucw API_INCLUDES+=$(o)/ucw/.include-stamp $(o)/ucw/.include-stamp: $(addprefix $(s)/ucw/,$(LIBUCW_INCLUDES)) $(o)/ucw/autoconf.h - $(Q)$(s)/build/install-includes $(/' <$(s)/ucw/config.h >run/include/ucw/config.h $(Q)touch $@ run/lib/pkgconfig/libucw.pc: $(o)/ucw/libucw.pc -- 2.39.2