X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2FMakebottom;h=bb8c67d0ecb12b244a880e15b33d637afdc15cbe;hb=1481eca416a467e9952dbc5e4852afe66eaf1256;hp=7edfc54264abef4f321139dedef8da92e9dfb376;hpb=7d0207a101264c6f3f8335d6671829d7700dda8a;p=libucw.git diff --git a/build/Makebottom b/build/Makebottom index 7edfc542..bb8c67d0 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 @@ -18,7 +18,7 @@ programs: $(PROGS) datafiles: $(DATAFILES) tests: $(TESTS) configs: $(addprefix run/$(CONFIG_DIR)/,$(CONFIGS)) -docs: runtree $(DOCS) $(DOC_INDICES) +docs: runtree $(DOCS) $(DOC_INDICES) $(MANPAGES) tags: etags `find . -name "*.[ch]"` @@ -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,21 @@ 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)) + $(Q)ln -fs $(*F)$(SONAME_INFIX).so$(SONAME_SUFFIX) run/$(SO_RUNDIR)/$(*F)$(SONAME_INFIX).so + +# 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 $(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 +98,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 +.PHONY: all clean distclean runtree programs api datafiles force tags configs dust install docs tests