X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2FMakebottom;h=898a8feb488a9d8c494e727efaabffb2afda6daa;hb=0db6e10eac28f38bfc3b325b13ad95107c58ce1e;hp=f3482d3e18f9976599a21b11494b6ff5b113d271;hpb=daa0dfe6a351a3fada31f173ce0c0523bacb2740;p=libucw.git diff --git a/build/Makebottom b/build/Makebottom index f3482d3e..898a8feb 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -42,7 +42,7 @@ force: # Rules for configuration files -run/$(CONFIG_DIR)/%: $(s)/cf/% $(o)/config.mk $(BUILDSYS)/genconf +run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_SRC_DIR)/% $(o)/config.mk $(BUILDSYS)/genconf $(M)CF $< $(Q)$(BUILDSYS)/genconf $< $@ $(o)/config.mk @@ -63,10 +63,18 @@ endif %.so: $(M)LD $@ - $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $^ - $(Q)$(call symlink-alias,$@,run/lib,$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX)) - -$(o)/%.pc: $(s)/%.pc $(o)/%.$(LS) + $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG_OPTS="$(PKG_CONFIG_OPTS)" $(BUILDSYS)/lib-flags $^) $(LIBS) + $(Q)$(call symlink-alias,$@,run/$(SO_RUNDIR),$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX)) + +# On Darwin, gcc expects shared libraries in *.dylib instead of *.so. +# Surprisingly, when a program is run, it suffices to have *.so files. +# We don't want to mess up the whole build system with configurable +# suffices and we also don't want to incur an overhead on Linux, so we +# just create symbolic links on Darwin, if requested. +%.dylib: %.so + cd $(dir $<) && ln -fs $(notdir $<) $(notdir $@) + +$(o)/%.pc: $(s)/%.pc $(o)/%$(LV).$(LS) $(M)PC $< $(Q)DEPS="$(shell $(BUILDSYS)/lib-deps $^)" LIBDIR=$(@D) $(BUILDSYS)/genconf $< $@ $(o)/config.mk $(Q)mkdir -p $(o)/pkgconfig @@ -134,7 +142,7 @@ $(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)" $(BUILDSYS)/lib-flags $^) $(LIBS) + $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG_OPTS="$(PKG_CONFIG_OPTS)" $(BUILDSYS)/lib-flags $^) $(LIBS) $(o)/%.test: $(s)/%.t $(BUILDSYS)/tester $(M)TEST $@ @@ -146,7 +154,7 @@ BINDIR=bin $(o)/%: $(o)/%.o $(M)LD $@ - $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(BUILDSYS)/lib-flags $^) $(LIBS) + $(Q)$(CC) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" PKG_CONFIG_OPTS="$(PKG_CONFIG_OPTS)" $(BUILDSYS)/lib-flags $^) $(LIBS) $(Q)$(call symlink,$@,run/$(BINDIR)) $(o)/%: $(s)/%.sh $(o)/config.mk $(BUILDSYS)/genconf @@ -198,7 +206,7 @@ $(DATAFILES): $(o)/%: $(s)/% $(o)/%.html: $(o)/%.txt $(BUILDSYS)/asciidoc.conf $(BUILDSYS)/asciidoc-xhtml.conf run/$(DOCDIR)/$(DOC_MODULE)/.dir-stamp $(M)"DOC-HTML $<" - $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f /etc/asciidoc/asciidoc.conf -f /etc/asciidoc/xhtml11.conf $< + $(Q)asciidoc -e -f $(BUILDSYS)/asciidoc.conf -f $(BUILDSYS)/asciidoc-xhtml.conf -f $(HOST_PREFIX)/etc/asciidoc/asciidoc.conf -f $(HOST_PREFIX)/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. @@ -218,4 +226,4 @@ $(patsubst %.html,%.txt,$(DOCS)): $(o)/%.txt: $(s)/%.txt $(BUILDSYS)/doc-extract # when searching for implicit rules and thence targets considered intermediate. .SECONDARY: -.PHONY: all clean distclean runtree programs api datafiles force tags configs dust install docs +.PHONY: all clean distclean runtree programs api datafiles force tags configs dust install docs tests