]> mj.ucw.cz Git - libucw.git/commitdiff
Allow the build system live anywhere
authorMichal Vaner <vorner@ucw.cz>
Sun, 9 Nov 2008 15:46:28 +0000 (16:46 +0100)
committerMichal Vaner <vorner@ucw.cz>
Sun, 9 Nov 2008 15:46:28 +0000 (16:46 +0100)
build/Makebottom
build/Makefile
free/libs/Makefile
free/libs/examples/internal/Makefile
ucw/Makefile

index e252bbae743feed6a229e194b0f633f5f440d42b..ef951f63c2b052047b0666795ad5f0b352945555 100644 (file)
@@ -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 $(<D) run/include/$(IDST) $(?F)
+       $(Q)$(BUILDSYS_PATH)/install-includes $(<D) run/include/$(IDST) $(?F)
        $(Q)touch $@
 
 run/lib/pkgconfig/%.pc:                # RHS supplied in the sub-makefile
@@ -134,11 +134,11 @@ $(o)/%-tt.o: $(s)/%.c $(o)/autoconf.h
 
 $(o)/%-t: $(o)/%-tt.o $(TESTING_DEPS)
        $(M)LD-TEST $@
-       $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(s)/build/lib-flags $^) $(LIBS)
+       $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS_PATH)/lib-flags $^) $(LIBS)
 
-$(o)/%.test: $(s)/%.t $(s)/build/tester
+$(o)/%.test: $(s)/%.t $(BUILDSYS_PATH)/tester
        $(M)TEST $@
-       $(Q)$(s)/build/tester --rundir=run $(TESTERFLAGS) $< && touch $@
+       $(Q)$(BUILDSYS_PATH)/tester --rundir=run $(TESTERFLAGS) $< && touch $@
 
 # Rules for binaries
 
@@ -146,30 +146,30 @@ BINDIR=bin
 
 $(o)/%: $(o)/%.o
        $(M)LD $@
-       $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(s)/build/lib-flags $^) $(LIBS)
+       $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS_PATH)/lib-flags $^) $(LIBS)
        $(Q)$(call symlink,$@,run/$(BINDIR))
 
-$(o)/%: $(s)/%.sh $(o)/config.mk $(s)/build/genconf
+$(o)/%: $(s)/%.sh $(o)/config.mk $(BUILDSYS_PATH)/genconf
        $(M)PP $<
-       $(Q)$(s)/build/genconf $< $@ $(o)/config.mk
+       $(Q)$(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk
        $(Q)chmod +x $@
        $(Q)$(call symlink,$@,run/$(BINDIR))
 
-$(o)/%: %.sh $(o)/config.mk $(s)/build/genconf
+$(o)/%: %.sh $(o)/config.mk $(BUILDSYS_PATH)/genconf
        $(M)PP $<
-       $(Q)$(s)/build/genconf $< $@ $(o)/config.mk
+       $(Q)$(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk
        $(Q)chmod +x $@
        $(Q)$(call symlink,$@,run/$(BINDIR))
 
-$(o)/%: $(s)/%.pl $(o)/config.mk $(s)/build/genconf
+$(o)/%: $(s)/%.pl $(o)/config.mk $(BUILDSYS_PATH)/genconf
        $(M)PP $<
-       $(Q)$(s)/build/genconf $< $@ $(o)/config.mk
+       $(Q)$(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk
        $(Q)chmod +x $@
        $(Q)$(call symlink,$@,run/$(BINDIR))
 
-$(o)/%: %.pl $(o)/config.mk $(s)/build/genconf
+$(o)/%: %.pl $(o)/config.mk $(BUILDSYS_PATH)/genconf
        $(M)PP $<
-       $(Q)$(s)/build/genconf $< $@ $(o)/config.mk
+       $(Q)$(BUILDSYS_PATH)/genconf $< $@ $(o)/config.mk
        $(Q)chmod +x $@
        $(Q)$(call symlink,$@,run/$(BINDIR))
 
@@ -196,22 +196,22 @@ $(DATAFILES): $(o)/%: $(s)/%
 
 # Rules for documentation
 
-$(o)/%.html: $(o)/%.txt $(s)/build/asciidoc.conf $(s)/build/asciidoc-xhtml.conf run/$(DOCDIR)/$(DOC_MODULE)/.dir-stamp
+$(o)/%.html: $(o)/%.txt $(BUILDSYS_PATH)/asciidoc.conf $(BUILDSYS_PATH)/asciidoc-xhtml.conf run/$(DOCDIR)/$(DOC_MODULE)/.dir-stamp
        $(M)"DOC-HTML $<"
-       $(Q)asciidoc -e -f $(s)/build/asciidoc.conf -f $(s)/build/asciidoc-xhtml.conf -f /etc/asciidoc/asciidoc.conf -f /etc/asciidoc/xhtml11.conf $<
+       $(Q)asciidoc -e -f $(BUILDSYS_PATH)/asciidoc.conf -f $(BUILDSYS_PATH)/asciidoc-xhtml.conf -f /etc/asciidoc/asciidoc.conf -f /etc/asciidoc/xhtml11.conf $<
        $(Q)$(call symlink,$@,run/$(DOCDIR)/$(DOC_MODULE))
 
 # In reality, we do not depend on the .txt files, but on the corresponding .deflist's.
 # However, the Makefile language cannot express that doc-extract generates both .txt
 # and .deflist, so we always use the .txt's in dependencies.
-$(patsubst %.html,%.txt,$(DOC_INDICES)): $(o)/%.txt: $(patsubst %.html,%.txt,$(DOCS)) $(s)/build/doc-defs
+$(patsubst %.html,%.txt,$(DOC_INDICES)): $(o)/%.txt: $(patsubst %.html,%.txt,$(DOCS)) $(BUILDSYS_PATH)/doc-defs
        $(M)"DOC-DEFS $@"
        $(Q)echo $@: $(DOC_HEAD) $(DOC_LIST) >> $(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
index a5ac83a0b006d4ca14c872a9c2c070a79f934210..2e2ceffb49204332640e92754579f3e9f16f74bf 100644 (file)
@@ -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
index 585445652ec60906c3503fa890da08e26900220a..7080e0f3deaa221f2dd7b85c32c14e2754f0251b 100644 (file)
@@ -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)
index 13286e534a2b50a10896c678cc24c5a8024299ce..1b970e50fa8e040c1776e077a9b58e8799c92c87 100644 (file)
@@ -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
index 1fa3bfcfca8a9bbe53e5d52ed9564f392ceeb19e..69133c19d4e9923f69de1347a7e8e8a61758cb76 100644 (file)
@@ -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 $(<D) run/include/ucw $(LIBUCW_INCLUDES)
-       $(Q)$(s)/build/install-includes $(o)/ucw run/include/ucw autoconf.h
+       $(Q)$(BUILDSYS_PATH)/install-includes $(<D) run/include/ucw $(LIBUCW_INCLUDES)
+       $(Q)$(BUILDSYS_PATH)/install-includes $(o)/ucw run/include/ucw autoconf.h
        $(Q)sed -e 's/^#include "autoconf\.h"/#include <ucw\/autoconf.h>/' <$(s)/ucw/config.h >run/include/ucw/config.h
        $(Q)touch $@
 run/lib/pkgconfig/libucw.pc: $(o)/ucw/libucw.pc