X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2FMakebottom;h=e2c840270933077bbf012b1a6ac67a5a99c64755;hb=305df0095d05525e1324cbc7c74d764535338b07;hp=ed4b30f7bcd3f3287d6cd5d182a2b6ab1e4b5788;hpb=aced25268d981343f5ccb1381650a8429ec2012a;p=libucw.git diff --git a/build/Makebottom b/build/Makebottom index ed4b30f7..e2c84027 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -1,5 +1,5 @@ # Bottom part of Makefile for the UCW Libraries -# (c) 1997--2007 Martin Mares +# (c) 1997--2008 Martin Mares # The run tree @@ -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)/mergedeps $(o)/depend $(o)/depend.new ; >$(o)/depend.new ; fi force: @@ -42,13 +42,13 @@ force: # Rules for configuration files -run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_DIR)/% $(o)/config.mk $(s)/build/genconf +run/$(CONFIG_DIR)/%: $(s)/$(CONFIG_SRC_DIR)/% $(o)/config.mk $(BUILDSYS)/genconf $(M)CF $< - $(Q)$(s)/build/genconf $< $@ $(o)/config.mk + $(Q)$(BUILDSYS)/genconf $< $@ $(o)/config.mk -$(o)/%.cf: $(s)/%.cf $(o)/config.mk $(s)/build/genconf +$(o)/%.cf: $(s)/%.cf $(o)/config.mk $(BUILDSYS)/genconf $(M)CF $< - $(Q)$(s)/build/genconf $< $@ $(o)/config.mk + $(Q)$(BUILDSYS)/genconf $< $@ $(o)/config.mk $(Q)cp $@ run/$(CONFIG_DIR)/$(basename $(@F)) # Rules for libraries @@ -63,12 +63,20 @@ endif %.so: $(M)LD $@ - $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $^ - $(Q)$(call symlink-alias,$@,run/lib,$(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX)) + $(Q)$(CC) $(LSHARED) $(LDFLAGS) -o $@ $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" $(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)/%.$(LS) $(M)PC $< - $(Q)DEPS="$(shell $(s)/build/lib-deps $^)" LIBDIR=$(@D) $(s)/build/genconf $< $@ $(o)/config.mk + $(Q)DEPS="$(shell $(BUILDSYS)/lib-deps $^)" LIBDIR=$(@D) $(BUILDSYS)/genconf $< $@ $(o)/config.mk $(Q)mkdir -p $(o)/pkgconfig $(Q)$(call symlink,$@,$(o)/pkgconfig) @@ -89,7 +97,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)/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)/doc-extract $(M)"DOC-EXT $<" - $(Q)$(s)/build/doc-extract $< $@ $(o)/depend.new $(s) $(patsubst %.txt,%.deflist,$@) - -# Default installation target - -default-install: - SH_EXTRA_RUNDIRS="$(sort $(EXTRA_RUNDIRS))" SH_INSTALL_RUNDIRS="$(sort $(INSTALL_RUNDIRS))" SH_CONFIGS="$(sort $(CONFIGS))" SH_AUTO_CONFIRM="$(CONFIRM)" $(s)/build/installer $(INSTALL_DIR) + $(Q)$(BUILDSYS)/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 # when searching for implicit rules and thence targets considered intermediate. .SECONDARY: -.PHONY: all clean distclean runtree programs api datafiles force tags configs dust install default-install docs +.PHONY: all clean distclean runtree programs api datafiles force tags configs dust install docs tests